From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Fasheh Subject: Re: [RFC][PATCH 0/5] Fiemap, an extent mapping ioctl Date: Tue, 27 May 2008 11:56:22 -0700 Message-ID: <20080527185622.GR8325@wotan.suse.de> References: <20080525000148.GJ8325@wotan.suse.de> <20080525194203.GB24328@infradead.org> Reply-To: Mark Fasheh Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, Andreas Dilger , Kalpak Shah , Eric Sandeen , Josef Bacik To: Christoph Hellwig Return-path: Received: from cantor2.suse.de ([195.135.220.15]:51781 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755788AbYE0S4Y (ORCPT ); Tue, 27 May 2008 14:56:24 -0400 Content-Disposition: inline In-Reply-To: <20080525194203.GB24328@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sun, May 25, 2008 at 03:42:03PM -0400, Christoph Hellwig wrote: [ I'll get back to you regarding luns and the HSM flag ] > > struct fiemap_extent_info { > > unsigned int fi_flags; /* Flags as passed from user */ > > unsigned int fi_extents_mapped; /* Number of mapped extents */ > > unsigned int fi_extents_max; /* Size of fiemap_extent array */ > > char *fi_extents_start; /* Start of fiemap_extent array */ > > }; > > Why is this passes a structure instead of individual arguments? [ The structure vs args seems to been addressed elsewhere in this thread ] > Also why isn't fi_extents_start properly typed? There's no good reason, my brain just wrote it that way. I can type it properly in my next patch. > > 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. Having it as a seperate, simpler ioctl is fine with me. As it is, we're sort of shoe-horning it into a structure which is more optimized for returning actual extent data. The flag breaks lots of rules for that structure, such as no actual fm_extents needing to be allocated, fm_extent_count is magically ignored for that call, etc. So the simpler API to userspace is a win, IMHO. 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... --Mark -- Mark Fasheh