aboutsummaryrefslogtreecommitdiff
path: root/fs/bcachefs/btree_types.h
diff options
context:
space:
mode:
authorGravatar Kent Overstreet <kent.overstreet@gmail.com> 2022-02-06 23:15:12 -0500
committerGravatar Kent Overstreet <kent.overstreet@linux.dev> 2023-10-22 17:09:23 -0400
commitf7b6ca23b6456b8b441b506ef977ff53972b35c2 (patch)
tree89612a8307e8f5d5728af221c26f7d79511341f8 /fs/bcachefs/btree_types.h
parentbcachefs: run_one_trigger() now checks journal keys (diff)
downloadlinux-f7b6ca23b6456b8b441b506ef977ff53972b35c2.tar.gz
linux-f7b6ca23b6456b8b441b506ef977ff53972b35c2.tar.bz2
linux-f7b6ca23b6456b8b441b506ef977ff53972b35c2.zip
bcachefs: BTREE_ITER_WITH_KEY_CACHE
This is the start of cache coherency with the btree key cache - this adds a btree iterator flag that causes lookups to also check the key cache when we're iterating over the btree (not iterating over the key cache). Note that we could still race with another thread creating at item in the key cache and updating it, since we aren't holding the key cache locked if it wasn't found. The next patch for the update path will address this by causing the transaction to restart if the key cache is found to be dirty. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_types.h')
-rw-r--r--fs/bcachefs/btree_types.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/bcachefs/btree_types.h b/fs/bcachefs/btree_types.h
index 587307ff5321..6db2ac49ee3f 100644
--- a/fs/bcachefs/btree_types.h
+++ b/fs/bcachefs/btree_types.h
@@ -202,10 +202,10 @@ struct btree_node_iter {
*/
#define BTREE_ITER_IS_EXTENTS (1 << 4)
#define BTREE_ITER_NOT_EXTENTS (1 << 5)
-#define BTREE_ITER_ERROR (1 << 6)
-#define BTREE_ITER_CACHED (1 << 7)
-#define BTREE_ITER_CACHED_NOFILL (1 << 8)
-#define BTREE_ITER_CACHED_NOCREATE (1 << 9)
+#define BTREE_ITER_CACHED (1 << 6)
+#define BTREE_ITER_CACHED_NOFILL (1 << 7)
+#define BTREE_ITER_CACHED_NOCREATE (1 << 8)
+#define BTREE_ITER_WITH_KEY_CACHE (1 << 9)
#define BTREE_ITER_WITH_UPDATES (1 << 10)
#define BTREE_ITER_WITH_JOURNAL (1 << 11)
#define __BTREE_ITER_ALL_SNAPSHOTS (1 << 12)
@@ -277,6 +277,7 @@ struct btree_iter {
struct btree_trans *trans;
struct btree_path *path;
struct btree_path *update_path;
+ struct btree_path *key_cache_path;
enum btree_id btree_id:4;
unsigned min_depth:4;