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 -- 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