This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch andyp-fsck_cx in repository gfs2-utils.
commit 6983fa9865abc748b6259480ab8d6f686e482559 Author: Andrew Price anprice@redhat.com AuthorDate: Mon Aug 1 11:52:22 2022 +0100
fsck.gfs2: Remove the global opts variable
Signed-off-by: Andrew Price anprice@redhat.com --- gfs2/fsck/fs_recovery.c | 6 +++--- gfs2/fsck/fs_recovery.h | 2 +- gfs2/fsck/fsck.h | 1 - gfs2/fsck/main.c | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c index d778167e..03a2b7ca 100644 --- a/gfs2/fsck/fs_recovery.c +++ b/gfs2/fsck/fs_recovery.c @@ -450,11 +450,11 @@ static int check_journal_seq_no(struct lgfs2_inode *ip, int fix) * mounted by other nodes in the cluster, which is dangerous and therefore, * we should warn the user to run fsck.gfs2 manually when it's safe. */ -int preen_is_safe(struct lgfs2_sbd *sdp, const struct fsck_options * const _opts) +int preen_is_safe(struct lgfs2_sbd *sdp, const struct fsck_options * const opts) { - if (!_opts->preen) + if (!opts->preen) return 1; /* not called by rc.sysinit--we're okay to preen */ - if (_opts->force) + if (opts->force) return 1; /* user's responsibility--we're okay to preen */ if (!memcmp(sdp->sd_lockproto + 5, "nolock", 6)) return 1; /* local file system--preen is okay */ diff --git a/gfs2/fsck/fs_recovery.h b/gfs2/fsck/fs_recovery.h index eda8fce9..9cc6be62 100644 --- a/gfs2/fsck/fs_recovery.h +++ b/gfs2/fsck/fs_recovery.h @@ -4,7 +4,7 @@ #include "libgfs2.h"
extern int replay_journals(struct fsck_cx *cx, int *clean_journals); -extern int preen_is_safe(struct lgfs2_sbd *sdp, const struct fsck_options * const _opts); +extern int preen_is_safe(struct lgfs2_sbd *sdp, const struct fsck_options * const opts);
extern int ji_update(struct lgfs2_sbd *sdp); extern int build_jindex(struct lgfs2_sbd *sdp); diff --git a/gfs2/fsck/fsck.h b/gfs2/fsck/fsck.h index 34faf3ca..fb01a4ab 100644 --- a/gfs2/fsck/fsck.h +++ b/gfs2/fsck/fsck.h @@ -150,7 +150,6 @@ extern void dirtree_delete(struct fsck_cx *cx, struct dir_info *b); * of pass1 and put somewhere else... */ struct dir_info *dirtree_insert(struct fsck_cx *cx, struct lgfs2_inum inum);
-extern struct fsck_options opts; extern struct lgfs2_inode *lf_dip; /* Lost and found directory inode */ extern int lf_was_created; extern uint64_t last_fs_block, last_reported_block; diff --git a/gfs2/fsck/main.c b/gfs2/fsck/main.c index cda02def..42114e53 100644 --- a/gfs2/fsck/main.c +++ b/gfs2/fsck/main.c @@ -25,7 +25,6 @@ #include "metawalk.h" #include "util.h"
-struct fsck_options opts = {0}; struct lgfs2_inode *lf_dip = NULL; /* Lost and found directory inode */ int lf_was_created = 0; uint64_t last_fs_block, last_reported_block = -1; @@ -298,6 +297,7 @@ static void startlog(int argc, char **argv) #ifndef UNITTESTS int main(int argc, char **argv) { + struct fsck_options opts = {0}; struct lgfs2_sbd sb; struct fsck_cx cx = { .sdp = &sb,