Whamcloud - gitweb
filefrag: count 0 extents properly when verbose
authorEric Sandeen <sandeen@redhat.com>
Thu, 5 May 2011 18:21:08 +0000 (13:21 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 7 May 2011 22:34:40 +0000 (18:34 -0400)
commita8d8432b584c222dc7960c15cd7b9acbc7c72352
tree12921a1d6a353dcf29c93bd32520e3fb17204a3f
parentc89848978c60182a94c40a9d24b900c58d9edc90
filefrag: count 0 extents properly when verbose

/boot/a: 0 extents found

works properly, but

Filesystem type is: ef53
Filesystem cylinder groups is approximately 61
File size of a is 0 (0 blocks, blocksize 1024)
 ext logical physical expected length flags
a: 1 extent found

yields 1 extent when it should be 0.

Fix this up by special-casing no extents returned in verbose
mode; skip printing the header for the columns too, since there
are no columns to print.

Also, in nonverbose mode we can set fm_extent_count to 0
so that FIEMAP will just query the extent count without gathering
details; clarify this with a comment.

Addresses-RedHat-Bugzilla: 653234
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/filefrag.c