Whamcloud - gitweb
filefrag: improvements to filefrag FIEMAP handling
authorAndreas Dilger <adilger@whamcloud.com>
Thu, 22 Nov 2012 15:06:12 +0000 (15:06 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 30 Dec 2012 03:41:41 +0000 (22:41 -0500)
commit2508eaa71e8bbe93155052ded448e5e78d213715
tree73c0ce277aa069b93736b97afdea8982df745ed1
parent0ce0172984c807d3366e8db6e2a2b6ecae314832
filefrag: improvements to filefrag FIEMAP handling

Update the filefrag program to allow displaying the extents in
some different formats.  Try and stay within 80 columns.
* add -k option to print extents in kB-sized units (like df -k)
* add -b {blocksize} to print extents in blocksize units
* add -e option to print extent format, even when FIBMAP is used
* add -X option to print extents in hexadecimal format

Internally, the FIBMAP handling code has been moved into its own
function like FIEMAP, so that the code is more modular.  Extent
offsets are now handled in bytes instead of in blocks, to allow
printing extents with arbitrary block sizes.  The extent header
printing also moved into its own function so that it can be shared
between the FIEMAP and FIBMAP handling routines, since it got more
complex with the different output options.

Only print error about FIBMAP being root-only a single time.
Print the filesystem type if it changes between specified files.
Add fsync() for FIBMAP if "-s" is given.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/filefrag.8.in
misc/filefrag.c