[Ocfs2-tools-devel] [Trivial PATCH] Use fs instead of ost->ost_fs

Goldwyn Rodrigues rgoldwyn at gmail.com
Sat Oct 24 18:51:37 PDT 2009


pass0 uses ost->ost_fs when a fs variable pointing to ost->ost_fs exits.
Use fs directly to avoid pointer hop.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn at gmail.com>

---
diff --git a/fsck.ocfs2/pass0.c b/fsck.ocfs2/pass0.c
index a32bd18..ac03de2 100644
--- a/fsck.ocfs2/pass0.c
+++ b/fsck.ocfs2/pass0.c
@@ -1122,7 +1122,7 @@ errcode_t o2fsck_pass0(o2fsck_state *ost)
 		goto out;
 	}
 
-	ret = ocfs2_read_inode(ost->ost_fs, blkno, (char *)di);
+	ret = ocfs2_read_inode(fs, blkno, (char *)di);
 	if (ret) {
 		com_err(whoami, ret, "reading inode alloc inode "
 			"%"PRIu64" for verification", blkno);
@@ -1162,8 +1162,8 @@ errcode_t o2fsck_pass0(o2fsck_state *ost)
 
 retry_bitmap:
 	pre_repair_clusters = di->i_clusters;
-	ret = verify_bitmap_descs(ost, di, blocks + ost->ost_fs->fs_blocksize,
-				  blocks + (ost->ost_fs->fs_blocksize * 2));
+	ret = verify_bitmap_descs(ost, di, blocks + fs->fs_blocksize,
+				  blocks + (fs->fs_blocksize * 2));
 
 	if (ret)
 		goto out;
@@ -1220,7 +1220,7 @@ retry_bitmap:
 			goto out;
 		}
 
-		ret = ocfs2_read_inode(ost->ost_fs, blkno, (char *)di);
+		ret = ocfs2_read_inode(fs, blkno, (char *)di);
 		if (ret) {
 			com_err(whoami, ret, "reading inode alloc inode "
 				"%"PRIu64" for verification", blkno);
@@ -1231,9 +1231,9 @@ retry_bitmap:
 			 (uint64_t)di->i_blkno, blkno);
 
 		ret = verify_chain_alloc(ost, di,
-					 blocks + ost->ost_fs->fs_blocksize,
+					 blocks + fs->fs_blocksize,
 					 blocks + 
-					 (ost->ost_fs->fs_blocksize * 2), 
+					 (fs->fs_blocksize * 2), 
 					 pre_cache_buf, NULL, NULL);
 
 		/* XXX maybe helped by the alternate super block */
@@ -1245,18 +1245,18 @@ retry_bitmap:
 		else
 			ci = &ost->ost_inode_allocs[i];
 
-		ret = ocfs2_read_cached_inode(ost->ost_fs, blkno, ci);
+		ret = ocfs2_read_cached_inode(fs, blkno, ci);
 		if (ret) {
 			com_err(whoami, ret, "while reading node %d's inode "
 				"allocator inode %"PRIu64, i, blkno);	
 			goto out;
 		}
 
-		ret = ocfs2_load_chain_allocator(ost->ost_fs, *ci);
+		ret = ocfs2_load_chain_allocator(fs, *ci);
 		if (ret) {
 			com_err(whoami, ret, "while loading inode %"PRIu64" "
 				"as a chain allocator", blkno);
-			ocfs2_free_cached_inode(ost->ost_fs, *ci);
+			ocfs2_free_cached_inode(fs, *ci);
 			*ci = NULL;
 			goto out;
 		}
@@ -1273,7 +1273,7 @@ retry_bitmap:
 			goto out;
 		}
 
-		ret = ocfs2_read_inode(ost->ost_fs, blkno, (char *)di);
+		ret = ocfs2_read_inode(fs, blkno, (char *)di);
 		if (ret) {
 			com_err(whoami, ret, "reading inode alloc inode "
 				"%"PRIu64" for verification", blkno);
@@ -1284,9 +1284,9 @@ retry_bitmap:
 			 (uint64_t)di->i_blkno, blkno);
 
 		ret = verify_chain_alloc(ost, di,
-					 blocks + ost->ost_fs->fs_blocksize,
+					 blocks + fs->fs_blocksize,
 					 blocks + 
-					 (ost->ost_fs->fs_blocksize * 2), 
+					 (fs->fs_blocksize * 2), 
 					 pre_cache_buf, NULL, NULL);
 
 		/* XXX maybe helped by the alternate super block */




More information about the Ocfs2-tools-devel mailing list