From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamie Lokier Subject: Re: [PATCH 1/3] fs: Document the reflink(2) system call. Date: Tue, 5 May 2009 17:03:13 +0100 Message-ID: <20090505160313.GF31100@shareable.org> References: <1241331303-23753-1-git-send-email-joel.becker@oracle.com> <1241331303-23753-2-git-send-email-joel.becker@oracle.com> <20090505010703.GA12731@shareable.org> <20090505071608.GB10258@mail.oracle.com> <20090505130114.GD17486@mit.edu> <20090505131907.GF25328@shareable.org> <1241530798.7244.65.camel@think.oraclecorp.com> <20090505153629.GB31100@shareable.org> <1241538102.7244.72.camel@think.oraclecorp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Theodore Tso , linux-fsdevel@vger.kernel.org, jmorris@namei.org, ocfs2-devel@oss.oracle.com, viro@zeniv.linux.org.uk To: Chris Mason Return-path: Received: from mail2.shareable.org ([80.68.89.115]:48785 "EHLO mail2.shareable.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751306AbZEEQDO (ORCPT ); Tue, 5 May 2009 12:03:14 -0400 Content-Disposition: inline In-Reply-To: <1241538102.7244.72.camel@think.oraclecorp.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Chris Mason wrote: > > > The main difference between reflink and the btrfs ioctl is that in the > > > btrfs ioctl the destination file must already exist. The btrfs code can > > > also do range replacements in the destination file, but I'd agree with > > > Joel that we don't want to toss the kitchen sink into something nice and > > > clean like reflink. > > > > Ah, now that I know about the BTRFS data-cloning ioctl... :-) > > > > I'm wondering why reflink() is needed at all. Can't it be done in > > userspace, using the BTRFS ioctl? The hard part in userspace seems to > > be copying the file attributes, but "cp -a" and other tools manage. > > > > reflink is a subset of what the btrfs ioctl does, and that's a good > thing. The way they've added support for this to ocfs2 is really cool, > and the same ideas could be used in other filesystems. > > So, I'd rather see a system call that everyone can implement, and if > btrfs hangs on to the ioctl for extra features, even better. Realistically, very few existing filesystems can implement this system call. I agree that it's much more likely that a filesystem can implement reflink() than BTRFS' more flexible data cloning though. -- Jamie