Add support for Btrfs clone ioctl#640
Add support for Btrfs clone ioctl#640szekelyszilv wants to merge 4 commits intoIgnorantGuru:nextfrom
Conversation
Btrfs clone ioctl can be used for O(1) copying within a file system utilizing copy-on-write. Passing --enable-btrfs-clone to ./configure enables this feature. The feature is dependent on the "btrfs/ioctl.h" header which is part of btrfs-progs. vfs_file_task_do_copy is modified to always try to call the ioctl, and fall back to the regular copying method if it fails.
|
I found this useful e.g. for quickly and cheaply creating backup copies where a more robust approach was not required. |
|
Looks reasonable. Need to document any build dependencies this would add. Also configure should probably default to using it if the dependencies are present, like it does with startup-notification, since this seems standardized in coreutils. If the deps aren't available, or if you add --disable-btrfs-clone (if such an option is even worth it), then it can skip it. If you require --enable-btrfs-clone explicitly, it will rarely get used. |
Change definition from USE_ to HAVE_
Code cleanup, reduce #ifdefs Add clone_file function that tries to clone using available methods in turn. Return success if one of the succeeds or failure if none of them do or are available.
|
Changed it to be used by default and added it to the output of the configure script. In VFS file task the clone_file function can be used to add other clone methods |
|
Any chance of having this merged soon? |
Btrfs clone ioctl can be used for O(1) copying within a file system
utilizing copy-on-write.
Passing --enable-btrfs-clone to ./configure enables this feature.
The feature is dependent on the "btrfs/ioctl.h" header which is part of
btrfs-progs.
vfs_file_task_do_copy is modified to always try to call the ioctl,
and fall back to the regular copying method if it fails.