Skip to content

Commit

Permalink
AFS: Part of afs_end_call() is identical to code elsewhere, so split it
Browse files Browse the repository at this point in the history
Split afs_end_call() into two pieces, one of which is identical to code in
afs_process_async_call().  Replace the latter with a call to the first part of
afs_end_call().

Signed-off-by: Nathaniel Wesley Filardo <[email protected]>
Signed-off-by: David Howells <[email protected]>
  • Loading branch information
Nathaniel Wesley Filardo authored and dhowells committed May 23, 2014
1 parent 6c67c7c commit 6cf1286
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions fs/afs/rxrpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,24 @@ static void afs_free_call(struct afs_call *call)
}

/*
* End a call
* End a call but do not free it
*/
static void afs_end_call(struct afs_call *call)
static void afs_end_call_nofree(struct afs_call *call)
{
if (call->rxcall) {
rxrpc_kernel_end_call(call->rxcall);
call->rxcall = NULL;
}
call->type->destructor(call);
if (call->type->destructor)
call->type->destructor(call);
}

/*
* End a call and free it
*/
static void afs_end_call(struct afs_call *call)
{
afs_end_call_nofree(call);
afs_free_call(call);
}

Expand Down Expand Up @@ -640,10 +649,7 @@ static void afs_process_async_call(struct work_struct *work)
call->reply = NULL;

/* kill the call */
rxrpc_kernel_end_call(call->rxcall);
call->rxcall = NULL;
if (call->type->destructor)
call->type->destructor(call);
afs_end_call_nofree(call);

/* we can't just delete the call because the work item may be
* queued */
Expand Down

0 comments on commit 6cf1286

Please sign in to comment.