diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-12-25 20:07:00 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:21 -0400 |
commit | 5222a4607cd8b9d8882e81796917c10193d10be0 (patch) | |
tree | b68fb2d883efdb75eaf1376c9f2a0baf30fb30fc /fs/bcachefs/btree_types.h | |
parent | bcachefs: Tweak journal reclaim order (diff) | |
download | linux-5222a4607cd8b9d8882e81796917c10193d10be0.tar.gz linux-5222a4607cd8b9d8882e81796917c10193d10be0.tar.bz2 linux-5222a4607cd8b9d8882e81796917c10193d10be0.zip |
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>
Diffstat (limited to 'fs/bcachefs/btree_types.h')
-rw-r--r-- | fs/bcachefs/btree_types.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/bcachefs/btree_types.h b/fs/bcachefs/btree_types.h index 2c8b30949e6f..1fd0cebe30ac 100644 --- a/fs/bcachefs/btree_types.h +++ b/fs/bcachefs/btree_types.h @@ -207,10 +207,11 @@ struct btree_node_iter { #define BTREE_ITER_CACHED_NOFILL (1 << 8) #define BTREE_ITER_CACHED_NOCREATE (1 << 9) #define BTREE_ITER_WITH_UPDATES (1 << 10) -#define __BTREE_ITER_ALL_SNAPSHOTS (1 << 11) -#define BTREE_ITER_ALL_SNAPSHOTS (1 << 12) -#define BTREE_ITER_FILTER_SNAPSHOTS (1 << 13) -#define BTREE_ITER_NOPRESERVE (1 << 14) +#define BTREE_ITER_WITH_JOURNAL (1 << 11) +#define __BTREE_ITER_ALL_SNAPSHOTS (1 << 12) +#define BTREE_ITER_ALL_SNAPSHOTS (1 << 13) +#define BTREE_ITER_FILTER_SNAPSHOTS (1 << 14) +#define BTREE_ITER_NOPRESERVE (1 << 15) enum btree_path_uptodate { BTREE_ITER_UPTODATE = 0, @@ -381,6 +382,7 @@ struct btree_trans { bool restarted:1; bool paths_sorted:1; bool journal_transaction_names:1; + bool journal_replay_not_finished:1; /* * For when bch2_trans_update notices we'll be splitting a compressed * extent: |