summaryrefslogtreecommitdiff
path: root/fs/bcachefs/btree_update_leaf.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-07-27 22:28:39 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:10 -0400
commit9cba7bf7c7edc6ae6579945588964b3b90e33258 (patch)
tree09200e87949b809bdc5041efbef515b4a867b632 /fs/bcachefs/btree_update_leaf.c
parent0d32711ef65511ff52b5c42e5618a6e83b406cad (diff)
downloadlwn-9cba7bf7c7edc6ae6579945588964b3b90e33258.tar.gz
lwn-9cba7bf7c7edc6ae6579945588964b3b90e33258.zip
bcachefs: Don't drop read locks at transaction commit time
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/btree_update_leaf.c')
-rw-r--r--fs/bcachefs/btree_update_leaf.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/fs/bcachefs/btree_update_leaf.c b/fs/bcachefs/btree_update_leaf.c
index 882b9da8fe61..20275be97256 100644
--- a/fs/bcachefs/btree_update_leaf.c
+++ b/fs/bcachefs/btree_update_leaf.c
@@ -348,11 +348,6 @@ static inline void do_btree_insert_one(struct btree_trans *trans,
}
}
-static noinline void bch2_btree_iter_unlock_noinline(struct btree_iter *iter)
-{
- __bch2_btree_iter_unlock(iter);
-}
-
static noinline void bch2_trans_mark_gc(struct btree_trans *trans)
{
struct bch_fs *c = trans->c;
@@ -582,21 +577,15 @@ static inline int do_bch2_trans_commit(struct btree_trans *trans,
* or anything else that might call bch2_trans_relock(), since that
* would just retake the read locks:
*/
- trans_for_each_iter(trans, iter) {
- if (iter->nodes_locked != iter->nodes_intent_locked) {
- if (btree_iter_keep(trans, iter)) {
- if (!bch2_btree_iter_upgrade(iter, 1)) {
- trace_trans_restart_upgrade(trans->ip, trace_ip,
- iter->btree_id,
- &iter->real_pos);
- trans->restarted = true;
- return -EINTR;
- }
- } else {
- bch2_btree_iter_unlock_noinline(iter);
- }
+ trans_for_each_iter(trans, iter)
+ if (iter->nodes_locked != iter->nodes_intent_locked &&
+ !bch2_btree_iter_upgrade(iter, 1)) {
+ trace_trans_restart_upgrade(trans->ip, trace_ip,
+ iter->btree_id,
+ &iter->real_pos);
+ trans->restarted = true;
+ return -EINTR;
}
- }
trans_for_each_update(trans, i) {
const char *invalid = bch2_bkey_invalid(c,