From: Andrew Price Date: Thu, 4 Feb 2016 11:20:18 +0000 Subject: [Cluster-devel] [PATCH 07/23] gfs2_edit: Don't use global block variable in block_is_rindex In-Reply-To: <1454584834-32412-1-git-send-email-anprice@redhat.com> References: <1454584834-32412-1-git-send-email-anprice@redhat.com> Message-ID: <1454584834-32412-8-git-send-email-anprice@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Accept it as an argument instead. Signed-off-by: Andrew Price --- 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); } -- 2.4.3