diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-08-30 21:18:31 +0200 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:09:11 +0200 |
commit | 67e0dd8f0d8b4bf09098c4692abcb43a20089dff (patch) | |
tree | 8ba50f2d86b09cae23a39a02982abff3524e2f45 /fs/bcachefs/bset.c | |
parent | bcachefs: Fix initialization of bch_write_op.nonce (diff) | |
download | linux-67e0dd8f0d8b4bf09098c4692abcb43a20089dff.tar.xz linux-67e0dd8f0d8b4bf09098c4692abcb43a20089dff.zip |
bcachefs: btree_path
This splits btree_iter into two components: btree_iter is now the
externally visible componont, and it points to a btree_path which is now
reference counted.
This means we no longer have to clone iterators up front if they might
be mutated - btree_path can be shared by multiple iterators, and cloned
if an iterator would mutate a shared btree_path. This will help us use
iterators more efficiently, as well as slimming down the main long lived
state in btree_trans, and significantly cleans up the logic for iterator
lifetimes.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bset.c')
-rw-r--r-- | fs/bcachefs/bset.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/bcachefs/bset.c b/fs/bcachefs/bset.c index 9484f28be6de..2e0ad3a4fa67 100644 --- a/fs/bcachefs/bset.c +++ b/fs/bcachefs/bset.c @@ -185,9 +185,11 @@ void bch2_btree_node_iter_verify(struct btree_node_iter *iter, return; /* Verify no duplicates: */ - btree_node_iter_for_each(iter, set) + btree_node_iter_for_each(iter, set) { + BUG_ON(set->k > set->end); btree_node_iter_for_each(iter, s2) BUG_ON(set != s2 && set->end == s2->end); + } /* Verify that set->end is correct: */ btree_node_iter_for_each(iter, set) { |