diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-08-27 12:28:09 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:39 -0400 |
commit | 8a9c1b1cb0edacdf4ac9c378c4ec4fc376fc8bac (patch) | |
tree | d1c29fc0686dbd1dd19f04240455c36e37747ef1 /fs/bcachefs/btree_locking.c | |
parent | ce56bf7fc23b6c2cf6edfbdfba1805c1842641ca (diff) | |
download | linux-stable-8a9c1b1cb0edacdf4ac9c378c4ec4fc376fc8bac.tar.gz linux-stable-8a9c1b1cb0edacdf4ac9c378c4ec4fc376fc8bac.tar.bz2 linux-stable-8a9c1b1cb0edacdf4ac9c378c4ec4fc376fc8bac.zip |
bcachefs: Improve bch2_btree_node_relock()
This moves the IS_ERR_OR_NULL() check to the inline part, since that's a
fast path event.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_locking.c')
-rw-r--r-- | fs/bcachefs/btree_locking.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/fs/bcachefs/btree_locking.c b/fs/bcachefs/btree_locking.c index 8376067280ea..76d99c694948 100644 --- a/fs/bcachefs/btree_locking.c +++ b/fs/bcachefs/btree_locking.c @@ -208,9 +208,6 @@ bool __bch2_btree_node_relock(struct btree_trans *trans, struct btree *b = btree_path_node(path, level); int want = __btree_lock_want(path, level); - if (!is_btree_node(path, level)) - goto fail; - if (race_fault()) goto fail; @@ -221,10 +218,7 @@ bool __bch2_btree_node_relock(struct btree_trans *trans, return true; } fail: - if (b != ERR_PTR(-BCH_ERR_no_btree_node_cached) && - b != ERR_PTR(-BCH_ERR_no_btree_node_init) && - b != ERR_PTR(-BCH_ERR_no_btree_node_up)) - trace_btree_node_relock_fail(trans, _RET_IP_, path, level); + trace_btree_node_relock_fail(trans, _RET_IP_, path, level); return false; } |