bcachefs: Update path microoptimizations

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2019-09-21 15:29:34 -04:00 committed by Kent Overstreet
parent 0a426c3239
commit fdfab313b6
2 changed files with 5 additions and 4 deletions

View file

@ -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);
}

View file

@ -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);
/*