From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 1/9] vfs: add COPY_FILE_CLONE_ONLY flag Date: Fri, 13 Nov 2015 00:58:22 -0800 Message-ID: <20151113085822.GA2272@infradead.org> References: <1445728636-10109-1-git-send-email-tao.peng@primarydata.com> <1445728636-10109-2-git-send-email-tao.peng@primarydata.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Trond Myklebust , Anna Schumaker , Christoph Hellwig , Zach Brown , Darren Hart , Jeff Layton , bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org, "Darrick J. Wong" , viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org, linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-btrfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Steve French To: Peng Tao Return-path: Content-Disposition: inline In-Reply-To: <1445728636-10109-2-git-send-email-tao.peng-7I+n7zu2hftEKMMhf/gKZA@public.gmane.org> Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-fsdevel.vger.kernel.org On Sun, Oct 25, 2015 at 07:17:08AM +0800, Peng Tao wrote: > To tell file system not to return partial success in the > .copy_file_range method. This is useful to implement the > clone (or reflink) functionality. The return value is only part of it, the other part is to make it atomic. Thus I don't think overloading copy_file_range is a good idea - we should have a seaprate .clone_file_range that is called by the btrfs ioctls moved to the core, and have vfs_copy_file_range use .clone_file_range if that exists, and if none of the potentially conflicting future flags like COPY_FALLOC are present.