Gitweb:
http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=10d4d496...
Commit: 10d4d4963917055d0085652403503b793571c533
Parent: 3c43071340165032de2aeab6ba1be2688b7dd368
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Wed Feb 3 14:57:57 2016 +0000
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Wed Feb 3 14:57:57 2016 +0000
gfs2_edit: Don't use global block variable in block_is_statfs_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 8c7244b..3d24845 100644
--- a/gfs2/edit/extended.c
+++ b/gfs2/edit/extended.c
@@ -702,7 +702,7 @@ int display_extended(void)
inode_put(&tmp_inode);
brelse(tmp_bh);
}
- else if (block_is_statfs_file()) {
+ else if (block_is_statfs_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 6125d04..5a212dd 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -904,14 +904,11 @@ int block_is_inum_file(uint64_t blk)
return FALSE;
}
-/* ------------------------------------------------------------------------ */
-/* block_is_statfs_file */
-/* ------------------------------------------------------------------------ */
-int block_is_statfs_file(void)
+int block_is_statfs_file(uint64_t blk)
{
- if (sbd.gfs1 && block == gfs1_license_di.no_addr)
+ if (sbd.gfs1 && blk == gfs1_license_di.no_addr)
return TRUE;
- if (!sbd.gfs1 && block == masterblock("statfs"))
+ if (!sbd.gfs1 && blk == masterblock("statfs"))
return TRUE;
return FALSE;
}
@@ -949,7 +946,7 @@ static int block_has_extended_info(void)
block_is_journals() ||
block_is_jindex(block) ||
block_is_inum_file(block) ||
- block_is_statfs_file() ||
+ block_is_statfs_file(block) ||
block_is_quota_file())
return TRUE;
return FALSE;
diff --git a/gfs2/edit/hexedit.h b/gfs2/edit/hexedit.h
index f229ed4..f959d31 100644
--- a/gfs2/edit/hexedit.h
+++ b/gfs2/edit/hexedit.h
@@ -221,7 +221,7 @@ void die(const char *fmt, ...)
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(void);
+extern int block_is_statfs_file(uint64_t blk);
extern int block_is_quota_file(void);
extern int block_is_per_node(void);
extern int display_block_type(int from_restore);
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index ab4fe0e..c659cbc 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_is_quota_file() ||
+ block_is_statfs_file(block) || block_is_quota_file() ||
block_is_rindex() || block_is_a_journal(block) ||
block_is_per_node() || block_is_in_per_node(block);
}