bcachefs: Add support for doing btree updates prior to journal replay
authorKent Overstreet <kent.overstreet@gmail.com>
Wed, 27 Jan 2021 01:15:46 +0000 (20:15 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:52 +0000 (17:08 -0400)
commit5b593ee172bd536a2c9fd717de7e4a16d682ef23
tree2cc9e4d8acf85afef16a7336feebfb1c2161e72b
parent51d2dfb82d0553c5764689d30adabbf6d0927be5
bcachefs: Add support for doing btree updates prior to journal replay

Some errors may need to be fixed in order for GC to successfully run -
walk and mark all metadata. But we can't start the allocators and do
normal btree updates until after GC has completed, and allocation
information is known to be consistent, so we need a different method of
doing btree updates.

Fortunately, we already have code for walking the btree while overlaying
keys from the journal to be replayed. This patch adds an update path
that adds keys to the list of keys to be replayed by journal replay, and
also fixes up iterators.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/bcachefs.h
fs/bcachefs/btree_gc.c
fs/bcachefs/btree_gc.h
fs/bcachefs/recovery.c
fs/bcachefs/recovery.h
fs/bcachefs/super.c
fs/bcachefs/sysfs.c