Gitweb:
http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=f7d2b1c5...
Commit: f7d2b1c56b4bd1299714ca2034f7d394019da477
Parent: 6479aa78befbca3998b6f3d1decddf67285d353e
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Wed Feb 3 15:02:29 2016 +0000
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Wed Feb 3 15:02:29 2016 +0000
gfs2_edit: Don't use global block variable in block_is_rindex
Accept it as an argument instead.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/edit/extended.c | 2 +-
gfs2/edit/hexedit.c | 13 +++++--------
gfs2/edit/hexedit.h | 2 +-
gfs2/edit/savemeta.c | 2 +-
4 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/gfs2/edit/extended.c b/gfs2/edit/extended.c
index db2c546..a8a71e7 100644
--- a/gfs2/edit/extended.c
+++ b/gfs2/edit/extended.c
@@ -654,7 +654,7 @@ int display_extended(void)
dsplines = termlines - line - 1;
/* Display any indirect pointers that we have. */
- if (block_is_rindex()) {
+ if (block_is_rindex(block)) {
tmp_bh = bread(&sbd, block);
tmp_inode = lgfs2_inode_get(&sbd, tmp_bh);
if (tmp_inode == NULL)
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 3ce0987..7c85ca8 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -879,13 +879,10 @@ int has_indirect_blocks(void)
return FALSE;
}
-/* ------------------------------------------------------------------------ */
-/* block_is_rindex */
-/* ------------------------------------------------------------------------ */
-int block_is_rindex(void)
+int block_is_rindex(uint64_t blk)
{
- if ((sbd.gfs1 && block == sbd1->sb_rindex_di.no_addr) ||
- (block == masterblock("rindex")))
+ if ((sbd.gfs1 && blk == sbd1->sb_rindex_di.no_addr) ||
+ (blk == masterblock("rindex")))
return TRUE;
return FALSE;
}
@@ -938,7 +935,7 @@ int block_is_per_node(void)
static int block_has_extended_info(void)
{
if (has_indirect_blocks() ||
- block_is_rindex() ||
+ block_is_rindex(block) ||
block_is_rgtree() ||
block_is_journals() ||
block_is_jindex(block) ||
@@ -1187,7 +1184,7 @@ static void push_block(uint64_t blk)
blockstack[bhst].lines_per_row[i] = lines_per_row[i];
}
blockstack[bhst].gfs2_struct_type = gfs2_struct_type;
- if (edit_row[dmode] >= 0 && !block_is_rindex())
+ if (edit_row[dmode] >= 0 && !block_is_rindex(block))
memcpy(&blockstack[bhst].mp,
&indirect->ii[edit_row[dmode]].mp,
sizeof(struct metapath));
diff --git a/gfs2/edit/hexedit.h b/gfs2/edit/hexedit.h
index b488262..9607523 100644
--- a/gfs2/edit/hexedit.h
+++ b/gfs2/edit/hexedit.h
@@ -219,7 +219,7 @@ void die(const char *fmt, ...)
} while (0)
extern int block_is_jindex(uint64_t blk);
-extern int block_is_rindex(void);
+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);
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 079677e..4483e4e 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -168,7 +168,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_is_a_journal(block) ||
+ block_is_rindex(block) || block_is_a_journal(block) ||
block_is_per_node() || block_is_in_per_node(block);
}