summaryrefslogtreecommitdiffstats
path: root/net/rxrpc/local_object.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2022-11-16 13:02:22 +0100
committerDavid Howells <dhowells@redhat.com>2022-12-01 14:36:43 +0100
commita2cf3264f331acfeb7e463ad7b7fe1ac647a829d (patch)
tree2e00c2c22398e267ad60ba643a405e50cdc58ae8 /net/rxrpc/local_object.c
parentrxrpc: Move the cwnd degradation after transmitting packets (diff)
downloadlinux-a2cf3264f331acfeb7e463ad7b7fe1ac647a829d.tar.xz
linux-a2cf3264f331acfeb7e463ad7b7fe1ac647a829d.zip
rxrpc: Fold __rxrpc_unuse_local() into rxrpc_unuse_local()
Fold __rxrpc_unuse_local() into rxrpc_unuse_local() as the latter is now the only user of the former. Signed-off-by: David Howells <dhowells@redhat.com> cc: Marc Dionne <marc.dionne@auristor.com> cc: linux-afs@lists.infradead.org
Diffstat (limited to 'net/rxrpc/local_object.c')
-rw-r--r--net/rxrpc/local_object.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/net/rxrpc/local_object.c b/net/rxrpc/local_object.c
index c73a5a1bc088..1e994a83db2b 100644
--- a/net/rxrpc/local_object.c
+++ b/net/rxrpc/local_object.c
@@ -359,8 +359,16 @@ struct rxrpc_local *rxrpc_use_local(struct rxrpc_local *local,
*/
void rxrpc_unuse_local(struct rxrpc_local *local, enum rxrpc_local_trace why)
{
- if (local && __rxrpc_unuse_local(local, why))
- kthread_stop(local->io_thread);
+ unsigned int debug_id = local->debug_id;
+ int r, u;
+
+ if (local) {
+ r = refcount_read(&local->ref);
+ u = atomic_dec_return(&local->active_users);
+ trace_rxrpc_local(debug_id, why, r, u);
+ if (u == 0)
+ kthread_stop(local->io_thread);
+ }
}
/*