public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: STABLE3 - GFS2: gfs2_edit prints wrong directory entry type for gfs1
@ 2009-08-31 17:34 Bob Peterson
  0 siblings, 0 replies; only message in thread
From: Bob Peterson @ 2009-08-31 17:34 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=81ada023e8280a0199dd5e646fd475c6ed0f56e0
Commit:        81ada023e8280a0199dd5e646fd475c6ed0f56e0
Parent:        e3d5be1efbc63c7c5809633be8411ae302974dab
Author:        Bob Peterson <bob@ganesha.peterson>
AuthorDate:    Mon Aug 31 12:03:20 2009 -0500
Committer:     Bob Peterson <bob@ganesha.peterson>
CommitterDate: Mon Aug 31 12:03:20 2009 -0500

GFS2: gfs2_edit prints wrong directory entry type for gfs1

This patch adds the ability for gfs2_edit to correctly interpret
gfs1 directory entry types.

rhbz#503529
---
 gfs2/edit/hexedit.c |   36 +++++++++++++++++++++++++++++++++---
 1 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 5a01b1f..03ca673 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -1178,6 +1178,38 @@ static int has_indirect_blocks(void)
 /* ------------------------------------------------------------------------ */
 static void print_inode_type(__be16 de_type)
 {
+	if (gfs1) {
+		switch(de_type) {
+		case GFS_FILE_NON:
+			print_gfs2("Unknown");
+			break;
+		case GFS_FILE_REG:
+			print_gfs2("File   ");
+			break;
+		case GFS_FILE_DIR:
+			print_gfs2("Dir    ");
+			break;
+		case GFS_FILE_LNK:
+			print_gfs2("Symlink");
+			break;
+		case GFS_FILE_BLK:
+			print_gfs2("BlkDev ");
+			break;
+		case GFS_FILE_CHR:
+			print_gfs2("ChrDev ");
+			break;
+		case GFS_FILE_FIFO:
+			print_gfs2("Fifo   ");
+			break;
+		case GFS_FILE_SOCK:
+			print_gfs2("Socket ");
+			break;
+		default:
+			print_gfs2("%04x   ", de_type);
+			break;
+		}
+		return;
+	}
 	switch(de_type) {
 	case DT_UNKNOWN:
 		print_gfs2("Unknown");
@@ -1242,10 +1274,8 @@ static int display_leaf(struct iinfo *ind)
 					strcpy(edit_fmt, "%"PRIx64);
 				}
 			}
-			print_gfs2("%d. (%d). %lld (0x%llx) / %lld (0x%llx): ",
+			print_gfs2("%d. (%d). %lld (0x%llx): ",
 				   total_dirents, d + 1,
-				   ind->ii[0].dirent[d].dirent.de_inum.no_formal_ino,
-				   ind->ii[0].dirent[d].dirent.de_inum.no_formal_ino,
 				   ind->ii[0].dirent[d].block,
 				   ind->ii[0].dirent[d].block);
 		}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-08-31 17:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-31 17:34 cluster: STABLE3 - GFS2: gfs2_edit prints wrong directory entry type for gfs1 Bob Peterson

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 read-only IMAP folder(s) and NNTP newsgroup(s).