From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:45432 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753526AbbK0Kme convert rfc822-to-8bit (ORCPT ); Fri, 27 Nov 2015 05:42:34 -0500 Date: Fri, 27 Nov 2015 11:42:32 +0100 From: David Disseldorp To: Christoph Hellwig Cc: viro@zeniv.linux.org.uk, tao.peng@primarydata.com, jeff.layton@primarydata.com, linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, Steve French Subject: Re: [PATCH 1/5] cifs: implement clone_file_range operation Message-ID: <20151127114232.5b367b7b@g21.suse.de> In-Reply-To: <1448563859-21922-2-git-send-email-hch@lst.de> References: <1448563859-21922-1-git-send-email-hch@lst.de> <1448563859-21922-2-git-send-email-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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