diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-08-11 19:12:05 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:09 -0400 |
commit | 216c9facfd7568f6b91d43784994830b235abd91 (patch) | |
tree | 4d6a19be9a7e9f485bddcf26b4d4564ebeae026d /fs/bcachefs/bset.c | |
parent | fc3268c13c1925df9bdc427ffe9bd5466f672b83 (diff) | |
download | linux-216c9facfd7568f6b91d43784994830b235abd91.tar.gz linux-216c9facfd7568f6b91d43784994830b235abd91.tar.bz2 linux-216c9facfd7568f6b91d43784994830b235abd91.zip |
bcachefs: Pass around bset_tree less
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bset.c')
-rw-r--r-- | fs/bcachefs/bset.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/fs/bcachefs/bset.c b/fs/bcachefs/bset.c index b95cfe7ece9a..91c6bc2c8418 100644 --- a/fs/bcachefs/bset.c +++ b/fs/bcachefs/bset.c @@ -23,16 +23,7 @@ static inline void __bch2_btree_node_iter_advance(struct btree_node_iter *, struct bset_tree *bch2_bkey_to_bset(struct btree *b, struct bkey_packed *k) { - unsigned offset = __btree_node_key_to_offset(b, k); - struct bset_tree *t; - - for_each_bset(b, t) - if (offset <= t->end_offset) { - EBUG_ON(offset < btree_bkey_first_offset(t)); - return t; - } - - BUG(); + return bch2_bkey_to_bset_inlined(b, k); } /* @@ -1117,9 +1108,10 @@ static void ro_aux_tree_fix_invalidated_key(struct btree *b, * modified, fix any auxiliary search tree by remaking all the nodes in the * auxiliary search tree that @k corresponds to */ -void bch2_bset_fix_invalidated_key(struct btree *b, struct bset_tree *t, - struct bkey_packed *k) +void bch2_bset_fix_invalidated_key(struct btree *b, struct bkey_packed *k) { + struct bset_tree *t = bch2_bkey_to_bset_inlined(b, k); + switch (bset_aux_tree_type(t)) { case BSET_NO_AUX_TREE: break; |