Skip to content

Commit

Permalink
rxrpc: Fold __rxrpc_unuse_local() into rxrpc_unuse_local()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
David Howells committed Dec 1, 2022
1 parent 5086d9a commit a2cf326
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
12 changes: 0 additions & 12 deletions net/rxrpc/ar-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1002,18 +1002,6 @@ void rxrpc_unuse_local(struct rxrpc_local *, enum rxrpc_local_trace);
void rxrpc_destroy_local(struct rxrpc_local *local);
void rxrpc_destroy_all_locals(struct rxrpc_net *);

static inline bool __rxrpc_unuse_local(struct rxrpc_local *local,
enum rxrpc_local_trace why)
{
unsigned int debug_id = local->debug_id;
int r, u;

r = refcount_read(&local->ref);
u = atomic_dec_return(&local->active_users);
trace_rxrpc_local(debug_id, why, r, u);
return u == 0;
}

static inline bool __rxrpc_use_local(struct rxrpc_local *local,
enum rxrpc_local_trace why)
{
Expand Down
12 changes: 10 additions & 2 deletions net/rxrpc/local_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

/*
Expand Down

0 comments on commit a2cf326

Please sign in to comment.