bcachefs: BTREE_ITER_WITH_KEY_CACHE
authorKent Overstreet <kent.overstreet@gmail.com>
Mon, 7 Feb 2022 04:15:12 +0000 (23:15 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:23 +0000 (17:09 -0400)
commitf7b6ca23b6456b8b441b506ef977ff53972b35c2
tree89612a8307e8f5d5728af221c26f7d79511341f8
parent45e4cd9e3a088d476929c5ee245e83baeee6cdd5
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>
fs/bcachefs/btree_iter.c
fs/bcachefs/btree_iter.h
fs/bcachefs/btree_key_cache.c
fs/bcachefs/btree_types.h