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. -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html