aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/mon.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2010-12-14 09:59:29 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2010-12-16 12:37:25 -0500
commitbf2695516db982e90a22fc94f93491b481796bb1 (patch)
tree367bf134ef892bfc3fcd2c4fe676b14102d97467 /fs/lockd/mon.c
parent9f06c719f474be7003763284a990bed6377bb0d4 (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/mon.c')
-rw-r--r--fs/lockd/mon.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c
index baa77bc9d825..23d7451b2938 100644
--- a/fs/lockd/mon.c
+++ b/fs/lockd/mon.c
@@ -472,35 +472,35 @@ static void nsm_xdr_enc_unmon(struct rpc_rqst *req, struct xdr_stream *xdr,
472 encode_mon_id(xdr, argp); 472 encode_mon_id(xdr, argp);
473} 473}
474 474
475static int xdr_dec_stat_res(struct rpc_rqst *rqstp, __be32 *p, 475static int nsm_xdr_dec_stat_res(struct rpc_rqst *rqstp,
476 struct nsm_res *resp) 476 struct xdr_stream *xdr,
477 struct nsm_res *resp)
477{ 478{
478 struct xdr_stream xdr; 479 __be32 *p;
479 480
480 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 481 p = xdr_inline_decode(xdr, 4 + 4);
481 p = xdr_inline_decode(&xdr, 4 + 4);
482 if (unlikely(p == NULL)) 482 if (unlikely(p == NULL))
483 return -EIO; 483 return -EIO;
484 resp->status = be32_to_cpup(p++); 484 resp->status = be32_to_cpup(p++);
485 resp->state = be32_to_cpup(p); 485 resp->state = be32_to_cpup(p);
486 486
487 dprintk("lockd: xdr_dec_stat_res status %d state %d\n", 487 dprintk("lockd: %s status %d state %d\n",
488 resp->status, resp->state); 488 __func__, resp->status, resp->state);
489 return 0; 489 return 0;
490} 490}
491 491
492static int xdr_dec_stat(struct rpc_rqst *rqstp, __be32 *p, 492static int nsm_xdr_dec_stat(struct rpc_rqst *rqstp,
493 struct nsm_res *resp) 493 struct xdr_stream *xdr,
494 struct nsm_res *resp)
494{ 495{
495 struct xdr_stream xdr; 496 __be32 *p;
496 497
497 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 498 p = xdr_inline_decode(xdr, 4);
498 p = xdr_inline_decode(&xdr, 4);
499 if (unlikely(p == NULL)) 499 if (unlikely(p == NULL))
500 return -EIO; 500 return -EIO;
501 resp->state = be32_to_cpup(p); 501 resp->state = be32_to_cpup(p);
502 502
503 dprintk("lockd: xdr_dec_stat state %d\n", resp->state); 503 dprintk("lockd: %s state %d\n", __func__, resp->state);
504 return 0; 504 return 0;
505} 505}
506 506
@@ -517,7 +517,7 @@ static struct rpc_procinfo nsm_procedures[] = {
517[NSMPROC_MON] = { 517[NSMPROC_MON] = {
518 .p_proc = NSMPROC_MON, 518 .p_proc = NSMPROC_MON,
519 .p_encode = (kxdreproc_t)nsm_xdr_enc_mon, 519 .p_encode = (kxdreproc_t)nsm_xdr_enc_mon,
520 .p_decode = (kxdrproc_t)xdr_dec_stat_res, 520 .p_decode = (kxdrdproc_t)nsm_xdr_dec_stat_res,
521 .p_arglen = SM_mon_sz, 521 .p_arglen = SM_mon_sz,
522 .p_replen = SM_monres_sz, 522 .p_replen = SM_monres_sz,
523 .p_statidx = NSMPROC_MON, 523 .p_statidx = NSMPROC_MON,
@@ -526,7 +526,7 @@ static struct rpc_procinfo nsm_procedures[] = {
526[NSMPROC_UNMON] = { 526[NSMPROC_UNMON] = {
527 .p_proc = NSMPROC_UNMON, 527 .p_proc = NSMPROC_UNMON,
528 .p_encode = (kxdreproc_t)nsm_xdr_enc_unmon, 528 .p_encode = (kxdreproc_t)nsm_xdr_enc_unmon,
529 .p_decode = (kxdrproc_t)xdr_dec_stat, 529 .p_decode = (kxdrdproc_t)nsm_xdr_dec_stat,
530 .p_arglen = SM_mon_id_sz, 530 .p_arglen = SM_mon_id_sz,
531 .p_replen = SM_unmonres_sz, 531 .p_replen = SM_unmonres_sz,
532 .p_statidx = NSMPROC_UNMON, 532 .p_statidx = NSMPROC_UNMON,