Skip to contentSkip to conversation

libgfs2: eliminate gfs1_rindex_read in favor of rindex_read

PATCH New Bob Peterson 1 participant 1 message Aug 11, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 36/44 libgfs2: eliminate gfs1_rindex_read in favor of rindex_read

From 8f63c5404cb4731593c7dd2ecc958af5d5b68d9f Mon Sep 17 00:00:00 2001
From: Bob Peterson <[email protected]>
Date: Wed, 10 Aug 2011 14:07:45 -0500
Subject: [PATCH 36/44] libgfs2: eliminate gfs1_rindex_read in favor of
rindex_read

Now that function rindex_read is able to handle gfs1 file reading, this patch eliminates the gfs1-specific function gfs1_rindex_read.

rhbz#675723

---
 gfs2/edit/hexedit.c |   13 +++-------
 gfs2/libgfs2/gfs1.c |   62 +-------------------------------------------------
 2 files changed, 6 insertions(+), 69 deletions(-)
gfs2/edit/hexedit.c +4 -9
index 366f515..94b7df8 100644
@@ -1756,7 +1756,7 @@ static int block_has_extended_info(void)
 /* ------------------------------------------------------------------------ */
 static void read_superblock(int fd)
 {
-	int count;
+	int count, sane;
 
 	sbd1 = (struct gfs_sb *)&sbd.sd_sb;
 	ioctl(fd, BLKFLSBUF, 0);
@@ -1808,11 +1808,7 @@ static void read_superblock(int fd)
 		sbd.sd_diptrs = (sbd.bsize - sizeof(struct gfs_dinode)) /
 			sizeof(uint64_t);
 		sbd.md.riinode = inode_read(&sbd, sbd1->sb_rindex_di.no_addr);
-		sbd.fssize = sbd.device.length;
-		gfs1_rindex_read(&sbd, 0, &count);
 	} else {
-		int sane;
-
 		sbd.sd_inptrs = (sbd.bsize - sizeof(struct gfs2_meta_header)) /
 			sizeof(uint64_t);
 		sbd.sd_diptrs = (sbd.bsize - sizeof(struct gfs2_dinode)) /
@@ -1820,11 +1816,10 @@ static void read_superblock(int fd)
 		sbd.master_dir = inode_read(&sbd,
 					    sbd.sd_sb.sb_master_dir.no_addr);
 		gfs2_lookupi(sbd.master_dir, "rindex", 6, &sbd.md.riinode);
-		sbd.fssize = sbd.device.length;
-		if (sbd.md.riinode) /* If we found the rindex */
-			rindex_read(&sbd, 0, &count, &sane);
 	}
-
+	sbd.fssize = sbd.device.length;
+	if (sbd.md.riinode) /* If we found the rindex */
+		rindex_read(&sbd, 0, &count, &sane);
 }
 
 /* ------------------------------------------------------------------------ */
gfs2/libgfs2/gfs1.c +2 -60

75 lines not on this page · raw message

Signature · 1 line
1.7.4.4