Commit 6fae65c1 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Kill BTREE_ITER_CACHED_(NOFILL|NOCREATE)

These were used more prior to getting rid of the in-memory bucket arrays
- they don't serve much purpose anymore, and deleting them lets us write
better assertions.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent 9f96568c
......@@ -2016,11 +2016,7 @@ inline struct bkey_s_c bch2_btree_path_peek_slot(struct btree_path *path, struct
EBUG_ON(ck &&
(path->btree_id != ck->key.btree_id ||
bkey_cmp(path->pos, ck->key.pos)));
/* BTREE_ITER_CACHED_NOFILL|BTREE_ITER_CACHED_NOCREATE? */
if (unlikely(!ck || !ck->valid))
return bkey_s_c_null;
EBUG_ON(!ck || !ck->valid);
EBUG_ON(path->uptodate != BTREE_ITER_UPTODATE);
*u = ck->k->k;
......
......@@ -372,11 +372,6 @@ int bch2_btree_path_traverse_cached(struct btree_trans *trans, struct btree_path
retry:
ck = bch2_btree_key_cache_find(c, path->btree_id, path->pos);
if (!ck) {
if (flags & BTREE_ITER_CACHED_NOCREATE) {
path->l[0].b = NULL;
return 0;
}
ck = btree_key_cache_create(c, path->btree_id, path->pos);
ret = PTR_ERR_OR_ZERO(ck);
if (ret)
......@@ -412,7 +407,7 @@ int bch2_btree_path_traverse_cached(struct btree_trans *trans, struct btree_path
path->l[0].lock_seq = ck->c.lock.state.seq;
path->l[0].b = (void *) ck;
fill:
if (!ck->valid && !(flags & BTREE_ITER_CACHED_NOFILL)) {
if (!ck->valid) {
/*
* Using the underscore version because we haven't set
* path->uptodate yet:
......@@ -433,6 +428,7 @@ int bch2_btree_path_traverse_cached(struct btree_trans *trans, struct btree_path
set_bit(BKEY_CACHED_ACCESSED, &ck->flags);
path->uptodate = BTREE_ITER_UPTODATE;
BUG_ON(!ck->valid);
BUG_ON(btree_node_locked_type(path, 0) != btree_lock_want(path, 0));
return ret;
......@@ -462,8 +458,6 @@ static int btree_key_cache_flush_pos(struct btree_trans *trans,
BTREE_ITER_ALL_SNAPSHOTS);
bch2_trans_iter_init(trans, &c_iter, key.btree_id, key.pos,
BTREE_ITER_CACHED|
BTREE_ITER_CACHED_NOFILL|
BTREE_ITER_CACHED_NOCREATE|
BTREE_ITER_INTENT);
b_iter.flags &= ~BTREE_ITER_WITH_KEY_CACHE;
......
......@@ -199,15 +199,13 @@ struct btree_node_iter {
#define BTREE_ITER_IS_EXTENTS (1 << 4)
#define BTREE_ITER_NOT_EXTENTS (1 << 5)
#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)
#define BTREE_ITER_ALL_SNAPSHOTS (1 << 13)
#define BTREE_ITER_FILTER_SNAPSHOTS (1 << 14)
#define BTREE_ITER_NOPRESERVE (1 << 15)
#define BTREE_ITER_WITH_KEY_CACHE (1 << 7)
#define BTREE_ITER_WITH_UPDATES (1 << 8)
#define BTREE_ITER_WITH_JOURNAL (1 << 9)
#define __BTREE_ITER_ALL_SNAPSHOTS (1 << 10)
#define BTREE_ITER_ALL_SNAPSHOTS (1 << 11)
#define BTREE_ITER_FILTER_SNAPSHOTS (1 << 12)
#define BTREE_ITER_NOPRESERVE (1 << 13)
enum btree_path_uptodate {
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