From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Dilger Subject: Re: [RFC][PATCH 0/5] Fiemap, an extent mapping ioctl Date: Wed, 28 May 2008 10:02:01 -0600 Message-ID: <20080528160201.GA7263@webber.adilger.int> References: <20080525000148.GJ8325@wotan.suse.de> <20080525194203.GB24328@infradead.org> <20080527185622.GR8325@wotan.suse.de> <20080527203124.GC27827@mail.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7BIT Cc: Mark Fasheh , Christoph Hellwig , linux-fsdevel@vger.kernel.org, Andreas Dilger , Kalpak Shah , Eric Sandeen , Josef Bacik To: Joel Becker Return-path: Received: from sca-es-mail-1.Sun.COM ([192.18.43.132]:42074 "EHLO sca-es-mail-1.sun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751578AbYE1QCR (ORCPT ); Wed, 28 May 2008 12:02:17 -0400 Received: from fe-sfbay-10.sun.com ([192.18.43.129]) by sca-es-mail-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m4SG2Fxs005855 for ; Wed, 28 May 2008 09:02:15 -0700 (PDT) Received: from conversion-daemon.fe-sfbay-10.sun.com by fe-sfbay-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) id <0K1L003012CB7400@fe-sfbay-10.sun.com> (original mail from adilger@sun.com) for linux-fsdevel@vger.kernel.org; Wed, 28 May 2008 09:02:15 -0700 (PDT) In-reply-to: <20080527203124.GC27827@mail.oracle.com> Content-disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On May 27, 2008 13:31 -0700, Joel Becker wrote: > On Tue, May 27, 2008 at 11:56:22AM -0700, Mark Fasheh wrote: > > > > If the request has the FIEMAP_FLAG_NUM_EXTENTS flag set, then calling > > > > this helper is not necessary and fi_extents_mapped can be set > > > > directly. > > > > > > Sounds like the count number of extents request should be a separate > > > ioctl and separate filesystem entry point instead of overloading FIEMAP. > > > > > > Just define a simple FIECOUNT ioctl. > > > > What about the back-end though? This is pretty transparently handled in > > fiemap_fill_next_extent() and many file systems (Ocfs2 included) would just > > have ->fiecount callbacks that are nearly identical ->fiecount to their > > ->fiemap... > > Provide generic_fiemap_fiecount() that does the operation in > terms of ->fiemap(). Then filesystems like ocfs2 can just do .fiecount > = generic_fiemap_fiecount. > I agree with Christoph that it seems a bit overloaded when done > as a special case of FIEMAP. The question is whether there are any (or many) filesystems that will NOT implement ->fiecount() as a wrapper of ->fiemap()? At that point the "simplification" of the API means that there is actually more code and layers being called for the simple version. I'm not saying I'm against having a FIECOUNT ioctl, we're probably just going to use an updated filefrag like everyone else, but it doesn't seem like a net reduction in code anywhere. Cheers, Andreas -- Andreas Dilger Sr. Staff Engineer, Lustre Group Sun Microsystems of Canada, Inc.