Re: [PATCH 1/5] cifs: implement clone_file_range operation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Christoph,

On Thu, 26 Nov 2015 19:50:55 +0100, Christoph Hellwig wrote:

> And drop the fake support for the btrfs CLONE ioctl - SMB2 copies are
> chunked and do not actually implement clone semantics!

BTRFS_IOC_CLONE is implemented using the new ReFS
FSCTL_DUPLICATE_EXTENTS_TO_FILE request, which was deemed to be COW
based[1]:

"The purpose of this operation is to make it look like a copy of a
 region from the source stream to the target stream has occurred when
 in reality no data is actually copied. This operation modifies the
 target stream’s extent list such that, the same clusters are pointed
 to by both the source and target streams’ extent lists for the region
 being copied."

I think that's about as close as we're going to get to clone semantics
for cifs. It's also dispatched as a single request covering the full
file - chunking only occurs for CIFS_IOC_COPYCHUNK_FILE based requests,
which are implemented using FSCTL_SRV_COPYCHUNK_WRITE, and not (always)
handled by the server as a COW clone.

It looks like there's also a minor cut 'n paste error here...

> @@ -942,6 +960,8 @@ const struct file_operations cifs_file_strict_ops = {
>  	.splice_read = generic_file_splice_read,
>  	.llseek = cifs_llseek,
>  	.unlocked_ioctl	= cifs_ioctl,
> +	.copy_file_range = cifs_file_copy_range,
> +	.copy_file_range = cifs_file_copy_range,

Cheers, David

1. FSCTL_DUPLICATE_EXTENTS_TO_FILE discussion
https://lists.samba.org/archive/samba-technical/2015-February/105410.html
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux