Skip to content
Snippets Groups Projects
Commit d18f026e authored by Colin Walters's avatar Colin Walters
Browse files

fdio: Merge systemd code to use copy_file_range(), use FICLONE

FICLONE is the new alias for the formerly btrfs-specific ioctl; XFS
has experimental patches to support it.

Further, we should use copy_file_range() for the case where we're only doing a
limited copy. Both NFS and XFS (with reflink enabled) understand it.

Part of the reason I'm doing this is so that ostree's `/etc` merge will start
using XFS reflinks. But another major reason is to take the next step after and
copy this code into GLib as well, so that all of the general GLib users will
benefit; e.g. Nautilus will transparently do server copy offloads with NFS home
directories.

See also this coreutils thread about `copy_file_range()`:
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24399>. I don't care about file
holes for our use cases, so it's fine.

Other changes while I'm here:
 - Tweak the sendfile() case to match the newly inlined logic for cfr
 - Add a TEMP_FAILURE_RETRY() around the read()
parent 29ad99c9
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment