Gitweb:
http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=6479aa78...
Commit: 6479aa78befbca3998b6f3d1decddf67285d353e
Parent: 10d4d4963917055d0085652403503b793571c533
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Wed Feb 3 15:00:03 2016 +0000
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Wed Feb 3 15:00:03 2016 +0000
gfs2_edit: Don't use global block variable in block_is_quota_file
Accept it as an argument instead.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/edit/extended.c | 2 +-
gfs2/edit/hexedit.c | 11 ++++-------
gfs2/edit/hexedit.h | 2 +-
gfs2/edit/savemeta.c | 2 +-
4 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/gfs2/edit/extended.c b/gfs2/edit/extended.c
index 3d24845..db2c546 100644
--- a/gfs2/edit/extended.c
+++ b/gfs2/edit/extended.c
@@ -711,7 +711,7 @@ int display_extended(void)
inode_put(&tmp_inode);
brelse(tmp_bh);
}
- else if (block_is_quota_file()) {
+ else if (block_is_quota_file(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 5a212dd..3ce0987 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -913,14 +913,11 @@ int block_is_statfs_file(uint64_t blk)
return FALSE;
}
-/* ------------------------------------------------------------------------ */
-/* block_is_quota_file */
-/* ------------------------------------------------------------------------ */
-int block_is_quota_file(void)
+int block_is_quota_file(uint64_t blk)
{
- if (sbd.gfs1 && block == gfs1_quota_di.no_addr)
+ if (sbd.gfs1 && blk == gfs1_quota_di.no_addr)
return TRUE;
- if (!sbd.gfs1 && block == masterblock("quota"))
+ if (!sbd.gfs1 && blk == masterblock("quota"))
return TRUE;
return FALSE;
}
@@ -947,7 +944,7 @@ static int block_has_extended_info(void)
block_is_jindex(block) ||
block_is_inum_file(block) ||
block_is_statfs_file(block) ||
- block_is_quota_file())
+ block_is_quota_file(block))
return TRUE;
return FALSE;
}
diff --git a/gfs2/edit/hexedit.h b/gfs2/edit/hexedit.h
index f959d31..b488262 100644
--- a/gfs2/edit/hexedit.h
+++ b/gfs2/edit/hexedit.h
@@ -222,7 +222,7 @@ extern int block_is_jindex(uint64_t blk);
extern int block_is_rindex(void);
extern int block_is_inum_file(uint64_t blk);
extern int block_is_statfs_file(uint64_t blk);
-extern int block_is_quota_file(void);
+extern int block_is_quota_file(uint64_t blk);
extern int block_is_per_node(void);
extern int display_block_type(int from_restore);
extern void gfs_jindex_in(struct gfs_jindex *jindex, char *buf);
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index c659cbc..079677e 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -167,7 +167,7 @@ static int init_per_node_lookup(void)
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_is_statfs_file(block) || block_is_quota_file(block) ||
block_is_rindex() || block_is_a_journal(block) ||
block_is_per_node() || block_is_in_per_node(block);
}