From be879c4e249a8875d7129f3b0c1bb62584dafbd8 Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields" Date: Wed, 11 Jul 2007 18:39:02 -0400 Subject: SUNRPC: move bkl locking and xdr proc invocation into a common helper Since every invocation of xdr encode or decode functions takes the BKL now, there's a lot of redundant lock_kernel/unlock_kernel pairs that we can pull out into a common function. Signed-off-by: J. Bruce Fields Signed-off-by: Trond Myklebust --- net/sunrpc/auth.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'net/sunrpc/auth.c') diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index 29a8ecc6092..1ea27559b1d 100644 --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c @@ -13,7 +13,6 @@ #include #include #include -#include #ifdef RPC_DEBUG # define RPCDBG_FACILITY RPCDBG_AUTH @@ -476,17 +475,13 @@ rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp, __be32 *data, void *obj) { struct rpc_cred *cred = task->tk_msg.rpc_cred; - int ret; dprintk("RPC: %5u using %s cred %p to wrap rpc data\n", task->tk_pid, cred->cr_ops->cr_name, cred); if (cred->cr_ops->crwrap_req) return cred->cr_ops->crwrap_req(task, encode, rqstp, data, obj); /* By default, we encode the arguments normally. */ - lock_kernel(); - ret = encode(rqstp, data, obj); - unlock_kernel(); - return ret; + return rpc_call_xdrproc(encode, rqstp, data, obj); } int @@ -494,7 +489,6 @@ rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp, __be32 *data, void *obj) { struct rpc_cred *cred = task->tk_msg.rpc_cred; - int ret; dprintk("RPC: %5u using %s cred %p to unwrap rpc data\n", task->tk_pid, cred->cr_ops->cr_name, cred); @@ -502,10 +496,7 @@ rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp, return cred->cr_ops->crunwrap_resp(task, decode, rqstp, data, obj); /* By default, we decode the arguments normally. */ - lock_kernel(); - ret = decode(rqstp, data, obj); - unlock_kernel(); - return ret; + return rpc_call_xdrproc(decode, rqstp, data, obj); } int -- cgit v1.2.3