]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
debugfs.c (do_show_super_stats): Calculate and print the number
authorTheodore Ts'o <tytso@mit.edu>
Mon, 15 Jul 2002 20:56:41 +0000 (16:56 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 15 Jul 2002 20:56:41 +0000 (16:56 -0400)
of directories on a filesystem --- because we can and
because it can be useful.

debugfs/ChangeLog
debugfs/debugfs.c

index 24977f0873cc3ec7d807e47d8eecfd37197bdb81..aacb43da6b96f37b5cc57617ba255d3049c6b671 100644 (file)
@@ -1,3 +1,9 @@
+2002-07-15  Theodore Ts'o  <tytso@mit.edu>
+
+       * 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  <tytso@mit.edu>
 
        * debugfs.c (do_rmdir), debugfs.8.in: Implement the rmdir command.
index eaba9b86d372168511eb796c13991b372c9ac490..e2f59c510ef02a8d3b705f74c316b5f7bc989d01 100644 (file)
@@ -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;