lsm_fs_file_clone(3)
π 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 oflsm_fswhich 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 oflsm_fs_ss. Snapshot of source file is based on. IfNULL, use current state of this file. Returned value must be freed with a call tolsm_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 vialsm_job_status_get.NULLif 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 beLSM_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 thejoboutput pointer. go look at yourjob, bestie!!LSM_ERR_INVALID_ARGUMENTβ When any argument isNULLor not a validlsm_connectpointer 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:flagshas to beLSM_CLIENT_FLAG_RSVD,snapshotbeingNULLmeans "use the current state of this file", and if you get ajobback you track it withlsm_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
- fedora 43: libstoragemgmt-devel 1.10.3-1.fc43 Β· LGPL-2.1-or-later
- fedora 44: libstoragemgmt-devel 1.10.3-1.fc44 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms