summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/recovery.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-05-24 14:06:10 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:40 -0400
commitb29303966b9e07dda5f21c667909eb87849453f2 (patch)
tree91c96f55bd15a711ad34a647ee2bd7cf42cd4cf3 /fs/bcachefs/recovery.h
parent692c3f0601bd1b04b914a40907a36e4c36dc8edd (diff)
downloadlinux-stable-b29303966b9e07dda5f21c667909eb87849453f2.tar.gz
linux-stable-b29303966b9e07dda5f21c667909eb87849453f2.tar.bz2
linux-stable-b29303966b9e07dda5f21c667909eb87849453f2.zip
bcachefs: Fix reading of alloc info after unclean shutdown
When updates to interior nodes started being journalled, that meant that after an unclean shutdown, until journal replay is done we can't walk the btree without overlaying the updates from the journal. The initial btree gc was changed to walk the btree overlaying keys from the journal - but bch2_alloc_read() and bch2_stripes_read() were missed. Major whoops... Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/recovery.h')
-rw-r--r--fs/bcachefs/recovery.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/bcachefs/recovery.h b/fs/bcachefs/recovery.h
index 19f2f172a26b..a66827c9addf 100644
--- a/fs/bcachefs/recovery.h
+++ b/fs/bcachefs/recovery.h
@@ -44,6 +44,13 @@ void bch2_btree_and_journal_iter_init_node_iter(struct btree_and_journal_iter *,
struct journal_keys *,
struct btree *);
+typedef int (*btree_walk_node_fn)(struct bch_fs *c, struct btree *b);
+typedef int (*btree_walk_key_fn)(struct bch_fs *c, enum btree_id id,
+ unsigned level, struct bkey_s_c k);
+
+int bch2_btree_and_journal_walk(struct bch_fs *, struct journal_keys *, enum btree_id,
+ btree_walk_node_fn, btree_walk_key_fn);
+
void bch2_journal_keys_free(struct journal_keys *);
void bch2_journal_entries_free(struct list_head *);