You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is new awesome upcoming feature which can dramatically improve copying files on Copy on Write file systems: UV_FS_COPYFILE_FICLONE
File copied (cloned) this way will not occupy additional disk space until first modification, but it also have all the properties that standalone file has.
Btrfs provides a clone operation that atomically creates a copy-on-write snapshot of a file. Such cloned files are sometimes referred to as reflinks, in light of the associated Linux kernel system calls.
By cloning, the file system does not create a new link pointing to an existing inode; instead, it creates a new inode that initially shares the same disk blocks with the original file. As a result, cloning works only within the boundaries of the same Btrfs file system, but since version 3.6 of the Linux kernel it may cross the boundaries of subvolumes under certain circumstances. The actual data blocks are not duplicated; at the same time, due to the copy-on-write (CoW) nature of Btrfs, modifications to any of the cloned files are not visible in the original file and vice versa.
Cloning should not be confused with hard links, which are directory entries that associate multiple file names with actual files on a file system. While hard links can be taken as different names for the same file, cloning in Btrfs provides independent files that share their disk blocks.
Support for this Btrfs feature was added in version 7.5 of the GNU coreutils, via the --reflink option to the cp command.
.. c:function:: int uv_fs_copyfile(uv_loop_t* loop, uv_fs_t* req, const char* path, const char* new_path, int flags, uv_fs_cb cb)
Copies a file from path to new_path. Supported flags are described below.
—————————————————————————————
- UV_FS_COPYFILE_FICLONE: If present, uv_fs_copyfile() will attempt to
create a copy-on-write reflink. If the underlying platform does not
support copy-on-write, then a fallback copy mechanism is used.
—————————————————————————————
.. versionchanged:: 1.20.0 UV_FS_COPYFILE_FICLONE is supported.
The text was updated successfully, but these errors were encountered:
@raphamorim someone else reached out to me via Discord expressing intent to work on this. If that person can respond here maybe, you can work together?
Resolved by in #6302 by @as-com and @arcanisThank you! — commit 3c34587
I didn't expect that solution will be so simple, really nice :-)
I hope there aren't cases which can save duplicated content on disk.
Do you want to request a feature or report a bug?
Feature
Prerequisites
Summary
There is new awesome upcoming feature which can dramatically improve copying files on Copy on Write file systems:
UV_FS_COPYFILE_FICLONE
File copied (cloned) this way will not occupy additional disk space until first modification, but it also have all the properties that standalone file has.
Cloning from Btrfs at Wikipedia.org (+)
Btrfs provides a clone operation that atomically creates a copy-on-write snapshot of a file. Such cloned files are sometimes referred to as reflinks, in light of the associated Linux kernel system calls.
By cloning, the file system does not create a new link pointing to an existing inode; instead, it creates a new inode that initially shares the same disk blocks with the original file. As a result, cloning works only within the boundaries of the same Btrfs file system, but since version 3.6 of the Linux kernel it may cross the boundaries of subvolumes under certain circumstances. The actual data blocks are not duplicated; at the same time, due to the copy-on-write (CoW) nature of Btrfs, modifications to any of the cloned files are not visible in the original file and vice versa.
Cloning should not be confused with hard links, which are directory entries that associate multiple file names with actual files on a file system. While hard links can be taken as different names for the same file, cloning in Btrfs provides independent files that share their disk blocks.
Support for this Btrfs feature was added in version 7.5 of the GNU coreutils, via the
--reflink
option to thecp
command.Relevant paragraph from libuv docs (+)
The text was updated successfully, but these errors were encountered: