diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2010-12-14 09:59:18 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-12-16 12:37:25 -0500 |
commit | 9f06c719f474be7003763284a990bed6377bb0d4 (patch) | |
tree | 409ebc3505f943bfdb933ab0acd76ffb5347b372 /fs/lockd/mon.c | |
parent | 1ac7c23e4af5e83525137661595000099f1ce94f (diff) |
SUNRPC: New xdr_streams XDR encoder API
Now that all client-side XDR encoder routines use xdr_streams, there
should be no need to support the legacy calling sequence [rpc_rqst *,
__be32 *, RPC arg *] anywhere. We can construct an xdr_stream in the
generic RPC code, instead of in each encoder function.
Also, all the client-side encoder functions return 0 now, making a
return value superfluous. Take this opportunity to convert them to
return void instead.
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.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c index d812818d0258..baa77bc9d825 100644 --- a/fs/lockd/mon.c +++ b/fs/lockd/mon.c | |||
@@ -459,25 +459,17 @@ static void encode_priv(struct xdr_stream *xdr, const struct nsm_args *argp) | |||
459 | xdr_encode_opaque_fixed(p, argp->priv->data, SM_PRIV_SIZE); | 459 | xdr_encode_opaque_fixed(p, argp->priv->data, SM_PRIV_SIZE); |
460 | } | 460 | } |
461 | 461 | ||
462 | static int xdr_enc_mon(struct rpc_rqst *req, __be32 *p, | 462 | static void nsm_xdr_enc_mon(struct rpc_rqst *req, struct xdr_stream *xdr, |
463 | const struct nsm_args *argp) | 463 | const struct nsm_args *argp) |
464 | { | 464 | { |
465 | struct xdr_stream xdr; | 465 | encode_mon_id(xdr, argp); |
466 | 466 | encode_priv(xdr, argp); | |
467 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
468 | encode_mon_id(&xdr, argp); | ||
469 | encode_priv(&xdr, argp); | ||
470 | return 0; | ||
471 | } | 467 | } |
472 | 468 | ||
473 | static int xdr_enc_unmon(struct rpc_rqst *req, __be32 *p, | 469 | static void nsm_xdr_enc_unmon(struct rpc_rqst *req, struct xdr_stream *xdr, |
474 | const struct nsm_args *argp) | 470 | const struct nsm_args *argp) |
475 | { | 471 | { |
476 | struct xdr_stream xdr; | 472 | encode_mon_id(xdr, argp); |
477 | |||
478 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
479 | encode_mon_id(&xdr, argp); | ||
480 | return 0; | ||
481 | } | 473 | } |
482 | 474 | ||
483 | static int xdr_dec_stat_res(struct rpc_rqst *rqstp, __be32 *p, | 475 | static int xdr_dec_stat_res(struct rpc_rqst *rqstp, __be32 *p, |
@@ -524,7 +516,7 @@ static int xdr_dec_stat(struct rpc_rqst *rqstp, __be32 *p, | |||
524 | static struct rpc_procinfo nsm_procedures[] = { | 516 | static struct rpc_procinfo nsm_procedures[] = { |
525 | [NSMPROC_MON] = { | 517 | [NSMPROC_MON] = { |
526 | .p_proc = NSMPROC_MON, | 518 | .p_proc = NSMPROC_MON, |
527 | .p_encode = (kxdrproc_t)xdr_enc_mon, | 519 | .p_encode = (kxdreproc_t)nsm_xdr_enc_mon, |
528 | .p_decode = (kxdrproc_t)xdr_dec_stat_res, | 520 | .p_decode = (kxdrproc_t)xdr_dec_stat_res, |
529 | .p_arglen = SM_mon_sz, | 521 | .p_arglen = SM_mon_sz, |
530 | .p_replen = SM_monres_sz, | 522 | .p_replen = SM_monres_sz, |
@@ -533,7 +525,7 @@ static struct rpc_procinfo nsm_procedures[] = { | |||
533 | }, | 525 | }, |
534 | [NSMPROC_UNMON] = { | 526 | [NSMPROC_UNMON] = { |
535 | .p_proc = NSMPROC_UNMON, | 527 | .p_proc = NSMPROC_UNMON, |
536 | .p_encode = (kxdrproc_t)xdr_enc_unmon, | 528 | .p_encode = (kxdreproc_t)nsm_xdr_enc_unmon, |
537 | .p_decode = (kxdrproc_t)xdr_dec_stat, | 529 | .p_decode = (kxdrproc_t)xdr_dec_stat, |
538 | .p_arglen = SM_mon_id_sz, | 530 | .p_arglen = SM_mon_id_sz, |
539 | .p_replen = SM_unmonres_sz, | 531 | .p_replen = SM_unmonres_sz, |