summaryrefslogtreecommitdiff
path: root/fs/bcachefs/recovery.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-07-12 17:08:32 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:24 -0400
commite222d206f298dc2c689d8f8787c929451d4f909b (patch)
treee93d5021ddbd7303aa162b2a97ea7b944c7479f5 /fs/bcachefs/recovery.h
parentf516c87272c98186f12768e9589664ce7a910bf4 (diff)
bcachefs: Fix ec_stripes_read()
Change it to not mark keys that will be overwritten by keys in the journal - this fixes a bug where we pop an assertion in bucket_set_stripe() because of a stale pointer - because the stripe that has the stale pointer has been deleted. This code could be factored out and used elsewhere, at some point. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/recovery.h')
-rw-r--r--fs/bcachefs/recovery.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/bcachefs/recovery.h b/fs/bcachefs/recovery.h
index a69260d6165a..479ea46f8dcb 100644
--- a/fs/bcachefs/recovery.h
+++ b/fs/bcachefs/recovery.h
@@ -18,6 +18,17 @@ struct journal_keys {
#define for_each_journal_key(keys, i) \
for (i = (keys).d; i < (keys).d + (keys).nr; (i)++)
+struct journal_iter {
+ struct journal_keys *keys;
+ struct journal_key *k;
+ enum btree_id btree_id;
+};
+
+struct journal_iter bch2_journal_iter_init(struct journal_keys *,
+ enum btree_id);
+struct bkey_s_c bch2_journal_iter_peek(struct journal_iter *);
+struct bkey_s_c bch2_journal_iter_next(struct journal_iter *);
+
int bch2_fs_recovery(struct bch_fs *);
int bch2_fs_initialize(struct bch_fs *);