Commit fdfab313 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Update path microoptimizations

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 0a426c32
......@@ -211,7 +211,7 @@ static inline void bch2_btree_node_lock_write(struct btree *b, struct btree_iter
EBUG_ON(iter->l[b->c.level].b != b);
EBUG_ON(iter->l[b->c.level].lock_seq != b->c.lock.state.seq);
if (!six_trylock_write(&b->c.lock))
if (unlikely(!six_trylock_write(&b->c.lock)))
__bch2_btree_node_lock_write(b, iter);
}
......
......@@ -44,7 +44,7 @@ inline void bch2_btree_node_lock_for_insert(struct bch_fs *c, struct btree *b,
{
bch2_btree_node_lock_write(b, iter);
if (btree_node_just_written(b) &&
if (unlikely(btree_node_just_written(b)) &&
bch2_btree_post_write_cleanup(c, b))
bch2_btree_iter_reinit_node(iter, b);
......@@ -605,8 +605,9 @@ static inline int do_btree_insert_at(struct btree_trans *trans,
goto out_clear_replicas;
}
trans_for_each_update(trans, i)
btree_insert_entry_checks(trans, i);
if (IS_ENABLED(CONFIG_BCACHEFS_DEBUG))
trans_for_each_update(trans, i)
btree_insert_entry_checks(trans, i);
bch2_btree_trans_verify_locks(trans);
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment