[Cluster-devel] [fsck.gfs2 PATCH 15/30] fsck.gfs2: Move blockmap stuff to pass1.c

Bob Peterson rpeterso at redhat.com
Fri Apr 15 13:38:09 UTC 2016


Now that we've eliminated all blockmap dependencies from the
other passes, we can move the blockmap-related functions from
metawalk to pass1.c. This will ensure there won't be new calls
added.

Signed-off-by: Bob Peterson <rpeterso at redhat.com>
---
 gfs2/fsck/metawalk.c | 16 ----------------
 gfs2/fsck/metawalk.h |  8 --------
 gfs2/fsck/pass1.c    | 21 +++++++++++++++++++++
 3 files changed, 21 insertions(+), 24 deletions(-)

diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index ac345f2..3217711 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -177,22 +177,6 @@ int _fsck_bitmap_set(struct gfs2_inode *ip, uint64_t bblock,
 	return error;
 }
 
-/*
- * _fsck_blockmap_set - Mark a block in the 4-bit blockmap and the 2-bit
- *                      bitmap, and adjust free space accordingly.
- */
-int _fsck_blockmap_set(struct gfs2_inode *ip, uint64_t bblock,
-		       const char *btype, int mark,
-		       int error_on_dinode, const char *caller, int fline)
-{
-	int error = _fsck_bitmap_set(ip, bblock, btype, mark, error_on_dinode,
-				     caller, fline);
-	if (error)
-		return error;
-
-	return gfs2_blockmap_set(bl, bblock, mark);
-}
-
 struct duptree *dupfind(uint64_t block)
 {
 	struct osi_node *node = dup_blocks.osi_node;
diff --git a/gfs2/fsck/metawalk.h b/gfs2/fsck/metawalk.h
index e47a871..813736a 100644
--- a/gfs2/fsck/metawalk.h
+++ b/gfs2/fsck/metawalk.h
@@ -19,9 +19,6 @@ extern int check_linear_dir(struct gfs2_inode *ip, struct gfs2_buffer_head *bh,
 extern int check_leaf(struct gfs2_inode *ip, int lindex,
 		      struct metawalk_fxns *pass, uint64_t *leaf_no,
 		      struct gfs2_leaf *leaf, int *ref_count);
-extern int _fsck_blockmap_set(struct gfs2_inode *ip, uint64_t bblock,
-			      const char *btype, int mark, int error_on_dinode,
-			      const char *caller, int line);
 extern int _fsck_bitmap_set(struct gfs2_inode *ip, uint64_t bblock,
 			    const char *btype, int mark, int error_on_dinode,
 			    const char *caller, int line);
@@ -37,11 +34,6 @@ extern struct gfs2_inode *fsck_system_inode(struct gfs2_sbd *sdp,
 	_fsck_bitmap_set(ip, b, bt, m, 0, __FUNCTION__, __LINE__)
 #define fsck_bitmap_set_noino(ip, b, bt, m) \
 	_fsck_bitmap_set(ip, b, bt, m, 1, __FUNCTION__, __LINE__)
-#define fsck_blockmap_set(ip, b, bt, m) \
-	_fsck_blockmap_set(ip, b, bt, m, 0, __FUNCTION__, __LINE__)
-#define fsck_blkmap_set_noino(ip, b, bt, m) \
-	_fsck_blockmap_set(ip, b, bt, m, 1, __FUNCTION__, __LINE__)
-
 enum meta_check_rc {
 	meta_error = -1,
 	meta_is_good = 0,
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index aae5a06..ca6f25f 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -88,6 +88,27 @@ static int handle_ip(struct gfs2_sbd *sdp, struct gfs2_inode *ip);
 static int delete_block(struct gfs2_inode *ip, uint64_t block,
 			struct gfs2_buffer_head **bh, const char *btype,
 			void *private);
+/*
+ * _fsck_blockmap_set - Mark a block in the 4-bit blockmap and the 2-bit
+ *                      bitmap, and adjust free space accordingly.
+ */
+static int _fsck_blockmap_set(struct gfs2_inode *ip, uint64_t bblock,
+			      const char *btype, int mark, int error_on_dinode,
+			      const char *caller, int fline)
+{
+	int error = _fsck_bitmap_set(ip, bblock, btype, mark, error_on_dinode,
+				     caller, fline);
+	if (error)
+		return error;
+
+	return gfs2_blockmap_set(bl, bblock, mark);
+}
+
+#define fsck_blockmap_set(ip, b, bt, m) \
+	_fsck_blockmap_set(ip, b, bt, m, 0, __FUNCTION__, __LINE__)
+#define fsck_blkmap_set_noino(ip, b, bt, m) \
+	_fsck_blockmap_set(ip, b, bt, m, 1, __FUNCTION__, __LINE__)
+
 /**
  * delete_block - delete a block associated with an inode
  */
-- 
2.5.5




More information about the Cluster-devel mailing list