diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-10-02 09:56:39 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:30 -0400 |
commit | 887c2a4ee5480d725d39a0d611a426040287188f (patch) | |
tree | dea6473a0366e09caf1925700b56a1dbe8db34d7 /fs/bcachefs/extents.c | |
parent | b7ba66c8450a58649393b47bc8975926b1e80814 (diff) | |
download | lwn-887c2a4ee5480d725d39a0d611a426040287188f.tar.gz lwn-887c2a4ee5480d725d39a0d611a426040287188f.zip |
bcachefs: bch2_btree_iter_fix_key_modified()
This is considerably cheaper than bch2_btree_node_iter_fix(), for cases
where the key was only modified and key ordering isn't changing.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/extents.c')
-rw-r--r-- | fs/bcachefs/extents.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/bcachefs/extents.c b/fs/bcachefs/extents.c index b427bc1f0f9c..201f4953acac 100644 --- a/fs/bcachefs/extents.c +++ b/fs/bcachefs/extents.c @@ -1091,8 +1091,7 @@ extent_squash(struct bch_fs *c, struct btree_iter *iter, __bch2_cut_front(insert->k.p, k); EBUG_ON(bkey_deleted(k.k)); extent_save(l->b, _k, k.k); - bch2_btree_node_iter_fix(iter, l->b, &l->iter, - _k, _k->u64s, _k->u64s); + bch2_btree_iter_fix_key_modified(iter, l->b, _k); break; case BCH_EXTENT_OVERLAP_BACK: @@ -1127,8 +1126,7 @@ extent_squash(struct bch_fs *c, struct btree_iter *iter, _k, u64s, 0); } else { extent_save(l->b, _k, k.k); - bch2_btree_node_iter_fix(iter, l->b, &l->iter, - _k, _k->u64s, _k->u64s); + bch2_btree_iter_fix_key_modified(iter, l->b, _k); } break; @@ -1158,8 +1156,7 @@ extent_squash(struct bch_fs *c, struct btree_iter *iter, __bch2_cut_front(insert->k.p, k); BUG_ON(bkey_deleted(k.k)); extent_save(l->b, _k, k.k); - bch2_btree_node_iter_fix(iter, l->b, &l->iter, - _k, _k->u64s, _k->u64s); + bch2_btree_iter_fix_key_modified(iter, l->b, _k); extent_bset_insert(c, iter, &split.k); break; @@ -1259,8 +1256,8 @@ void bch2_insert_fixup_extent(struct btree_trans *trans, btree_account_key_drop(l->b, _k); _k->type = KEY_TYPE_discard; reserve_whiteout(l->b, _k); - bch2_btree_node_iter_fix(iter, l->b, &l->iter, - _k, _k->u64s, _k->u64s); + bch2_btree_iter_fix_key_modified(iter, + l->b, _k); } break; } |