diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2010-12-14 09:59:29 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-12-16 12:37:25 -0500 |
commit | bf2695516db982e90a22fc94f93491b481796bb1 (patch) | |
tree | 367bf134ef892bfc3fcd2c4fe676b14102d97467 /fs/lockd/clnt4xdr.c | |
parent | 9f06c719f474be7003763284a990bed6377bb0d4 (diff) |
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.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/fs/lockd/clnt4xdr.c b/fs/lockd/clnt4xdr.c index 974f1d9cd323..f848b52c67b1 100644 --- a/fs/lockd/clnt4xdr.c +++ b/fs/lockd/clnt4xdr.c | |||
@@ -529,17 +529,16 @@ out: | |||
529 | return error; | 529 | return error; |
530 | } | 530 | } |
531 | 531 | ||
532 | static int nlm4_xdr_dec_testres(struct rpc_rqst *req, __be32 *p, | 532 | static int nlm4_xdr_dec_testres(struct rpc_rqst *req, |
533 | struct xdr_stream *xdr, | ||
533 | struct nlm_res *result) | 534 | struct nlm_res *result) |
534 | { | 535 | { |
535 | struct xdr_stream xdr; | ||
536 | int error; | 536 | int error; |
537 | 537 | ||
538 | xdr_init_decode(&xdr, &req->rq_rcv_buf, p); | 538 | error = decode_cookie(xdr, &result->cookie); |
539 | error = decode_cookie(&xdr, &result->cookie); | ||
540 | if (unlikely(error)) | 539 | if (unlikely(error)) |
541 | goto out; | 540 | goto out; |
542 | error = decode_nlm4_testrply(&xdr, result); | 541 | error = decode_nlm4_testrply(xdr, result); |
543 | out: | 542 | out: |
544 | return error; | 543 | return error; |
545 | } | 544 | } |
@@ -550,17 +549,16 @@ out: | |||
550 | * nlm4_stat stat; | 549 | * nlm4_stat stat; |
551 | * }; | 550 | * }; |
552 | */ | 551 | */ |
553 | static int nlm4_xdr_dec_res(struct rpc_rqst *req, __be32 *p, | 552 | static int nlm4_xdr_dec_res(struct rpc_rqst *req, |
553 | struct xdr_stream *xdr, | ||
554 | struct nlm_res *result) | 554 | struct nlm_res *result) |
555 | { | 555 | { |
556 | struct xdr_stream xdr; | ||
557 | int error; | 556 | int error; |
558 | 557 | ||
559 | xdr_init_decode(&xdr, &req->rq_rcv_buf, p); | 558 | error = decode_cookie(xdr, &result->cookie); |
560 | error = decode_cookie(&xdr, &result->cookie); | ||
561 | if (unlikely(error)) | 559 | if (unlikely(error)) |
562 | goto out; | 560 | goto out; |
563 | error = decode_nlm4_stat(&xdr, &result->status); | 561 | error = decode_nlm4_stat(xdr, &result->status); |
564 | out: | 562 | out: |
565 | return error; | 563 | return error; |
566 | } | 564 | } |
@@ -575,7 +573,7 @@ out: | |||
575 | [NLMPROC_##proc] = { \ | 573 | [NLMPROC_##proc] = { \ |
576 | .p_proc = NLMPROC_##proc, \ | 574 | .p_proc = NLMPROC_##proc, \ |
577 | .p_encode = (kxdreproc_t)nlm4_xdr_enc_##argtype, \ | 575 | .p_encode = (kxdreproc_t)nlm4_xdr_enc_##argtype, \ |
578 | .p_decode = (kxdrproc_t)nlm4_xdr_dec_##restype, \ | 576 | .p_decode = (kxdrdproc_t)nlm4_xdr_dec_##restype, \ |
579 | .p_arglen = NLM4_##argtype##_sz, \ | 577 | .p_arglen = NLM4_##argtype##_sz, \ |
580 | .p_replen = NLM4_##restype##_sz, \ | 578 | .p_replen = NLM4_##restype##_sz, \ |
581 | .p_statidx = NLMPROC_##proc, \ | 579 | .p_statidx = NLMPROC_##proc, \ |