From 35238dd1a5585d042e5f0d478211e9fdfb4873e1 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Thu, 23 Dec 2004 13:54:28 -0500 Subject: [PATCH] Enhance dumpe2fs so that it will print the location of the reserved GDT blocks if they are present. --- misc/ChangeLog | 5 +++++ misc/dumpe2fs.c | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/misc/ChangeLog b/misc/ChangeLog index 9c9d83d..e040632 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,8 @@ +2004-12-23 Theodore Ts'o + + * dumpe2fs.c (list_desc): If reserved GDT blocks are present, + display them along with the other filesystem meta blocks. + 2004-12-22 Theodore Ts'o * fsck.c (main): Check return from malloc of fsck_path string. diff --git a/misc/dumpe2fs.c b/misc/dumpe2fs.c index da8fdfa..73042fa 100644 --- a/misc/dumpe2fs.c +++ b/misc/dumpe2fs.c @@ -93,7 +93,7 @@ static void list_desc (ext2_filsys fs) blk_t group_blk, next_blk; blk_t super_blk, old_desc_blk, new_desc_blk; char *block_bitmap=NULL, *inode_bitmap=NULL; - int inode_blocks_per_group, old_desc_blocks; + int inode_blocks_per_group, old_desc_blocks, reserved_gdt; int has_super; if (fs->block_map) @@ -105,6 +105,7 @@ static void list_desc (ext2_filsys fs) EXT2_INODE_SIZE(fs->super)) + EXT2_BLOCK_SIZE(fs->super) - 1) / EXT2_BLOCK_SIZE(fs->super); + reserved_gdt = fs->super->s_reserved_gdt_blocks; fputc('\n', stdout); group_blk = fs->super->s_first_data_block; if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) @@ -130,6 +131,13 @@ static void list_desc (ext2_filsys fs) printf(_(", Group descriptors at ")); printf(range_format, old_desc_blk, old_desc_blk + old_desc_blocks - 1); + if (reserved_gdt) { + printf(_("\n Reserved GDT blocks at ")); + printf(range_format, + old_desc_blk + old_desc_blocks, + old_desc_blk + old_desc_blocks + + reserved_gdt - 1); + } } else if (new_desc_blk) { fputc(has_super ? ',' : ' ', stdout); printf(_(" Group descriptor at ")); -- 1.8.3.1