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/nfs/mount_clnt.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/nfs/mount_clnt.c')
-rw-r--r-- | fs/nfs/mount_clnt.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/fs/nfs/mount_clnt.c b/fs/nfs/mount_clnt.c index 97c3ec793305..979ebd7af3cb 100644 --- a/fs/nfs/mount_clnt.c +++ b/fs/nfs/mount_clnt.c | |||
@@ -288,14 +288,10 @@ static void encode_mntdirpath(struct xdr_stream *xdr, const char *pathname) | |||
288 | xdr_encode_opaque(p, pathname, pathname_len); | 288 | xdr_encode_opaque(p, pathname, pathname_len); |
289 | } | 289 | } |
290 | 290 | ||
291 | static int mnt_enc_dirpath(struct rpc_rqst *req, __be32 *p, | 291 | static void mnt_xdr_enc_dirpath(struct rpc_rqst *req, struct xdr_stream *xdr, |
292 | const char *dirpath) | 292 | const char *dirpath) |
293 | { | 293 | { |
294 | struct xdr_stream xdr; | 294 | encode_mntdirpath(xdr, dirpath); |
295 | |||
296 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
297 | encode_mntdirpath(&xdr, dirpath); | ||
298 | return 0; | ||
299 | } | 295 | } |
300 | 296 | ||
301 | /* | 297 | /* |
@@ -460,7 +456,7 @@ static int mnt_dec_mountres3(struct rpc_rqst *req, __be32 *p, | |||
460 | static struct rpc_procinfo mnt_procedures[] = { | 456 | static struct rpc_procinfo mnt_procedures[] = { |
461 | [MOUNTPROC_MNT] = { | 457 | [MOUNTPROC_MNT] = { |
462 | .p_proc = MOUNTPROC_MNT, | 458 | .p_proc = MOUNTPROC_MNT, |
463 | .p_encode = (kxdrproc_t)mnt_enc_dirpath, | 459 | .p_encode = (kxdreproc_t)mnt_xdr_enc_dirpath, |
464 | .p_decode = (kxdrproc_t)mnt_dec_mountres, | 460 | .p_decode = (kxdrproc_t)mnt_dec_mountres, |
465 | .p_arglen = MNT_enc_dirpath_sz, | 461 | .p_arglen = MNT_enc_dirpath_sz, |
466 | .p_replen = MNT_dec_mountres_sz, | 462 | .p_replen = MNT_dec_mountres_sz, |
@@ -469,7 +465,7 @@ static struct rpc_procinfo mnt_procedures[] = { | |||
469 | }, | 465 | }, |
470 | [MOUNTPROC_UMNT] = { | 466 | [MOUNTPROC_UMNT] = { |
471 | .p_proc = MOUNTPROC_UMNT, | 467 | .p_proc = MOUNTPROC_UMNT, |
472 | .p_encode = (kxdrproc_t)mnt_enc_dirpath, | 468 | .p_encode = (kxdreproc_t)mnt_xdr_enc_dirpath, |
473 | .p_arglen = MNT_enc_dirpath_sz, | 469 | .p_arglen = MNT_enc_dirpath_sz, |
474 | .p_statidx = MOUNTPROC_UMNT, | 470 | .p_statidx = MOUNTPROC_UMNT, |
475 | .p_name = "UMOUNT", | 471 | .p_name = "UMOUNT", |
@@ -479,7 +475,7 @@ static struct rpc_procinfo mnt_procedures[] = { | |||
479 | static struct rpc_procinfo mnt3_procedures[] = { | 475 | static struct rpc_procinfo mnt3_procedures[] = { |
480 | [MOUNTPROC3_MNT] = { | 476 | [MOUNTPROC3_MNT] = { |
481 | .p_proc = MOUNTPROC3_MNT, | 477 | .p_proc = MOUNTPROC3_MNT, |
482 | .p_encode = (kxdrproc_t)mnt_enc_dirpath, | 478 | .p_encode = (kxdreproc_t)mnt_xdr_enc_dirpath, |
483 | .p_decode = (kxdrproc_t)mnt_dec_mountres3, | 479 | .p_decode = (kxdrproc_t)mnt_dec_mountres3, |
484 | .p_arglen = MNT_enc_dirpath_sz, | 480 | .p_arglen = MNT_enc_dirpath_sz, |
485 | .p_replen = MNT_dec_mountres3_sz, | 481 | .p_replen = MNT_dec_mountres3_sz, |
@@ -488,7 +484,7 @@ static struct rpc_procinfo mnt3_procedures[] = { | |||
488 | }, | 484 | }, |
489 | [MOUNTPROC3_UMNT] = { | 485 | [MOUNTPROC3_UMNT] = { |
490 | .p_proc = MOUNTPROC3_UMNT, | 486 | .p_proc = MOUNTPROC3_UMNT, |
491 | .p_encode = (kxdrproc_t)mnt_enc_dirpath, | 487 | .p_encode = (kxdreproc_t)mnt_xdr_enc_dirpath, |
492 | .p_arglen = MNT_enc_dirpath_sz, | 488 | .p_arglen = MNT_enc_dirpath_sz, |
493 | .p_statidx = MOUNTPROC3_UMNT, | 489 | .p_statidx = MOUNTPROC3_UMNT, |
494 | .p_name = "UMOUNT", | 490 | .p_name = "UMOUNT", |