bcachefs; Mark __bch2_trans_iter_init as inline

This function is fairly small and only used in two places: one very hot,
the other cold, so it should definitely be inlined.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2022-09-26 18:15:33 -04:00
parent 25b4b3308e
commit c298fd7d34
2 changed files with 7 additions and 8 deletions

View file

@ -2581,12 +2581,12 @@ void bch2_trans_iter_exit(struct btree_trans *trans, struct btree_iter *iter)
iter->key_cache_path = NULL;
}
static void __bch2_trans_iter_init(struct btree_trans *trans,
struct btree_iter *iter,
enum btree_id btree_id, struct bpos pos,
unsigned locks_want,
unsigned depth,
unsigned flags)
static inline void __bch2_trans_iter_init(struct btree_trans *trans,
struct btree_iter *iter,
enum btree_id btree_id, struct bpos pos,
unsigned locks_want,
unsigned depth,
unsigned flags)
{
if (trans->restarted)
panic("bch2_trans_iter_init(): in transaction restart, %s by %pS\n",

View file

@ -36,8 +36,7 @@ static struct btree_path *get_unlocked_mut_path(struct btree_trans *trans,
struct btree_path *path;
path = bch2_path_get(trans, btree_id, pos, level + 1, level,
BTREE_ITER_NOPRESERVE|
BTREE_ITER_INTENT);
BTREE_ITER_NOPRESERVE|BTREE_ITER_INTENT);
path = bch2_btree_path_make_mut(trans, path, true);
bch2_btree_path_downgrade(trans, path);
__bch2_btree_path_unlock(trans, path);