diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-01-31 02:58:43 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:09:49 +0200 |
commit | 19a614d2e4beed7faf52ab95cb48ce38a3c38c04 (patch) | |
tree | 2b2a71e8adaae57def4d6cd93f3628cd8fbc8573 /fs/bcachefs/lru.c | |
parent | bcachefs: Improve btree_reserve_get_fail tracepoint (diff) | |
download | linux-19a614d2e4beed7faf52ab95cb48ce38a3c38c04.tar.xz linux-19a614d2e4beed7faf52ab95cb48ce38a3c38c04.zip |
bcachefs: Better inlining for bch2_alloc_to_v4_mut
This separates out the slowpath into a separate function, and inlines
bch2_alloc_v4_mut into bch2_trans_start_alloc_update(), the main place
it's called.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/lru.c')
-rw-r--r-- | fs/bcachefs/lru.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/bcachefs/lru.c b/fs/bcachefs/lru.c index 9b4ce27d12f3..12821868df71 100644 --- a/fs/bcachefs/lru.c +++ b/fs/bcachefs/lru.c @@ -140,7 +140,8 @@ static int bch2_check_lru_key(struct btree_trans *trans, struct bch_fs *c = trans->c; struct btree_iter iter; struct bkey_s_c k; - struct bch_alloc_v4 a; + struct bch_alloc_v4 a_convert; + const struct bch_alloc_v4 *a; struct printbuf buf1 = PRINTBUF; struct printbuf buf2 = PRINTBUF; struct bpos alloc_pos; @@ -160,10 +161,10 @@ static int bch2_check_lru_key(struct btree_trans *trans, if (ret) goto err; - bch2_alloc_to_v4(k, &a); + a = bch2_alloc_to_v4(k, &a_convert); - if (fsck_err_on(a.data_type != BCH_DATA_cached || - a.io_time[READ] != lru_k.k->p.offset, c, + if (fsck_err_on(a->data_type != BCH_DATA_cached || + a->io_time[READ] != lru_k.k->p.offset, c, "incorrect lru entry %s\n" " for %s", (bch2_bkey_val_to_text(&buf1, c, lru_k), buf1.buf), |