Gitweb:
http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=5686cfa1...
Commit: 5686cfa1e20cb168678450da091e0ef912c611dc
Parent: 785a372e99344cf15cbd9e6d696b7c767624c951
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Wed Feb 3 15:21:31 2016 +0000
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Wed Feb 3 15:21:31 2016 +0000
gfs2_edit: Only declare the block variable where needed
This will help in removing it.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/edit/extended.c | 2 ++
gfs2/edit/hexedit.c | 1 +
gfs2/edit/hexedit.h | 1 -
gfs2/edit/journal.c | 2 ++
gfs2/edit/savemeta.c | 2 ++
5 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/gfs2/edit/extended.c b/gfs2/edit/extended.c
index 7a517bf..e804853 100644
--- a/gfs2/edit/extended.c
+++ b/gfs2/edit/extended.c
@@ -27,6 +27,8 @@
#include "extended.h"
#include "gfs2hex.h"
+extern uint64_t block;
+
static void print_block_details(struct iinfo *ind, int level, int cur_height,
int pndx, uint64_t file_offset);
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 12deb13..f732b96 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -45,6 +45,7 @@ int details = 0;
long int gziplevel = 9;
static int termcols;
char *device = NULL;
+extern uint64_t block;
/* ------------------------------------------------------------------------- */
/* erase - clear the screen */
diff --git a/gfs2/edit/hexedit.h b/gfs2/edit/hexedit.h
index ab4b41b..1dd9965 100644
--- a/gfs2/edit/hexedit.h
+++ b/gfs2/edit/hexedit.h
@@ -29,7 +29,6 @@ enum dsp_mode { HEX_MODE = 0, GFS2_MODE = 1, EXTENDED_MODE = 2,
INIT_MODE = 3 };
extern const char *mtypes[];
extern struct gfs2_sb sb;
-extern uint64_t block;
extern int blockhist;
extern int edit_mode;
extern int line;
diff --git a/gfs2/edit/journal.c b/gfs2/edit/journal.c
index 80c8738..ff0c6df 100644
--- a/gfs2/edit/journal.c
+++ b/gfs2/edit/journal.c
@@ -28,6 +28,8 @@
#include "gfs2hex.h"
#include "journal.h"
+extern uint64_t block;
+
/**
* find_journal_block - figure out where a journal starts, given the name
* Returns: journal block number, changes j_size to the journal size
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 157a83b..2d001e9 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -27,6 +27,8 @@
#include "hexedit.h"
#include "libgfs2.h"
+extern uint64_t block;
+
#define DFT_SAVE_FILE "/tmp/gfsmeta.XXXXXX"
#define MAX_JOURNALS_SAVED 256