From 4e76bd406d6e9208ea558953862a47524829688c Mon Sep 17 00:00:00 2001 From: David Howells Date: Fri, 6 May 2022 16:13:13 +0100 Subject: rxrpc: Remove call->lock call->lock is no longer necessary, so remove it. Signed-off-by: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org --- net/rxrpc/ar-internal.h | 1 - net/rxrpc/call_event.c | 22 ++-------------------- net/rxrpc/call_object.c | 3 --- net/rxrpc/input.c | 3 --- net/rxrpc/output.c | 6 +----- 5 files changed, 3 insertions(+), 32 deletions(-) (limited to 'net/rxrpc') diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h index d7aebe82e17c..5ec30e84360b 100644 --- a/net/rxrpc/ar-internal.h +++ b/net/rxrpc/ar-internal.h @@ -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 */ diff --git a/net/rxrpc/call_event.c b/net/rxrpc/call_event.c index 3c37b280eb20..dbfaf8170929 100644 --- a/net/rxrpc/call_event.c +++ b/net/rxrpc/call_event.c @@ -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; @@ -68,17 +63,6 @@ static void __rxrpc_propose_delay_ACK(struct rxrpc_call *call, trace_rxrpc_propose_ack(call, why, RXRPC_ACK_DELAY, serial); } -/* - * 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. */ @@ -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; diff --git a/net/rxrpc/call_object.c b/net/rxrpc/call_object.c index ed5f6f0e4286..a3ae2ab45f9e 100644 --- a/net/rxrpc/call_object.c +++ b/net/rxrpc/call_object.c @@ -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); diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c index b1f7debd4f3e..e6e1267915de 100644 --- a/net/rxrpc/input.c +++ b/net/rxrpc/input.c @@ -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); diff --git a/net/rxrpc/output.c b/net/rxrpc/output.c index e2f501cef040..2c3f7e4e30d7 100644 --- a/net/rxrpc/output.c +++ b/net/rxrpc/output.c @@ -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; -- cgit v1.2.3