diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-01-30 20:26:08 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:35 -0400 |
commit | fdf224003354fb14e20f638e479273c4728dfc0a (patch) | |
tree | de3f0ebe37a2063ca523ceffb6e0d06a3dd07b20 /fs/bcachefs/bset.c | |
parent | 7d4aed1ea408f45aef8ddf5f28d8c10680b4f214 (diff) | |
download | linux-fdf224003354fb14e20f638e479273c4728dfc0a.tar.gz linux-fdf224003354fb14e20f638e479273c4728dfc0a.tar.bz2 linux-fdf224003354fb14e20f638e479273c4728dfc0a.zip |
bcachefs: Improve an insert path optimization
The insert path had an optimization to short circuit lookup
table/iterator fixups when overwriting an existing key with the same
size value - but it was incorrect when other key fields
(size/version) were changing. This is important for the upcoming rework
to have extent updates use the same insert path as regular keys.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bset.c')
-rw-r--r-- | fs/bcachefs/bset.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/bset.c b/fs/bcachefs/bset.c index cff664ab75fa..b8fe361978ef 100644 --- a/fs/bcachefs/bset.c +++ b/fs/bcachefs/bset.c @@ -1189,7 +1189,8 @@ void bch2_bset_insert(struct btree *b, memcpy_u64s(bkeyp_val(f, where), &insert->v, bkeyp_val_u64s(f, src)); - bch2_bset_fix_lookup_table(b, t, where, clobber_u64s, src->u64s); + if (src->u64s != clobber_u64s) + bch2_bset_fix_lookup_table(b, t, where, clobber_u64s, src->u64s); bch2_verify_btree_nr_keys(b); } |