bcachefs: BTREE_ITER_WITH_JOURNAL
authorKent Overstreet <kent.overstreet@gmail.com>
Sun, 26 Dec 2021 01:07:00 +0000 (20:07 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:21 +0000 (17:09 -0400)
commit5222a4607cd8b9d8882e81796917c10193d10be0
treeb68fb2d883efdb75eaf1376c9f2a0baf30fb30fc
parentf28620c108a9476c7b4b25b8e36b94b6b2b29295
bcachefs: BTREE_ITER_WITH_JOURNAL

This adds a new btree iterator flag, BTREE_ITER_WITH_JOURNAL, that is
automatically enabled when initializing a btree iterator before journal
replay has completed - it overlays the contents of the journal with the
btree.

This lets us delete bch2_btree_and_journal_walk() and just use the
normal btree iterator interface instead - which also lets us delete a
significant amount of duplicated code.

Note that BTREE_ITER_WITH_JOURNAL is still unoptimized in this patch -
we're redoing the binary search over keys in the journal every time we
call bch2_btree_iter_peek().

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/alloc_background.c
fs/bcachefs/bcachefs.h
fs/bcachefs/btree_gc.c
fs/bcachefs/btree_iter.c
fs/bcachefs/btree_types.h
fs/bcachefs/btree_update_interior.c
fs/bcachefs/btree_update_leaf.c
fs/bcachefs/ec.c
fs/bcachefs/recovery.c
fs/bcachefs/recovery.h