]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bcachefs: Rename fsck_running, recovery_running flags
authorKent Overstreet <kent.overstreet@linux.dev>
Sat, 10 May 2025 21:16:11 +0000 (17:16 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Thu, 22 May 2025 00:14:56 +0000 (20:14 -0400)
Slightly more readable.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/bcachefs.h
fs/bcachefs/btree_io.c
fs/bcachefs/error.c
fs/bcachefs/fsck.c
fs/bcachefs/recovery.c

index 076520beacd6a2648b1079c1f5c7cda0a8ecd420..27c025c05f8e19ef58eb6f2784c87369d24175d1 100644 (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)                        \
index d9adc4f5ba3d33cfc5a162227fb603328030c70c..a3250241e13e05c4e7b669e4337d34dfec67b91c 100644 (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;
index d7bc70fd77629c34ca875cac6bb38033219b1982..03567c559623f3b3d1aaeae3b27f321b3a6267f4 100644 (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;
index 7c10325a1facbb2bca6fdb8e53b33d50a5a40879..4258c91e6df34288e0c70430bb108fd14cd8f622 100644 (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;
index 375111b56029eb0c11319e600a118a29289fc7c5..b4242ad4899d5edf84faf4582aa41a9b0c405456 100644 (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 @@ use_clean:
         * 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);