Commit 087e53c2 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Bring back BTREE_ITER_CACHED_NOFILL

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent dcced069
...@@ -1581,7 +1581,8 @@ struct bkey_s_c bch2_btree_path_peek_slot(struct btree_path *path, struct bkey * ...@@ -1581,7 +1581,8 @@ struct bkey_s_c bch2_btree_path_peek_slot(struct btree_path *path, struct bkey *
EBUG_ON(ck && EBUG_ON(ck &&
(path->btree_id != ck->key.btree_id || (path->btree_id != ck->key.btree_id ||
!bkey_eq(path->pos, ck->key.pos))); !bkey_eq(path->pos, ck->key.pos)));
EBUG_ON(!ck || !ck->valid); if (!ck || !ck->valid)
return bkey_s_c_null;
*u = ck->k->k; *u = ck->k->k;
k = bkey_i_to_s_c(ck->k); k = bkey_i_to_s_c(ck->k);
...@@ -1860,7 +1861,8 @@ struct bkey_s_c btree_trans_peek_key_cache(struct btree_iter *iter, struct bpos ...@@ -1860,7 +1861,8 @@ struct bkey_s_c btree_trans_peek_key_cache(struct btree_iter *iter, struct bpos
if (!iter->key_cache_path) if (!iter->key_cache_path)
iter->key_cache_path = bch2_path_get(trans, iter->btree_id, pos, iter->key_cache_path = bch2_path_get(trans, iter->btree_id, pos,
iter->flags & BTREE_ITER_INTENT, 0, iter->flags & BTREE_ITER_INTENT, 0,
iter->flags|BTREE_ITER_CACHED); iter->flags|BTREE_ITER_CACHED|
BTREE_ITER_CACHED_NOFILL);
iter->key_cache_path = bch2_btree_path_set_pos(trans, iter->key_cache_path, pos, iter->key_cache_path = bch2_btree_path_set_pos(trans, iter->key_cache_path, pos,
iter->flags & BTREE_ITER_INTENT); iter->flags & BTREE_ITER_INTENT);
......
...@@ -487,7 +487,7 @@ bch2_btree_path_traverse_cached_slowpath(struct btree_trans *trans, struct btree ...@@ -487,7 +487,7 @@ bch2_btree_path_traverse_cached_slowpath(struct btree_trans *trans, struct btree
path->l[0].lock_seq = ck->c.lock.state.seq; path->l[0].lock_seq = ck->c.lock.state.seq;
path->l[0].b = (void *) ck; path->l[0].b = (void *) ck;
fill: fill:
if (!ck->valid) { if (!ck->valid && !(flags & BTREE_ITER_CACHED_NOFILL)) {
/* /*
* Using the underscore version because we haven't set * Using the underscore version because we haven't set
* path->uptodate yet: * path->uptodate yet:
...@@ -508,7 +508,6 @@ bch2_btree_path_traverse_cached_slowpath(struct btree_trans *trans, struct btree ...@@ -508,7 +508,6 @@ bch2_btree_path_traverse_cached_slowpath(struct btree_trans *trans, struct btree
set_bit(BKEY_CACHED_ACCESSED, &ck->flags); set_bit(BKEY_CACHED_ACCESSED, &ck->flags);
path->uptodate = BTREE_ITER_UPTODATE; path->uptodate = BTREE_ITER_UPTODATE;
BUG_ON(!ck->valid);
BUG_ON(btree_node_locked_type(path, 0) != btree_lock_want(path, 0)); BUG_ON(btree_node_locked_type(path, 0) != btree_lock_want(path, 0));
return ret; return ret;
......
...@@ -207,6 +207,7 @@ struct btree_node_iter { ...@@ -207,6 +207,7 @@ struct btree_node_iter {
#define BTREE_ITER_ALL_SNAPSHOTS (1 << 11) #define BTREE_ITER_ALL_SNAPSHOTS (1 << 11)
#define BTREE_ITER_FILTER_SNAPSHOTS (1 << 12) #define BTREE_ITER_FILTER_SNAPSHOTS (1 << 12)
#define BTREE_ITER_NOPRESERVE (1 << 13) #define BTREE_ITER_NOPRESERVE (1 << 13)
#define BTREE_ITER_CACHED_NOFILL (1 << 14)
enum btree_path_uptodate { enum btree_path_uptodate {
BTREE_ITER_UPTODATE = 0, BTREE_ITER_UPTODATE = 0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment