summaryrefslogtreecommitdiffstats
path: root/fs/afs
diff options
context:
space:
mode:
authorNathaniel Wesley Filardo <nwf@cs.jhu.edu>2014-05-21 16:04:11 +0100
committerDavid Howells <dhowells@redhat.com>2014-05-23 13:05:15 +0100
commit6cf12869f5c1a837f18af5f8b2308fa243772735 (patch)
tree78985334dd74765c7adfdbc9a2ffcfde1f1f4711 /fs/afs
parent6c67c7c38cf32c2a9cbccb6b21aadf61a85fbfb4 (diff)
downloadop-kernel-dev-6cf12869f5c1a837f18af5f8b2308fa243772735.zip
op-kernel-dev-6cf12869f5c1a837f18af5f8b2308fa243772735.tar.gz
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/afs')
-rw-r--r--fs/afs/rxrpc.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c
index 9226a66..1a1110b 100644
--- a/fs/afs/rxrpc.c
+++ b/fs/afs/rxrpc.c
@@ -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);
}
@@ -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 */
OpenPOWER on IntegriCloud