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

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=275adfb353d1cc975772dcd4d6687de16a1ab223
Commit:        275adfb353d1cc975772dcd4d6687de16a1ab223
Parent:        2f07da23c9e8d93647ba4525614f2ff4e8d32e6a
Author:        Bob Peterson <bob@ganesha.peterson>
AuthorDate:    Mon Aug 31 12:02:57 2009 -0500
Committer:     Bob Peterson <rpeterso@redhat.com>
CommitterDate: Mon Aug 31 12:55:09 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 0e76c83..8f34d67 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -1174,6 +1174,38 @@ int has_indirect_blocks(void)
 /* ------------------------------------------------------------------------ */
 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");
@@ -1238,10 +1270,8 @@ 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:53 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:53 cluster: STABLE2 - 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).