public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: Bob Peterson <rpeterso@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: gfs2-utils: master - GFS2: gfs2_edit prints wrong directory entry type for gfs1
Date: Mon, 31 Aug 2009 17:32:00 -0000	[thread overview]
Message-ID: <20090831173224.50AF212025B@lists.fedorahosted.org> (raw)

Gitweb:        http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=3f7281325f8ebafe34fdc3edc96ef1f8d0c18cc1
Commit:        3f7281325f8ebafe34fdc3edc96ef1f8d0c18cc1
Parent:        dff596f6973d56e873e4de38f56d4dbcd578b5ad
Author:        Bob Peterson <bob@ganesha.peterson>
AuthorDate:    Mon Aug 31 12:03:20 2009 -0500
Committer:     Bob Peterson <rpeterso@redhat.com>
CommitterDate: Mon Aug 31 12:32:27 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 3582a7f..2192e8d 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -1180,6 +1180,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");
@@ -1244,10 +1276,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);
 		}


                 reply	other threads:[~2009-08-31 17:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20090831173224.50AF212025B@lists.fedorahosted.org \
    --to=rpeterso@fedoraproject.org \
    --cc=cluster-cvs-relay@redhat.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).