Christoph Hellwig hch at infradead.org
Thu Jun 1 07:06:12 UTC 2017

On Wed, May 31, 2017 at 04:29:10PM +0200, Björn Jacke wrote:
> On 2017-05-11 at 00:25 -0700 Christoph Hellwig sent off:
> > As I haven't seen any follow up here:  Can we please move the
> > IOC_CLONE_RANGE support out of the btrfs module as it's a general Linux
> > API, and can't just be replace with copy_file_range?
> from what I can tell copy_file_range? does what we need, doesn't it?
> And it has support for several filesystems already while IOC_CLONE_RANGE
> might only be supported for more filesystems in the future (maybe).

It depends on what you want.  copy_file_range is a simple copy offload,
and in fact explicit support for it is in the same file systems as
IOC_CLONE_RANGE (btrfs, ocfs2, xfs, cifs, nfs), but it has a fallback
to just do a copy loop in the kernel.

But the way I understand it FSCTL_DUPLICATE_EXTENTS_TO_FILE is in fact
the Windows equivalent to IOC_CLONE_RANGE, which expects refcounted
copies, and no short writes or other weird errors.

FSCTL_SRV_COPYCHUNK_WRITE on the other hand seems to be the equivalent
to copy_file_range and should probably be implemented by it.

More information about the samba-technical mailing list