summaryrefslogtreecommitdiff
path: root/fs/bcachefs/recovery.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-06-06 21:59:34 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:33 -0400
commit576179021c90bea808ac12c491bd9b239ca80c2e (patch)
tree9e43517d7619b1ef51573f45a8fb813b80bdd2c3 /fs/bcachefs/recovery.h
parentf2aa02657561b0e6d96089eb8ee44e4154f4acad (diff)
bcachefs: Fix btree_and_journal_iter
We had a bug where btree_and_journal_iter would return the same key twice - after deleting it (perhaps because it was present in both the btree and the journal?) This reworks btree_and_journal_iter to track the current position, much like btree_paths, which makes the logic considerably simpler and more robust. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/recovery.h')
-rw-r--r--fs/bcachefs/recovery.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/bcachefs/recovery.h b/fs/bcachefs/recovery.h
index 52db06b29310..8c0348e8b84c 100644
--- a/fs/bcachefs/recovery.h
+++ b/fs/bcachefs/recovery.h
@@ -20,12 +20,8 @@ struct btree_and_journal_iter {
struct bkey unpacked;
struct journal_iter journal;
-
- enum last_key_returned {
- none,
- btree,
- journal,
- } last;
+ struct bpos pos;
+ bool at_end;
};
struct bkey_i *bch2_journal_keys_peek_upto(struct bch_fs *, enum btree_id,
@@ -44,7 +40,6 @@ void bch2_journal_key_overwritten(struct bch_fs *, enum btree_id,
void bch2_btree_and_journal_iter_advance(struct btree_and_journal_iter *);
struct bkey_s_c bch2_btree_and_journal_iter_peek(struct btree_and_journal_iter *);
-struct bkey_s_c bch2_btree_and_journal_iter_next(struct btree_and_journal_iter *);
void bch2_btree_and_journal_iter_exit(struct btree_and_journal_iter *);
void __bch2_btree_and_journal_iter_init_node_iter(struct btree_and_journal_iter *,