bcachefs: Rename fsck_running, recovery_running flags

Slightly more readable.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2025-05-10 17:16:11 -04:00
parent 5b1247ca5f
commit 367cad0966
5 changed files with 14 additions and 14 deletions

View File

@ -677,8 +677,8 @@ struct bch_dev {
x(going_ro) \
x(write_disable_complete) \
x(clean_shutdown) \
x(recovery_running) \
x(fsck_running) \
x(in_recovery) \
x(in_fsck) \
x(initial_gc_unfixed) \
x(need_delete_dead_snapshots) \
x(error) \

View File

@ -580,7 +580,7 @@ static int __btree_err(int ret,
bool print_deferred = err_msg &&
rw == READ &&
!(test_bit(BCH_FS_fsck_running, &c->flags) &&
!(test_bit(BCH_FS_in_fsck, &c->flags) &&
c->opts.fix_errors == FSCK_FIX_ask);
struct printbuf out = PRINTBUF;

View File

@ -100,7 +100,7 @@ int __bch2_topology_error(struct bch_fs *c, struct printbuf *out)
prt_printf(out, "btree topology error: ");
set_bit(BCH_FS_topology_error, &c->flags);
if (!test_bit(BCH_FS_recovery_running, &c->flags)) {
if (!test_bit(BCH_FS_in_recovery, &c->flags)) {
__bch2_inconsistent_error(c, out);
return -BCH_ERR_btree_need_topology_repair;
} else {
@ -400,7 +400,7 @@ int bch2_fsck_err_opt(struct bch_fs *c,
if (!WARN_ON(err >= ARRAY_SIZE(fsck_flags_extra)))
flags |= fsck_flags_extra[err];
if (test_bit(BCH_FS_fsck_running, &c->flags)) {
if (test_bit(BCH_FS_in_fsck, &c->flags)) {
if (!(flags & (FSCK_CAN_FIX|FSCK_CAN_IGNORE)))
return -BCH_ERR_fsck_repair_unimplemented;
@ -523,7 +523,7 @@ int __bch2_fsck_err(struct bch_fs *c,
}
goto print;
} else if (!test_bit(BCH_FS_fsck_running, &c->flags)) {
} else if (!test_bit(BCH_FS_in_fsck, &c->flags)) {
if (c->opts.errors != BCH_ON_ERROR_continue ||
!(flags & (FSCK_CAN_FIX|FSCK_CAN_IGNORE))) {
prt_str_indented(out, ", shutting down\n"
@ -582,7 +582,7 @@ int __bch2_fsck_err(struct bch_fs *c,
!(flags & FSCK_CAN_IGNORE)))
ret = -BCH_ERR_fsck_errors_not_fixed;
if (test_bit(BCH_FS_fsck_running, &c->flags) &&
if (test_bit(BCH_FS_in_fsck, &c->flags) &&
(ret != -BCH_ERR_fsck_fix &&
ret != -BCH_ERR_fsck_ignore)) {
exiting = true;

View File

@ -3192,12 +3192,12 @@ static int bch2_fsck_online_thread_fn(struct thread_with_stdio *stdio)
c->opts.fix_errors = FSCK_FIX_ask;
c->opts.fsck = true;
set_bit(BCH_FS_fsck_running, &c->flags);
set_bit(BCH_FS_in_fsck, &c->flags);
c->curr_recovery_pass = BCH_RECOVERY_PASS_check_alloc_info;
int ret = bch2_run_online_recovery_passes(c);
clear_bit(BCH_FS_fsck_running, &c->flags);
clear_bit(BCH_FS_in_fsck, &c->flags);
bch_err_fn(c, ret);
c->stdio = NULL;

View File

@ -791,11 +791,11 @@ int bch2_fs_recovery(struct bch_fs *c)
bch2_write_super(c);
mutex_unlock(&c->sb_lock);
if (c->opts.fsck)
set_bit(BCH_FS_fsck_running, &c->flags);
if (c->sb.clean)
set_bit(BCH_FS_clean_recovery, &c->flags);
set_bit(BCH_FS_recovery_running, &c->flags);
if (c->opts.fsck)
set_bit(BCH_FS_in_fsck, &c->flags);
set_bit(BCH_FS_in_recovery, &c->flags);
ret = bch2_blacklist_table_initialize(c);
if (ret) {
@ -977,8 +977,8 @@ int bch2_fs_recovery(struct bch_fs *c)
* multithreaded use:
*/
set_bit(BCH_FS_may_go_rw, &c->flags);
clear_bit(BCH_FS_fsck_running, &c->flags);
clear_bit(BCH_FS_recovery_running, &c->flags);
clear_bit(BCH_FS_in_fsck, &c->flags);
clear_bit(BCH_FS_in_recovery, &c->flags);
/* in case we don't run journal replay, i.e. norecovery mode */
set_bit(BCH_FS_accounting_replay_done, &c->flags);