diff options
author | Nathaniel Wesley Filardo <nwf@cs.jhu.edu> | 2014-05-21 11:04:11 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2014-05-23 08:05:15 -0400 |
commit | 6cf12869f5c1a837f18af5f8b2308fa243772735 (patch) | |
tree | 78985334dd74765c7adfdbc9a2ffcfde1f1f4711 /fs | |
parent | 6c67c7c38cf32c2a9cbccb6b21aadf61a85fbfb4 (diff) |
AFS: Part of afs_end_call() is identical to code elsewhere, so split it
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 <nwf@cs.jhu.edu>
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/afs/rxrpc.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c index 9226a6674d7f..1a1110b1a7ff 100644 --- a/fs/afs/rxrpc.c +++ b/fs/afs/rxrpc.c | |||
@@ -184,15 +184,24 @@ static void afs_free_call(struct afs_call *call) | |||
184 | } | 184 | } |
185 | 185 | ||
186 | /* | 186 | /* |
187 | * End a call | 187 | * End a call but do not free it |
188 | */ | 188 | */ |
189 | static void afs_end_call(struct afs_call *call) | 189 | static void afs_end_call_nofree(struct afs_call *call) |
190 | { | 190 | { |
191 | if (call->rxcall) { | 191 | if (call->rxcall) { |
192 | rxrpc_kernel_end_call(call->rxcall); | 192 | rxrpc_kernel_end_call(call->rxcall); |
193 | call->rxcall = NULL; | 193 | call->rxcall = NULL; |
194 | } | 194 | } |
195 | call->type->destructor(call); | 195 | if (call->type->destructor) |
196 | call->type->destructor(call); | ||
197 | } | ||
198 | |||
199 | /* | ||
200 | * End a call and free it | ||
201 | */ | ||
202 | static void afs_end_call(struct afs_call *call) | ||
203 | { | ||
204 | afs_end_call_nofree(call); | ||
196 | afs_free_call(call); | 205 | afs_free_call(call); |
197 | } | 206 | } |
198 | 207 | ||
@@ -640,10 +649,7 @@ static void afs_process_async_call(struct work_struct *work) | |||
640 | call->reply = NULL; | 649 | call->reply = NULL; |
641 | 650 | ||
642 | /* kill the call */ | 651 | /* kill the call */ |
643 | rxrpc_kernel_end_call(call->rxcall); | 652 | afs_end_call_nofree(call); |
644 | call->rxcall = NULL; | ||
645 | if (call->type->destructor) | ||
646 | call->type->destructor(call); | ||
647 | 653 | ||
648 | /* we can't just delete the call because the work item may be | 654 | /* we can't just delete the call because the work item may be |
649 | * queued */ | 655 | * queued */ |