bcachefs: Kill some unneeded references to c->flags
authorKent Overstreet <kent.overstreet@linux.dev>
Wed, 23 Nov 2022 23:51:27 +0000 (18:51 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:46 +0000 (17:09 -0400)
This drops some unneeded references to JOURNAL_REPLAY_DONE in c->flags:
we're already mirroring it in btree_trans, we just weren't using it
consistently.

We may want to do this with more flags:
  btree_iter.c:   unsigned nr = test_bit(BCH_FS_STARTED, &c->flags)
  btree_update_leaf.c:    if (unlikely(!test_bit(BCH_FS_MAY_GO_RW, &c->flags))) {

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_update_leaf.c

index 3782dd56088ff709c152998c0d1434ba176418e9..8db474c6146e4a4a01195a2378beaef08519ab1b 100644 (file)
@@ -615,7 +615,7 @@ bch2_trans_commit_write_locked(struct btree_trans *trans,
                 */
                i->old_v = bch2_btree_path_peek_slot(i->path, &i->old_k).v;
 
-               if (unlikely(!test_bit(JOURNAL_REPLAY_DONE, &c->journal.flags))) {
+               if (unlikely(trans->journal_replay_not_finished)) {
                        struct bkey_i *j_k =
                                bch2_journal_keys_peek_slot(c, i->btree_id, i->level,
                                                            i->k->k.p);