Skip to content

Commit

Permalink
afs: Provide a function to get a ref on a call
Browse files Browse the repository at this point in the history
Provide a function to get a reference on an afs_call struct.

Signed-off-by: David Howells <[email protected]>
  • Loading branch information
dhowells committed Jan 17, 2019
1 parent 59d4907 commit 7a75b00
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions fs/afs/rxrpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,20 +203,26 @@ void afs_put_call(struct afs_call *call)
}
}

static struct afs_call *afs_get_call(struct afs_call *call,
enum afs_call_trace why)
{
int u = atomic_inc_return(&call->usage);

trace_afs_call(call, why, u,
atomic_read(&call->net->nr_outstanding_calls),
__builtin_return_address(0));
return call;
}

/*
* Queue the call for actual work.
*/
static void afs_queue_call_work(struct afs_call *call)
{
if (call->type->work) {
int u = atomic_inc_return(&call->usage);

trace_afs_call(call, afs_call_trace_work, u,
atomic_read(&call->net->nr_outstanding_calls),
__builtin_return_address(0));

INIT_WORK(&call->work, call->type->work);

afs_get_call(call, afs_call_trace_work);
if (!queue_work(afs_wq, &call->work))
afs_put_call(call);
}
Expand Down

0 comments on commit 7a75b00

Please sign in to comment.