linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jose R. Santos" <jrs@us.ibm.com>
To: linux-ext4@vger.kernel.org
Subject: [PATCH 08/13][e2fsprogs] Make debugfs uninit block group aware.
Date: Thu, 11 Oct 2007 14:16:48 -0500	[thread overview]
Message-ID: <20071011191648.4599.80610.stgit@gara> (raw)
In-Reply-To: <20071011191559.4599.69332.stgit@gara>

From: Jose R. Santos <jrs@us.ibm.com>

Make debugfs uninit block group aware.

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
--

 debugfs/debugfs.c |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
index 190c4b7..c802b63 100644
--- a/debugfs/debugfs.c
+++ b/debugfs/debugfs.c
@@ -286,7 +286,10 @@ void do_show_super_stats(int argc, char *argv[])
 	FILE 	*out;
 	struct ext2_group_desc *gdp;
 	int	c, header_only = 0;
-	int	numdirs = 0, first;
+	int	numdirs = 0, first, gdt_csum;
+
+	gdt_csum = EXT2_HAS_RO_COMPAT_FEATURE(current_fs->super,
+					      EXT4_FEATURE_RO_COMPAT_GDT_CSUM);
 
 	reset_getopt();
 	while ((c = getopt (argc, argv, "h")) != EOF) {
@@ -322,7 +325,7 @@ void do_show_super_stats(int argc, char *argv[])
 		        "inode table at %u\n"
 		        "           %d free %s, "
 		        "%d free %s, "
-		        "%d used %s\n",
+		        "%d used %s%s",
 		        i, gdp->bg_block_bitmap,
 		        gdp->bg_inode_bitmap, gdp->bg_inode_table,
 		        gdp->bg_free_blocks_count,
@@ -331,12 +334,21 @@ void do_show_super_stats(int argc, char *argv[])
 		        gdp->bg_free_inodes_count != 1 ? "inodes" : "inode",
 		        gdp->bg_used_dirs_count,
 		        gdp->bg_used_dirs_count != 1 ? "directories"
-				: "directory");
+				: "directory", gdt_csum ? ", " : "\n");
+		if (gdt_csum)
+			fprintf(out, "%d unused %s\n",
+				gdp->bg_itable_unused,
+				gdp->bg_itable_unused != 1 ? "inodes":"inode");
 		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 (gdt_csum) {
+			fprintf(out, "%sChecksum 0x%04x",
+				first ? "           [":", ", gdp->bg_checksum);
+			first = 0;
+		}
 		if (!first)
 			fputs("]\n", out);
 	}

  parent reply	other threads:[~2007-10-11 19:16 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-11 19:15 [PATCH 00/13][e2fsprogs] Uninit block group break down Jose R. Santos
2007-10-11 19:16 ` [PATCH 01/13][e2fsprogs] Add initial checksum support Jose R. Santos
2007-10-15  2:46   ` Theodore Tso
2007-10-15  9:43     ` Jose R. Santos
2007-10-15 11:55       ` Theodore Tso
2007-11-13 23:04     ` Karel Zak
2007-10-15 20:53   ` Theodore Tso
2007-10-11 19:16 ` [PATCH 02/13][e2fsprogs] Add uninit block group support on libe2fs Jose R. Santos
2007-10-11 19:16 ` [PATCH 03/13][e2fsprogs] Rename feature name from gdt_checksum to uninit_groups Jose R. Santos
2007-10-11 19:16 ` [PATCH 04/13][e2fsprogs] Add support for creating filesystems using uninit block group Jose R. Santos
2007-10-11 19:16 ` [PATCH 05/13][e2fsprogs] Make tune2fs uninit block group aware Jose R. Santos
2007-10-11 19:16 ` [PATCH 06/13][e2fsprogs] Make dumpe2fs " Jose R. Santos
2007-10-11 19:16 ` [PATCH 07/13][e2fsprogs] Make resize2fs " Jose R. Santos
2007-10-11 19:16 ` Jose R. Santos [this message]
2007-10-11 19:16 ` [PATCH 09/13][e2fsprogs] Make e2fsck " Jose R. Santos
2007-10-11 19:17 ` [PATCH 10/13][e2fsprogs] Update uninit block group documetation for some of the utilities Jose R. Santos
2007-10-11 19:17 ` [PATCH 11/13][e2fsprogs] Fix test cases Jose R. Santos
2007-10-11 19:17 ` [PATCH 12/13][e2fsprogs] Add new mm_lazy test case Jose R. Santos
2007-10-11 19:17 ` [PATCH 13/13][e2fsprogs] Add m_uninit " Jose R. Santos
2007-11-01  9:48   ` Coly Li
2007-11-01  9:58     ` Coly Li
2007-11-01 11:03       ` Jose R. Santos
2007-11-01 11:26         ` Jose R. Santos
2007-11-01 12:11           ` Coly Li
2007-11-01 12:10         ` Coly Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071011191648.4599.80610.stgit@gara \
    --to=jrs@us.ibm.com \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).