Whamcloud - gitweb
dumpe2fs: fix output for flex_bg bitmap offsets
authorAndreas Dilger <adilger@dilger.ca>
Mon, 6 Dec 2010 03:20:19 +0000 (22:20 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 6 Dec 2010 03:20:19 +0000 (22:20 -0500)
commit0e2afdbaccbd56d58c291763bac5902032bf5f53
treefe3c35aa85b18eb5ab123e2b1e7445adf8e39423
parent5a2db04637c8494f6f600994f98fe0df23c4524c
dumpe2fs: fix output for flex_bg bitmap offsets

When running dumpe2fs on a filesystem formatted with flex_bg, it
prints out the relative offsets for the bitmaps and inode table
badly on 64-bit systems, because the offset is computed as a
large positive number instead of being a negative numer (which
will not be printed at all):

Group 1: (Blocks 0x8000-0xffff) [INODE_UNINIT, ITABLE_ZEROED]
 Block bitmap at 0x0102 (+4294934786), Inode bitmap at 0x0202 (+4294935042)
 Inode table at 0x037e-0x03fa (+4294935422)

This commit prints out the relative offsets for flex_bg
groups as the offset within the reported group.  This makes it
more clear where the metadata is located, rather than simply
printing some large negative number.

Group 1: (Blocks 0x8000-0xffff) [INODE_UNINIT, ITABLE_ZEROED]
 Block bitmap at 0x0102 (bg #0 +258), Inode bitmap at 0x0202 (bg #0 +514)
 Inode table at 0x037e-0x03fa (bg #0 +894)

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
misc/dumpe2fs.c