This is the mail archive of the
cluster-cvs@sourceware.org
mailing list for the cluster.
gfs2-utils: master - GFS2: gfs2_edit prints wrong directory entrytype for gfs1
- From: Bob Peterson <rpeterso at fedoraproject dot org>
- To: cluster-cvs-relay at redhat dot com
- Date: Mon, 31 Aug 2009 17:32:24 +0000 (UTC)
- Subject: gfs2-utils: master - GFS2: gfs2_edit prints wrong directory entrytype for gfs1
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);
}