rxrpc: Remove call->lock
authorDavid Howells <dhowells@redhat.com>
Fri, 6 May 2022 15:13:13 +0000 (16:13 +0100)
committerDavid Howells <dhowells@redhat.com>
Tue, 8 Nov 2022 16:42:28 +0000 (16:42 +0000)
call->lock is no longer necessary, so remove it.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org

net/rxrpc/ar-internal.h
net/rxrpc/call_event.c
net/rxrpc/call_object.c
net/rxrpc/input.c
net/rxrpc/output.c

index d7aebe8..5ec30e8 100644 (file)
@@ -601,7 +601,6 @@ struct rxrpc_call {
        unsigned long           user_call_ID;   /* user-defined call ID */
        unsigned long           flags;
        unsigned long           events;
-       spinlock_t              lock;
        spinlock_t              notify_lock;    /* Kernel notification lock */
        rwlock_t                state_lock;     /* lock for state transition */
        u32                     abort_code;     /* Local/remote abort code */
index 3c37b28..dbfaf81 100644 (file)
@@ -26,24 +26,19 @@ void rxrpc_propose_ping(struct rxrpc_call *call, u32 serial,
        unsigned long now = jiffies;
        unsigned long ping_at = now + rxrpc_idle_ack_delay;
 
-       spin_lock_bh(&call->lock);
-
        if (time_before(ping_at, call->ping_at)) {
                WRITE_ONCE(call->ping_at, ping_at);
                rxrpc_reduce_call_timer(call, ping_at, now,
                                        rxrpc_timer_set_for_ping);
                trace_rxrpc_propose_ack(call, why, RXRPC_ACK_PING, serial);
        }
-
-       spin_unlock_bh(&call->lock);
 }
 
 /*
  * Propose a DELAY ACK be sent in the future.
  */
-static void __rxrpc_propose_delay_ACK(struct rxrpc_call *call,
-                                     rxrpc_serial_t serial,
-                                     enum rxrpc_propose_ack_trace why)
+void rxrpc_propose_delay_ACK(struct rxrpc_call *call, rxrpc_serial_t serial,
+                            enum rxrpc_propose_ack_trace why)
 {
        unsigned long expiry = rxrpc_soft_ack_delay;
        unsigned long now = jiffies, ack_at;
@@ -69,17 +64,6 @@ static void __rxrpc_propose_delay_ACK(struct rxrpc_call *call,
 }
 
 /*
- * Propose a DELAY ACK be sent, locking the call structure
- */
-void rxrpc_propose_delay_ACK(struct rxrpc_call *call, rxrpc_serial_t  serial,
-                            enum rxrpc_propose_ack_trace why)
-{
-       spin_lock_bh(&call->lock);
-       __rxrpc_propose_delay_ACK(call, serial, why);
-       spin_unlock_bh(&call->lock);
-}
-
-/*
  * Queue an ACK for immediate transmission.
  */
 void rxrpc_send_ACK(struct rxrpc_call *call, u8 ack_reason,
@@ -204,10 +188,8 @@ static void rxrpc_resend(struct rxrpc_call *call, unsigned long now_j)
         * retransmitting data.
         */
        if (list_empty(&retrans_queue)) {
-               spin_lock_bh(&call->lock);
                rxrpc_reduce_call_timer(call, resend_at, now_j,
                                        rxrpc_timer_set_for_resend);
-               spin_unlock_bh(&call->lock);
                ack_ts = ktime_sub(now, call->acks_latest_ts);
                if (ktime_to_us(ack_ts) < (call->peer->srtt_us >> 3))
                        goto out;
index ed5f6f0..a3ae2ab 100644 (file)
@@ -159,7 +159,6 @@ struct rxrpc_call *rxrpc_alloc_call(struct rxrpc_sock *rx, gfp_t gfp,
        skb_queue_head_init(&call->recvmsg_queue);
        skb_queue_head_init(&call->rx_oos_queue);
        init_waitqueue_head(&call->waitq);
-       spin_lock_init(&call->lock);
        spin_lock_init(&call->notify_lock);
        spin_lock_init(&call->tx_lock);
        spin_lock_init(&call->input_lock);
@@ -543,10 +542,8 @@ void rxrpc_release_call(struct rxrpc_sock *rx, struct rxrpc_call *call)
 
        ASSERTCMP(call->state, ==, RXRPC_CALL_COMPLETE);
 
-       spin_lock_bh(&call->lock);
        if (test_and_set_bit(RXRPC_CALL_RELEASED, &call->flags))
                BUG();
-       spin_unlock_bh(&call->lock);
 
        rxrpc_put_call_slot(call);
        rxrpc_delete_call_timer(call);
index b1f7deb..e6e1267 100644 (file)
@@ -279,9 +279,6 @@ static bool rxrpc_receiving_reply(struct rxrpc_call *call)
        rxrpc_seq_t top = READ_ONCE(call->tx_top);
 
        if (call->ackr_reason) {
-               spin_lock_bh(&call->lock);
-               call->ackr_reason = 0;
-               spin_unlock_bh(&call->lock);
                now = jiffies;
                timo = now + MAX_JIFFY_OFFSET;
                WRITE_ONCE(call->resend_at, timo);
index e2f501c..2c3f7e4 100644 (file)
@@ -229,13 +229,9 @@ static int rxrpc_send_ack_packet(struct rxrpc_local *local, struct rxrpc_txbuf *
        if (txb->ack.reason == RXRPC_ACK_IDLE)
                clear_bit(RXRPC_CALL_IDLE_ACK_PENDING, &call->flags);
 
-       spin_lock_bh(&call->lock);
        n = rxrpc_fill_out_ack(conn, call, txb);
-       spin_unlock_bh(&call->lock);
-       if (n == 0) {
-               kfree(pkt);
+       if (n == 0)
                return 0;
-       }
 
        iov[0].iov_base = &txb->wire;
        iov[0].iov_len  = sizeof(txb->wire) + sizeof(txb->ack) + n;