diff options
author | Theodore Ts'o <tytso@mit.edu> | 2006-05-08 20:17:26 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2006-05-08 20:17:26 -0400 |
commit | f5fa20078bfc05b554294fe9c5505375d7913e8c (patch) | |
tree | f51fd572f2a76eaab495e7559ba40dee09067dd2 /debugfs | |
parent | 49c6b4e9472f53c252126f1c9a5a6e9629967d1f (diff) | |
download | e2fsprogs-f5fa20078bfc05b554294fe9c5505375d7913e8c.tar.gz |
Add support for EXT2_FEATURE_COMPAT_LAZY_BG
This feature is initially intended for testing purposes; it allows an
ext2/ext3 developer to create very large filesystems using sparse files
where most of the block groups are not initialized and so do not require
much disk space. Eventually it could be used as a way of speeding up
mke2fs and e2fsck for large filesystem, but that would be best done by
adding an RO_COMPAT extension to the filesystem to allow the inode table
to be lazily initialized on a per-block basis, instead of being entirely initialized
or entirely unused on a per-blockgroup basis.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
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: |