[Ocfs2-tools-devel] [PATCH 32/32] debugfs.ocfs2: Journal logdump prints full inode and extent blocks

Sunil Mushran sunil.mushran at oracle.com
Tue Sep 14 15:55:02 PDT 2010


The journal logdump was not printing the extent list, truncate log, etc. in the inode.
This patch makes it print more information.

Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>
---
 debugfs.ocfs2/dump.c |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/debugfs.ocfs2/dump.c b/debugfs.ocfs2/dump.c
index b392c10..59c745e 100644
--- a/debugfs.ocfs2/dump.c
+++ b/debugfs.ocfs2/dump.c
@@ -875,27 +875,41 @@ void dump_jbd_metadata (FILE *out, enum dump_block_type type, char *buf,
 	struct ocfs2_refcount_block *rb;
 	struct ocfs2_dx_root_block *dx_root;
 	struct ocfs2_dx_leaf *dx_leaf;
+	struct ocfs2_dinode *di;
+	struct ocfs2_extent_block *eb;
 
 	fprintf (out, "\tBlock %"PRIu64": ", blknum);
 	switch (type) {
 	case DUMP_BLOCK_INODE:
 		fprintf(out, "Inode\n");
-		ocfs2_swap_inode_to_cpu(gbls.fs, (struct ocfs2_dinode *)buf);
-		dump_inode (out, (struct ocfs2_dinode *)buf);
+		di = (struct ocfs2_dinode *)buf;
+		ocfs2_swap_inode_to_cpu(gbls.fs, di);
+		dump_inode(out, di);
+		if (di->i_flags & OCFS2_LOCAL_ALLOC_FL)
+			dump_local_alloc(out, &(di->id2.i_lab));
+		else if (di->i_flags & OCFS2_CHAIN_FL)
+			dump_chain_list(out, &(di->id2.i_chain));
+		else if (S_ISLNK(di->i_mode) && !di->i_clusters)
+			dump_fast_symlink(out, (char *)di->id2.i_symlink);
+		else if (di->i_flags & OCFS2_DEALLOC_FL)
+			dump_truncate_log(out, &(di->id2.i_dealloc));
+		else if (!(di->i_dyn_features & OCFS2_INLINE_DATA_FL))
+			dump_extent_list (out, &(di->id2.i_list));
 		fprintf (out, "\n");
 		break;
 	case DUMP_BLOCK_EXTENT_BLOCK:
 		fprintf(out, "Extent\n");
-		ocfs2_swap_extent_block_to_cpu(gbls.fs,
-					       (struct ocfs2_extent_block *)buf);
-		dump_extent_block (out, (struct ocfs2_extent_block *)buf);
+		eb = (struct ocfs2_extent_block *)buf;
+		ocfs2_swap_extent_block_to_cpu(gbls.fs, eb);
+		dump_extent_block(out, eb);
+		dump_extent_list(out, &(eb->h_list));
 		fprintf (out, "\n");
 		break;
 	case DUMP_BLOCK_GROUP_DESCRIPTOR:
 		fprintf(out, "Group\n");
 		ocfs2_swap_group_desc_to_cpu(gbls.fs,
 				      (struct ocfs2_group_desc *)buf);
-		dump_group_descriptor (out, (struct ocfs2_group_desc *)buf, 0);
+		dump_group_descriptor(out, (struct ocfs2_group_desc *)buf, 0);
 		fprintf (out, "\n");
 		break;
 	case DUMP_BLOCK_DIR_BLOCK:
-- 
1.7.0.4




More information about the Ocfs2-tools-devel mailing list