diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-07-11 23:47:29 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:10:07 -0400 |
commit | a0f8faea5f47d6e18253225e8f2f88cdc49d27d8 (patch) | |
tree | cf2b0b930c403173fc70e39313fd4d1348cf428c /fs/bcachefs/error.c | |
parent | 9f343e24f541bef3d5f081925eae5734c2c39c28 (diff) | |
download | lwn-a0f8faea5f47d6e18253225e8f2f88cdc49d27d8.tar.gz lwn-a0f8faea5f47d6e18253225e8f2f88cdc49d27d8.zip |
bcachefs: fix_errors option is now a proper enum
Before, it was parsed as a bool but internally it was really an enum:
this lets us pass in all the possible values.
But we special case the option parsing: no supplied value is parsed as
FSCK_FIX_yes, to match the previous behaviour.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/error.c')
-rw-r--r-- | fs/bcachefs/error.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/bcachefs/error.c b/fs/bcachefs/error.c index b08cd23dee00..685464b8cce3 100644 --- a/fs/bcachefs/error.c +++ b/fs/bcachefs/error.c @@ -204,7 +204,7 @@ int bch2_fsck_err(struct bch_fs *c, unsigned flags, const char *fmt, ...) prt_str(out, ", continuing"); ret = -BCH_ERR_fsck_ignore; } - } else if (c->opts.fix_errors == FSCK_OPT_EXIT) { + } else if (c->opts.fix_errors == FSCK_FIX_exit) { prt_str(out, ", exiting"); ret = -BCH_ERR_fsck_errors_not_fixed; } else if (flags & FSCK_CAN_FIX) { @@ -212,7 +212,7 @@ int bch2_fsck_err(struct bch_fs *c, unsigned flags, const char *fmt, ...) ? s->fix : c->opts.fix_errors; - if (fix == FSCK_OPT_ASK) { + if (fix == FSCK_FIX_ask) { int ask; prt_str(out, ": fix?"); @@ -223,13 +223,13 @@ int bch2_fsck_err(struct bch_fs *c, unsigned flags, const char *fmt, ...) if (ask >= YN_ALLNO && s) s->fix = ask == YN_ALLNO - ? FSCK_OPT_NO - : FSCK_OPT_YES; + ? FSCK_FIX_no + : FSCK_FIX_yes; ret = ask & 1 ? -BCH_ERR_fsck_fix : -BCH_ERR_fsck_ignore; - } else if (fix == FSCK_OPT_YES || + } else if (fix == FSCK_FIX_yes || (c->opts.nochanges && !(flags & FSCK_CAN_IGNORE))) { prt_str(out, ", fixing"); @@ -244,7 +244,7 @@ int bch2_fsck_err(struct bch_fs *c, unsigned flags, const char *fmt, ...) } if (ret == -BCH_ERR_fsck_ignore && - (c->opts.fix_errors == FSCK_OPT_EXIT || + (c->opts.fix_errors == FSCK_FIX_exit || !(flags & FSCK_CAN_IGNORE))) ret = -BCH_ERR_fsck_errors_not_fixed; |