diff mbox series

[net-next,22/26] rxrpc: Remove call->lock

Message ID 166794601410.2389296.15345861353801742959.stgit@warthog.procyon.org.uk (mailing list archive)
State Accepted
Commit 4e76bd406d6e9208ea558953862a47524829688c
Delegated to: Netdev Maintainers
Headers show
Series rxrpc: Increasing SACK size and moving away from softirq, part 1 | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next, async
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count fail Series longer than 15 patches (and no cover letter)
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 7 this patch: 7
netdev/cc_maintainers warning 5 maintainers not CCed: pabeni@redhat.com davem@davemloft.net edumazet@google.com kuba@kernel.org marc.dionne@auristor.com
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 6 this patch: 6
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 100 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

David Howells Nov. 8, 2022, 10:20 p.m. UTC
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 |    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(-)
diff mbox series

Patch

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;