summaryrefslogtreecommitdiff
path: root/fs/bcachefs/btree_key_cache.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-08-22 15:29:53 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:41 -0400
commit0d7009d7ca99ad9261a7cffcecd515108377a6ac (patch)
treeb3d1c36fee7697db2ce71b611dfab72ac1fa34a7 /fs/bcachefs/btree_key_cache.c
parent96d994b37cfcf468bf1d71527ae95ad93a311e38 (diff)
downloadlwn-0d7009d7ca99ad9261a7cffcecd515108377a6ac.tar.gz
lwn-0d7009d7ca99ad9261a7cffcecd515108377a6ac.zip
bcachefs: Delete old deadlock avoidance code
This deletes our old lock ordering based deadlock avoidance code. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/btree_key_cache.c')
-rw-r--r--fs/bcachefs/btree_key_cache.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/fs/bcachefs/btree_key_cache.c b/fs/bcachefs/btree_key_cache.c
index 977c523359a5..1a88d1d79699 100644
--- a/fs/bcachefs/btree_key_cache.c
+++ b/fs/bcachefs/btree_key_cache.c
@@ -398,17 +398,6 @@ err:
return ret;
}
-static int bkey_cached_check_fn(struct six_lock *lock, void *p)
-{
- struct bkey_cached *ck = container_of(lock, struct bkey_cached, c.lock);
- const struct btree_path *path = p;
-
- if (ck->key.btree_id != path->btree_id &&
- bpos_cmp(ck->key.pos, path->pos))
- return BCH_ERR_lock_fail_node_reused;
- return 0;
-}
-
__flatten
int bch2_btree_path_traverse_cached(struct btree_trans *trans, struct btree_path *path,
unsigned flags)
@@ -440,16 +429,12 @@ retry:
} else {
enum six_lock_type lock_want = __btree_lock_want(path, 0);
- ret = btree_node_lock(trans, path, (void *) ck, path->pos, 0,
- lock_want,
- bkey_cached_check_fn, path, _THIS_IP_);
- if (ret) {
- if (bch2_err_matches(ret, BCH_ERR_lock_fail_node_reused))
- goto retry;
- if (bch2_err_matches(ret, BCH_ERR_transaction_restart))
- goto err;
- BUG();
- }
+ ret = btree_node_lock(trans, path, (void *) ck, 0,
+ lock_want, _THIS_IP_);
+ if (bch2_err_matches(ret, BCH_ERR_transaction_restart))
+ goto err;
+
+ BUG_ON(ret);
if (ck->key.btree_id != path->btree_id ||
bpos_cmp(ck->key.pos, path->pos)) {