Details
-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
0
Description
Linux gives a generic copy_file_range API that allows you to copy a portion of a file from a source file to a destination file. Depending on the filesystem this API can do certain optimisations. For example, xfs/btrfs can optimise the copy by using reflinks i.e. instead of doing the file writes into the target file, it can simply increment the extent reference counting. Such that both the source file as well as the destination file, both can refer to the same extent.
As this process does not require a file write, it is much more efficient and reduces write amp.