Skip to content

Commit

Permalink
Make dumpe2fs uninit block group aware
Browse files Browse the repository at this point in the history
Signed-off-by: Jose R. Santos <[email protected]>
Signed-off-by: Andreas Dilger <[email protected]>
Signed-off-by: "Theodore Ts'o" <[email protected]>
  • Loading branch information
Jose R. Santos authored and tytso committed Mar 20, 2008
1 parent 4e988cb commit 777a8c1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions misc/dumpe2fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ static void print_bg_opts(ext2_filsys fs, dgrp_t i)
{
int first = 1, bg_flags;

if (fs->super->s_feature_compat & EXT2_FEATURE_COMPAT_LAZY_BG)
if (fs->super->s_feature_compat & EXT2_FEATURE_COMPAT_LAZY_BG ||
fs->super->s_feature_ro_compat & EXT4_FEATURE_RO_COMPAT_GDT_CSUM)
bg_flags = fs->group_desc[i].bg_flags;
else
bg_flags = 0;
Expand Down Expand Up @@ -210,11 +211,15 @@ static void list_desc (ext2_filsys fs)
diff = fs->group_desc[i].bg_inode_table - first_block;
if (diff > 0)
printf(" (+%ld)", diff);
printf (_("\n %d free blocks, %d free inodes, "
"%d directories\n"),
printf (_("\n %u free blocks, %u free inodes, "
"%u directories%s"),
fs->group_desc[i].bg_free_blocks_count,
fs->group_desc[i].bg_free_inodes_count,
fs->group_desc[i].bg_used_dirs_count);
fs->group_desc[i].bg_used_dirs_count,
fs->group_desc[i].bg_itable_unused ? "" : "\n");
if (fs->group_desc[i].bg_itable_unused)
printf (_(", %u unused inodes\n"),
fs->group_desc[i].bg_itable_unused);
if (block_bitmap) {
fputs(_(" Free blocks: "), stdout);
ext2fs_get_block_bitmap_range(fs->block_map,
Expand Down

0 comments on commit 777a8c1

Please sign in to comment.