The major change from v1 of the patch is that for FIBMAP files it considers logical file discontinuity as well as physical discontinuity. This impacts only sparse files, but provides more accurate information in "extent" output format. The old filefrag output has not been changed (for compatibility, if that is a concern), though it now reports a different number of extents for sparse files. This could be changed fairly easily.
The extent format output is improved to be more similar to that of xfs_bmap, so it prints out a range of logical and physical block numbers in addition to the extent length, so that it is easier to see where the discontinuities are. There is also an option to print out the extents/lengths in hex, and using a different blocksize (e.g. "- b1M" to print in units of 1MB):
$ filefrag -e -b1M "Indiana Jones And The Temple Of Doom.avi" ext: logical_offset: physical_offset: length: flags: 0: 0.. 1: 320566.. 320567: 1: 1: 1.. 3: 320866.. 320868: 2: 2: 3.. 3: 320768.. 320768: 0: 3: 4.. 29: 320870.. 320895: 26: 4: 30.. 155: 320898.. 321023: 126: 5: 156.. 281: 321026.. 321151: 126: 6: 282.. 407: 321154.. 321279: 126: 7: 408.. 533: 321282.. 321407: 126: 8: 534.. 659: 321410.. 321535: 126: eofAlso included is support for FIEMAP extensions to support multi-device filesystems (e.g. Lustre, ZFS, maybe btrfs in the future).
Cheers, Andreas -- Andreas Dilger Sr. Staff Engineer, Lustre Group Sun Microsystems of Canada, Inc.
Attachment:
e2fsprogs-fiemap-lustre.patch
Description: Binary data