Server-side copy with sendfile system call

Teng-Feng Yang shinrairis at
Mon May 12 02:18:11 MDT 2014


I recently noticed that samba now supports server-side copy feature.
For BTRFS, the btrfs VFS module will override the copy_chunk_send/recv
to utilize the copy_range ioctl to improve the copy performance
further. For other filesystem such as ext4, it will fallback to
default copy_chunk behavior which pread the file data and pwrite them
to the copy destination.

This makes me wonder if we can replace the read-then-write procedure
with sendfile system call which claims to outperform the file copy in

Any comment would be appreciated.


More information about the samba-technical mailing list