From: Theodore Ts'o Date: Mon, 15 Jul 2002 20:56:41 +0000 (-0400) Subject: debugfs.c (do_show_super_stats): Calculate and print the number X-Git-Tag: E2FSPROGS-1.28-WIP-0817~33 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=34be9609de977fe2e041c7b48fb9d4d0d6878bb1;p=tools%2Fe2fsprogs.git debugfs.c (do_show_super_stats): Calculate and print the number of directories on a filesystem --- because we can and because it can be useful. --- diff --git a/debugfs/ChangeLog b/debugfs/ChangeLog index 24977f0..aacb43d 100644 --- a/debugfs/ChangeLog +++ b/debugfs/ChangeLog @@ -1,3 +1,9 @@ +2002-07-15 Theodore Ts'o + + * debugfs.c (do_show_super_stats): Calculate and print the number + of directories on a filesystem --- because we can and + because it can be useful. + 2002-07-09 Theodore Ts'o * debugfs.c (do_rmdir), debugfs.8.in: Implement the rmdir command. diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c index eaba9b8..e2f59c5 100644 --- a/debugfs/debugfs.c +++ b/debugfs/debugfs.c @@ -239,6 +239,7 @@ void do_show_super_stats(int argc, char *argv[]) FILE *out; struct ext2_group_desc *gdp; int c, header_only = 0; + int numdirs = 0; const char *usage = "Usage: show_super [-h]"; optind = 0; @@ -264,7 +265,10 @@ void do_show_super_stats(int argc, char *argv[]) out = open_pager(); list_super2(current_fs->super, out); - + for (i=0; i < current_fs->group_desc_count; i++) + numdirs += current_fs->group_desc[i].bg_used_dirs_count; + fprintf(out, "Directories: %d\n", numdirs); + if (header_only) { close_pager(out); return;