lsm_fs_file_clone(3)

πŸ“¦
version 1.10.3 Β· 3 versions
, in fedora 43, fedora 44

πŸ’– lsm_fs_file_clone β€” bestie edition πŸ’–

okay so you're here for lsm_fs_file_clone(3), from the Libstoragemgmt C API Manual, and honestly? iconic choice. this lil function clones a file on a file system. that's it. that's the vibe. let's get into it πŸ¦‹


✨ NAME ✨

lsm_fs_file_clone β€” Clones a file on a file system.


✨ SYNOPSIS ✨

int lsm_fs_file_clone (lsm_connect *conn, lsm_fs *fs, const char
*src_file_name, const char *dest_file_name, lsm_fs_ss *snapshot, char
**job, lsm_flag flags);

✨ ARGUMENTS ✨

okay bestie, here's who's who in this function's little friend group 🫢

  • conn β€” Valid connection. gotta be a real one, no fake connections allowed.
  • fs β€” Pointer of lsm_fs which file resides. it's the file system where your file lives, so like… know where your file lives. main character energy.
  • src_file_name β€” String. Source file relative name & path. this is the original, the blueprint, the it-girl file πŸ’…
  • dest_file_name β€” String. Destination file relative name & path. where the clone shows up. its new home fr fr.
  • snapshot β€” Pointer of lsm_fs_ss. Snapshot of source file is based on. If NULL, use current state of this file. Returned value must be freed with a call to lsm_fs_ss_record_free. ⚠️ yes bestie, free it. don't leave it hanging, that's not cute.
  • job β€” Output pointer of string. If storage system support asynchronous action on this, a job will be created and could be tracked via lsm_job_status_get. NULL if storage system does not support asynchronous action on this. so if you get a job back, go track it. no ghosting πŸ‘»
  • flags β€” Reserved for future use, must be LSM_CLIENT_FLAG_RSVD. don't be creative here, literally just pass that.

✨ VERSION ✨

1.0 ✨ the original release, the blueprint, the moment.


✨ DESCRIPTION ✨

Clones the specified file on a file system. that's the whole plot. short, sweet, slays πŸ’–


✨ CAPABILITY ✨

LSM_CAP_FILE_CLONE

like yes, this is the capability that has to be in the mix for any of this to work. no cap.


✨ RETURN ✨

it hands you back an error code, as enumerated by lsm_error_number. here's the whole roster, no gatekeeping πŸ™ˆ

  • LSM_ERR_OK β€” On success. πŸŽ€ ate and left no crumbs.
  • LSM_ERR_JOB_STARTED β€” A job is started. Please check the job output pointer. go look at your job, bestie!!
  • LSM_ERR_INVALID_ARGUMENT β€” When any argument is NULL or not a valid lsm_connect pointer or invalid flags. πŸ’€ something you passed was not it.
  • LSM_ERR_NOT_FOUND_FS β€” When file system not found. it's giving lost in the sauce 😭
  • LSM_ERR_NOT_ENOUGH_SPACE β€” Pool does not have enough space. the pool said no room, sorry babe πŸ“
  • LSM_ERR_NO_SUPPORT β€” Not supported. this storage system just doesn't do that, and that's on periodt.

ngl, remember the big ones: flags has to be LSM_CLIENT_FLAG_RSVD, snapshot being NULL means "use the current state of this file", and if you get a job back you track it with lsm_job_status_get. those are the ✨important✨ bits, iykyk.

anyway that's the whole page, you're basically a storage cloning expert now πŸ‘‘

stay slay, stay hydrated, and if this manual was useful it's all thanks to the Libstoragemgmt C API Manual, page lsm_fs_file_clone(3) β€” and this little gem is dated February 2026 🌸 xoxo bye bestie πŸ’œ

πŸ“¦ where this page comes from