[PATCH 5/5] vfs_default: add copy_file_range support for copy chunk

David Disseldorp ddiss at samba.org
Fri Jan 20 13:55:29 UTC 2017


Hi Björn,

On Fri, 20 Jan 2017 00:01:43 +0100, Björn Jacke wrote:

> we try to use the copy_file_range syscall first, which can ideally be a
> zero-copy operation. We fall back to userspace read/write if copy_file_range
> is not available.

Thanks for working on this. A couple of comments on this patch:
- Please use the off_in/off_out syscall parameters instead of seeking.
- I'd prefer to see the copy_file_range() loop split into a separate
  copy_chunk_send_fn hook, with a fallback to vfswrap_copy_chunk_send(),
  for the following reasons:
  + this would avoid the 8M I/O buffer allocation in the fast-path.
  + mid-function #ifdef pollution would be avoided.
  + FSCTL Duplicate Extents To File doesn't permit server-side
    read/write fallback. Blocking this in the copy_file_range()
    parent function would be cleaner.
  + I/O sizes could be tuned independently of the read/write loop.

Cheers, David



More information about the samba-technical mailing list