diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-08-19 13:43:01 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:25 -0400 |
commit | e67ab0450cca7dc1673e4cd00eecf9d896b15889 (patch) | |
tree | 8d50317ed64879a1b9b692c25d66685eaad1c930 /fs/bcachefs/bset.h | |
parent | 9df279407a2daaf8e6586be483632fe9aaca6ef3 (diff) | |
download | linux-e67ab0450cca7dc1673e4cd00eecf9d896b15889.tar.gz linux-e67ab0450cca7dc1673e4cd00eecf9d896b15889.tar.bz2 linux-e67ab0450cca7dc1673e4cd00eecf9d896b15889.zip |
bcachefs: Fix bch2_btree_node_iter_prev_filter()
bch2_btree_node_iter_prev_filter() tried to be smart about iterating
backwards when skipping over whiteouts/discards - but unfortunately,
doing so can leave the node iterator in an inconsistent state; the sane
solution is to just always iterate backwards one key at a time.
But we compact btree nodes when more than a quarter of the keys are
whiteouts/discards, so the optimization wasn't buying us that much
anyways.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bset.h')
-rw-r--r-- | fs/bcachefs/bset.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/bcachefs/bset.h b/fs/bcachefs/bset.h index da3e41cc9757..209d2ed5db3a 100644 --- a/fs/bcachefs/bset.h +++ b/fs/bcachefs/bset.h @@ -543,16 +543,12 @@ bch2_btree_node_iter_next_all(struct btree_node_iter *iter, struct btree *b) return ret; } +struct bkey_packed *bch2_btree_node_iter_prev_all(struct btree_node_iter *, + struct btree *); struct bkey_packed *bch2_btree_node_iter_prev_filter(struct btree_node_iter *, struct btree *, unsigned); static inline struct bkey_packed * -bch2_btree_node_iter_prev_all(struct btree_node_iter *iter, struct btree *b) -{ - return bch2_btree_node_iter_prev_filter(iter, b, 0); -} - -static inline struct bkey_packed * bch2_btree_node_iter_prev(struct btree_node_iter *iter, struct btree *b) { return bch2_btree_node_iter_prev_filter(iter, b, KEY_TYPE_discard + 1); |