Skip to content

Commit 7a75b00

Browse files
committed
afs: Provide a function to get a ref on a call
Provide a function to get a reference on an afs_call struct. Signed-off-by: David Howells <dhowells@redhat.com>
1 parent 59d4907 commit 7a75b00

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

fs/afs/rxrpc.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,20 +203,26 @@ void afs_put_call(struct afs_call *call)
203203
}
204204
}
205205

206+
static struct afs_call *afs_get_call(struct afs_call *call,
207+
enum afs_call_trace why)
208+
{
209+
int u = atomic_inc_return(&call->usage);
210+
211+
trace_afs_call(call, why, u,
212+
atomic_read(&call->net->nr_outstanding_calls),
213+
__builtin_return_address(0));
214+
return call;
215+
}
216+
206217
/*
207218
* Queue the call for actual work.
208219
*/
209220
static void afs_queue_call_work(struct afs_call *call)
210221
{
211222
if (call->type->work) {
212-
int u = atomic_inc_return(&call->usage);
213-
214-
trace_afs_call(call, afs_call_trace_work, u,
215-
atomic_read(&call->net->nr_outstanding_calls),
216-
__builtin_return_address(0));
217-
218223
INIT_WORK(&call->work, call->type->work);
219224

225+
afs_get_call(call, afs_call_trace_work);
220226
if (!queue_work(afs_wq, &call->work))
221227
afs_put_call(call);
222228
}

0 commit comments

Comments
 (0)