summaryrefslogtreecommitdiffstats
path: root/fs/lockd/clnt4xdr.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2010-12-14 14:59:29 +0000
committerTrond Myklebust <Trond.Myklebust@netapp.com>2010-12-16 12:37:25 -0500
commitbf2695516db982e90a22fc94f93491b481796bb1 (patch)
tree367bf134ef892bfc3fcd2c4fe676b14102d97467 /fs/lockd/clnt4xdr.c
parent9f06c719f474be7003763284a990bed6377bb0d4 (diff)
downloadop-kernel-dev-bf2695516db982e90a22fc94f93491b481796bb1.zip
op-kernel-dev-bf2695516db982e90a22fc94f93491b481796bb1.tar.gz
SUNRPC: New xdr_streams XDR decoder API
Now that all client-side XDR decoder routines use xdr_streams, there should be no need to support the legacy calling sequence [rpc_rqst *, __be32 *, RPC res *] anywhere. We can construct an xdr_stream in the generic RPC code, instead of in each decoder function. This is a refactoring change. It should not cause different behavior. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Tested-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/lockd/clnt4xdr.c')
-rw-r--r--fs/lockd/clnt4xdr.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/fs/lockd/clnt4xdr.c b/fs/lockd/clnt4xdr.c
index 974f1d9..f848b52 100644
--- a/fs/lockd/clnt4xdr.c
+++ b/fs/lockd/clnt4xdr.c
@@ -529,17 +529,16 @@ out:
return error;
}
-static int nlm4_xdr_dec_testres(struct rpc_rqst *req, __be32 *p,
+static int nlm4_xdr_dec_testres(struct rpc_rqst *req,
+ struct xdr_stream *xdr,
struct nlm_res *result)
{
- struct xdr_stream xdr;
int error;
- xdr_init_decode(&xdr, &req->rq_rcv_buf, p);
- error = decode_cookie(&xdr, &result->cookie);
+ error = decode_cookie(xdr, &result->cookie);
if (unlikely(error))
goto out;
- error = decode_nlm4_testrply(&xdr, result);
+ error = decode_nlm4_testrply(xdr, result);
out:
return error;
}
@@ -550,17 +549,16 @@ out:
* nlm4_stat stat;
* };
*/
-static int nlm4_xdr_dec_res(struct rpc_rqst *req, __be32 *p,
+static int nlm4_xdr_dec_res(struct rpc_rqst *req,
+ struct xdr_stream *xdr,
struct nlm_res *result)
{
- struct xdr_stream xdr;
int error;
- xdr_init_decode(&xdr, &req->rq_rcv_buf, p);
- error = decode_cookie(&xdr, &result->cookie);
+ error = decode_cookie(xdr, &result->cookie);
if (unlikely(error))
goto out;
- error = decode_nlm4_stat(&xdr, &result->status);
+ error = decode_nlm4_stat(xdr, &result->status);
out:
return error;
}
@@ -575,7 +573,7 @@ out:
[NLMPROC_##proc] = { \
.p_proc = NLMPROC_##proc, \
.p_encode = (kxdreproc_t)nlm4_xdr_enc_##argtype, \
- .p_decode = (kxdrproc_t)nlm4_xdr_dec_##restype, \
+ .p_decode = (kxdrdproc_t)nlm4_xdr_dec_##restype, \
.p_arglen = NLM4_##argtype##_sz, \
.p_replen = NLM4_##restype##_sz, \
.p_statidx = NLMPROC_##proc, \
OpenPOWER on IntegriCloud