diff options
Diffstat (limited to 'libbcachefs/btree_update_leaf.c')
-rw-r--r-- | libbcachefs/btree_update_leaf.c | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/libbcachefs/btree_update_leaf.c b/libbcachefs/btree_update_leaf.c index 2e3818a5..a08d36c0 100644 --- a/libbcachefs/btree_update_leaf.c +++ b/libbcachefs/btree_update_leaf.c @@ -987,15 +987,9 @@ int __bch2_trans_commit(struct btree_trans *trans) if (trans->flags & BTREE_INSERT_GC_LOCK_HELD) lockdep_assert_held(&c->gc_lock); - memset(&trans->journal_preres, 0, sizeof(trans->journal_preres)); - - trans->journal_u64s = trans->extra_journal_entry_u64s; - trans->journal_preres_u64s = 0; - - trans->journal_transaction_names = READ_ONCE(c->opts.journal_transaction_names); - - if (trans->journal_transaction_names) - trans->journal_u64s += JSET_ENTRY_LOG_U64s; + ret = bch2_trans_commit_run_triggers(trans); + if (ret) + goto out_reset; if (!(trans->flags & BTREE_INSERT_NOCHECK_RW) && unlikely(!percpu_ref_tryget(&c->writes))) { @@ -1004,21 +998,15 @@ int __bch2_trans_commit(struct btree_trans *trans) goto out_reset; } -#ifdef CONFIG_BCACHEFS_DEBUG - /* - * if BTREE_TRIGGER_NORUN is set, it means we're probably being called - * from the key cache flush code: - */ - trans_for_each_update(trans, i) - if (!i->cached && - !(i->flags & BTREE_TRIGGER_NORUN)) - bch2_btree_key_cache_verify_clean(trans, - i->btree_id, i->k->k.p); -#endif + memset(&trans->journal_preres, 0, sizeof(trans->journal_preres)); - ret = bch2_trans_commit_run_triggers(trans); - if (ret) - goto out; + trans->journal_u64s = trans->extra_journal_entry_u64s; + trans->journal_preres_u64s = 0; + + trans->journal_transaction_names = READ_ONCE(c->opts.journal_transaction_names); + + if (trans->journal_transaction_names) + trans->journal_u64s += JSET_ENTRY_LOG_U64s; trans_for_each_update(trans, i) { BUG_ON(!i->path->should_be_locked); |