On May 28, 2008 10:04 -0700, Joel Becker wrote: > It's not about net reduction of code. It's about a readable and > understandable interface. "Pass this array of extent structures we'll > ignore if you set this special flag" is pretty ugly. Calling FIECOUNT > separately is nice. How it is implemented in the kernel is a whole > 'nother ball of wax - maybe we don't have ->fiecount() and always > implement FIECOUNT in terms of a ->fiemap() walk. Doesn't matter. In the FIEMAP + NUM_EXTENTS count, you don't need to pass the array of structures, just the header. I don't think this is an onerous interface: struct fiemap fiemap = { .fm_start = 0, .fm_length = ~0ULL, .fm_num_extents = 0, .fm_flags = FIEMAP_FLAG_NUM_EXTENTS } rc = ioctl(fd, FIEMAP, &fiemap); if (rc == 0) num_extents = fiemap.fm_mapped_extents; We wouldn't need to even specify .fm_num_extents, if the VFS handler doesn't check its validity for FIEMAP_FLAG_NUM_EXTENTS (contrary to my recent change proposal). 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