[Cluster-devel] [PATCH 08/23] gfs2_edit: Don't use the global block variable in block_is_per_node

Andrew Price anprice at redhat.com
Thu Feb 4 11:20:19 UTC 2016


Accept it as an argument instead.

Signed-off-by: Andrew Price <anprice at redhat.com>
---
 gfs2/edit/hexedit.c  | 7 ++-----
 gfs2/edit/hexedit.h  | 2 +-
 gfs2/edit/savemeta.c | 2 +-
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 7c85ca8..981c02c 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -919,12 +919,9 @@ int block_is_quota_file(uint64_t blk)
 	return FALSE;
 }
 
-/* ------------------------------------------------------------------------ */
-/* block_is_per_node                                                        */
-/* ------------------------------------------------------------------------ */
-int block_is_per_node(void)
+int block_is_per_node(uint64_t blk)
 {
-	if (!sbd.gfs1 && block == masterblock("per_node"))
+	if (!sbd.gfs1 && blk == masterblock("per_node"))
 		return TRUE;
 	return FALSE;
 }
diff --git a/gfs2/edit/hexedit.h b/gfs2/edit/hexedit.h
index 9607523..f1f7667 100644
--- a/gfs2/edit/hexedit.h
+++ b/gfs2/edit/hexedit.h
@@ -223,7 +223,7 @@ extern int block_is_rindex(uint64_t blk);
 extern int block_is_inum_file(uint64_t blk);
 extern int block_is_statfs_file(uint64_t blk);
 extern int block_is_quota_file(uint64_t blk);
-extern int block_is_per_node(void);
+extern int block_is_per_node(uint64_t blk);
 extern int display_block_type(int from_restore);
 extern void gfs_jindex_in(struct gfs_jindex *jindex, char *buf);
 extern void gfs_log_header_in(struct gfs_log_header *head,
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 4483e4e..1899d9a 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -169,7 +169,7 @@ static int block_is_systemfile(void)
 	return block_is_jindex(block) || block_is_inum_file(block) ||
 		block_is_statfs_file(block) || block_is_quota_file(block) ||
 		block_is_rindex(block) || block_is_a_journal(block) ||
-		block_is_per_node() || block_is_in_per_node(block);
+		block_is_per_node(block) || block_is_in_per_node(block);
 }
 
 /**
-- 
2.4.3




More information about the Cluster-devel mailing list