diff options
Diffstat (limited to 'debugfs')
-rw-r--r-- | debugfs/ChangeLog | 5 | ||||
-rw-r--r-- | debugfs/debugfs.c | 25 |
2 files changed, 28 insertions, 2 deletions
diff --git a/debugfs/ChangeLog b/debugfs/ChangeLog index a9fb8a4d..0425d227 100644 --- a/debugfs/ChangeLog +++ b/debugfs/ChangeLog @@ -1,3 +1,8 @@ +2006-05-08 Theodore Tso <tytso@mit.edu> + + * debugfs.c (do_show_super_stats): Print out the block group flags + if they are set. + 2006-04-27 Theodore Ts'o <tytso@mit.edu> * htree.c (do_htree_dump, do_dx_hash), ls.c (do_list_dir): Add diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c index 12ef00c2..25d52d75 100644 --- a/debugfs/debugfs.c +++ b/debugfs/debugfs.c @@ -266,13 +266,26 @@ static void print_features(struct ext2_super_block * s, FILE *f) fputs("\n", f); } +static void print_bg_opts(struct ext2_group_desc *gdp, int mask, + const char *str, int *first, FILE *f) +{ + if (gdp->bg_flags & mask) { + if (*first) { + fputs(" [", f); + *first = 0; + } else + fputs(", ", f); + fputs(str, f); + } +} + void do_show_super_stats(int argc, char *argv[]) { dgrp_t i; FILE *out; struct ext2_group_desc *gdp; int c, header_only = 0; - int numdirs = 0; + int numdirs = 0, first; reset_getopt(); while ((c = getopt (argc, argv, "h")) != EOF) { @@ -302,7 +315,7 @@ void do_show_super_stats(int argc, char *argv[]) } gdp = ¤t_fs->group_desc[0]; - for (i = 0; i < current_fs->group_desc_count; i++, gdp++) + for (i = 0; i < current_fs->group_desc_count; i++, gdp++) { fprintf(out, " Group %2d: block bitmap at %u, " "inode bitmap at %u, " "inode table at %u\n" @@ -318,6 +331,14 @@ void do_show_super_stats(int argc, char *argv[]) gdp->bg_used_dirs_count, gdp->bg_used_dirs_count != 1 ? "directories" : "directory"); + first = 1; + print_bg_opts(gdp, EXT2_BG_INODE_UNINIT, "Inode not init", + &first, out); + print_bg_opts(gdp, EXT2_BG_BLOCK_UNINIT, "Block not init", + &first, out); + if (!first) + fputs("]\n", out); + } close_pager(out); return; print_usage: |