]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bcachefs: kill btree_trans_restart_nounlock()
authorKent Overstreet <kent.overstreet@linux.dev>
Tue, 24 Sep 2024 02:11:41 +0000 (22:11 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sat, 21 Dec 2024 06:36:14 +0000 (01:36 -0500)
Redundant, the normal btree_trans_restart() doesn't unlock.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_iter.h
fs/bcachefs/btree_trans_commit.c

index 0bda054f80d76c609aaeb37f7445b84d82d9dae7..24406f7232830596f9f80c39a35c940e6774dcb4 100644 (file)
@@ -341,21 +341,20 @@ static inline void bch2_trans_verify_not_unlocked(struct btree_trans *trans)
 }
 
 __always_inline
-static int btree_trans_restart_nounlock(struct btree_trans *trans, int err)
+static int btree_trans_restart_ip(struct btree_trans *trans, int err, unsigned long ip)
 {
        BUG_ON(err <= 0);
        BUG_ON(!bch2_err_matches(-err, BCH_ERR_transaction_restart));
 
        trans->restarted = err;
-       trans->last_restarted_ip = _THIS_IP_;
+       trans->last_restarted_ip = ip;
        return -err;
 }
 
 __always_inline
 static int btree_trans_restart(struct btree_trans *trans, int err)
 {
-       btree_trans_restart_nounlock(trans, err);
-       return -err;
+       return btree_trans_restart_ip(trans, err, _THIS_IP_);
 }
 
 bool bch2_btree_node_upgrade(struct btree_trans *,
index 3d951846a1bedff822b03d5e1732adb982388760..b47f11881fe4ae177000944ac85fca91550612df 100644 (file)
@@ -624,7 +624,7 @@ bch2_trans_commit_write_locked(struct btree_trans *trans, unsigned flags,
 
        if (race_fault()) {
                trace_and_count(c, trans_restart_fault_inject, trans, trace_ip);
-               return btree_trans_restart_nounlock(trans, BCH_ERR_transaction_restart_fault_inject);
+               return btree_trans_restart(trans, BCH_ERR_transaction_restart_fault_inject);
        }
 
        /*