diff options
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/mount_clnt.c | 18 | ||||
-rw-r--r-- | fs/nfs/nfs2xdr.c | 147 | ||||
-rw-r--r-- | fs/nfs/nfs3xdr.c | 241 | ||||
-rw-r--r-- | fs/nfs/nfs4xdr.c | 663 |
4 files changed, 447 insertions, 622 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", |
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c index a9b848edbd2e..8f3acbec761f 100644 --- a/fs/nfs/nfs2xdr.c +++ b/fs/nfs/nfs2xdr.c | |||
@@ -558,14 +558,11 @@ out_default: | |||
558 | * "NFS: Network File System Protocol Specification". | 558 | * "NFS: Network File System Protocol Specification". |
559 | */ | 559 | */ |
560 | 560 | ||
561 | static int nfs2_xdr_enc_fhandle(struct rpc_rqst *req, __be32 *p, | 561 | static void nfs2_xdr_enc_fhandle(struct rpc_rqst *req, |
562 | const struct nfs_fh *fh) | 562 | struct xdr_stream *xdr, |
563 | const struct nfs_fh *fh) | ||
563 | { | 564 | { |
564 | struct xdr_stream xdr; | 565 | encode_fhandle(xdr, fh); |
565 | |||
566 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
567 | encode_fhandle(&xdr, fh); | ||
568 | return 0; | ||
569 | } | 566 | } |
570 | 567 | ||
571 | /* | 568 | /* |
@@ -576,37 +573,28 @@ static int nfs2_xdr_enc_fhandle(struct rpc_rqst *req, __be32 *p, | |||
576 | * sattr attributes; | 573 | * sattr attributes; |
577 | * }; | 574 | * }; |
578 | */ | 575 | */ |
579 | static int nfs2_xdr_enc_sattrargs(struct rpc_rqst *req, __be32 *p, | 576 | static void nfs2_xdr_enc_sattrargs(struct rpc_rqst *req, |
580 | const struct nfs_sattrargs *args) | 577 | struct xdr_stream *xdr, |
578 | const struct nfs_sattrargs *args) | ||
581 | { | 579 | { |
582 | struct xdr_stream xdr; | 580 | encode_fhandle(xdr, args->fh); |
583 | 581 | encode_sattr(xdr, args->sattr); | |
584 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
585 | encode_fhandle(&xdr, args->fh); | ||
586 | encode_sattr(&xdr, args->sattr); | ||
587 | return 0; | ||
588 | } | 582 | } |
589 | 583 | ||
590 | static int nfs2_xdr_enc_diropargs(struct rpc_rqst *req, __be32 *p, | 584 | static void nfs2_xdr_enc_diropargs(struct rpc_rqst *req, |
591 | const struct nfs_diropargs *args) | 585 | struct xdr_stream *xdr, |
586 | const struct nfs_diropargs *args) | ||
592 | { | 587 | { |
593 | struct xdr_stream xdr; | 588 | encode_diropargs(xdr, args->fh, args->name, args->len); |
594 | |||
595 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
596 | encode_diropargs(&xdr, args->fh, args->name, args->len); | ||
597 | return 0; | ||
598 | } | 589 | } |
599 | 590 | ||
600 | static int nfs2_xdr_enc_readlinkargs(struct rpc_rqst *req, __be32 *p, | 591 | static void nfs2_xdr_enc_readlinkargs(struct rpc_rqst *req, |
601 | const struct nfs_readlinkargs *args) | 592 | struct xdr_stream *xdr, |
593 | const struct nfs_readlinkargs *args) | ||
602 | { | 594 | { |
603 | struct xdr_stream xdr; | 595 | encode_fhandle(xdr, args->fh); |
604 | |||
605 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
606 | encode_fhandle(&xdr, args->fh); | ||
607 | prepare_reply_buffer(req, args->pages, args->pgbase, | 596 | prepare_reply_buffer(req, args->pages, args->pgbase, |
608 | args->pglen, NFS_readlinkres_sz); | 597 | args->pglen, NFS_readlinkres_sz); |
609 | return 0; | ||
610 | } | 598 | } |
611 | 599 | ||
612 | /* | 600 | /* |
@@ -634,17 +622,14 @@ static void encode_readargs(struct xdr_stream *xdr, | |||
634 | *p = cpu_to_be32(count); | 622 | *p = cpu_to_be32(count); |
635 | } | 623 | } |
636 | 624 | ||
637 | static int nfs2_xdr_enc_readargs(struct rpc_rqst *req, __be32 *p, | 625 | static void nfs2_xdr_enc_readargs(struct rpc_rqst *req, |
638 | const struct nfs_readargs *args) | 626 | struct xdr_stream *xdr, |
627 | const struct nfs_readargs *args) | ||
639 | { | 628 | { |
640 | struct xdr_stream xdr; | 629 | encode_readargs(xdr, args); |
641 | |||
642 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
643 | encode_readargs(&xdr, args); | ||
644 | prepare_reply_buffer(req, args->pages, args->pgbase, | 630 | prepare_reply_buffer(req, args->pages, args->pgbase, |
645 | args->count, NFS_readres_sz); | 631 | args->count, NFS_readres_sz); |
646 | req->rq_rcv_buf.flags |= XDRBUF_READ; | 632 | req->rq_rcv_buf.flags |= XDRBUF_READ; |
647 | return 0; | ||
648 | } | 633 | } |
649 | 634 | ||
650 | /* | 635 | /* |
@@ -677,15 +662,12 @@ static void encode_writeargs(struct xdr_stream *xdr, | |||
677 | xdr_write_pages(xdr, args->pages, args->pgbase, count); | 662 | xdr_write_pages(xdr, args->pages, args->pgbase, count); |
678 | } | 663 | } |
679 | 664 | ||
680 | static int nfs2_xdr_enc_writeargs(struct rpc_rqst *req, __be32 *p, | 665 | static void nfs2_xdr_enc_writeargs(struct rpc_rqst *req, |
681 | const struct nfs_writeargs *args) | 666 | struct xdr_stream *xdr, |
667 | const struct nfs_writeargs *args) | ||
682 | { | 668 | { |
683 | struct xdr_stream xdr; | 669 | encode_writeargs(xdr, args); |
684 | 670 | xdr->buf->flags |= XDRBUF_WRITE; | |
685 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
686 | encode_writeargs(&xdr, args); | ||
687 | xdr.buf->flags |= XDRBUF_WRITE; | ||
688 | return 0; | ||
689 | } | 671 | } |
690 | 672 | ||
691 | /* | 673 | /* |
@@ -696,25 +678,19 @@ static int nfs2_xdr_enc_writeargs(struct rpc_rqst *req, __be32 *p, | |||
696 | * sattr attributes; | 678 | * sattr attributes; |
697 | * }; | 679 | * }; |
698 | */ | 680 | */ |
699 | static int nfs2_xdr_enc_createargs(struct rpc_rqst *req, __be32 *p, | 681 | static void nfs2_xdr_enc_createargs(struct rpc_rqst *req, |
700 | const struct nfs_createargs *args) | 682 | struct xdr_stream *xdr, |
683 | const struct nfs_createargs *args) | ||
701 | { | 684 | { |
702 | struct xdr_stream xdr; | 685 | encode_diropargs(xdr, args->fh, args->name, args->len); |
703 | 686 | encode_sattr(xdr, args->sattr); | |
704 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
705 | encode_diropargs(&xdr, args->fh, args->name, args->len); | ||
706 | encode_sattr(&xdr, args->sattr); | ||
707 | return 0; | ||
708 | } | 687 | } |
709 | 688 | ||
710 | static int nfs2_xdr_enc_removeargs(struct rpc_rqst *req, __be32 *p, | 689 | static void nfs2_xdr_enc_removeargs(struct rpc_rqst *req, |
711 | const struct nfs_removeargs *args) | 690 | struct xdr_stream *xdr, |
691 | const struct nfs_removeargs *args) | ||
712 | { | 692 | { |
713 | struct xdr_stream xdr; | 693 | encode_diropargs(xdr, args->fh, args->name.name, args->name.len); |
714 | |||
715 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
716 | encode_diropargs(&xdr, args->fh, args->name.name, args->name.len); | ||
717 | return 0; | ||
718 | } | 694 | } |
719 | 695 | ||
720 | /* | 696 | /* |
@@ -725,17 +701,15 @@ static int nfs2_xdr_enc_removeargs(struct rpc_rqst *req, __be32 *p, | |||
725 | * diropargs to; | 701 | * diropargs to; |
726 | * }; | 702 | * }; |
727 | */ | 703 | */ |
728 | static int nfs2_xdr_enc_renameargs(struct rpc_rqst *req, __be32 *p, | 704 | static void nfs2_xdr_enc_renameargs(struct rpc_rqst *req, |
729 | const struct nfs_renameargs *args) | 705 | struct xdr_stream *xdr, |
706 | const struct nfs_renameargs *args) | ||
730 | { | 707 | { |
731 | const struct qstr *old = args->old_name; | 708 | const struct qstr *old = args->old_name; |
732 | const struct qstr *new = args->new_name; | 709 | const struct qstr *new = args->new_name; |
733 | struct xdr_stream xdr; | ||
734 | 710 | ||
735 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 711 | encode_diropargs(xdr, args->old_dir, old->name, old->len); |
736 | encode_diropargs(&xdr, args->old_dir, old->name, old->len); | 712 | encode_diropargs(xdr, args->new_dir, new->name, new->len); |
737 | encode_diropargs(&xdr, args->new_dir, new->name, new->len); | ||
738 | return 0; | ||
739 | } | 713 | } |
740 | 714 | ||
741 | /* | 715 | /* |
@@ -746,15 +720,12 @@ static int nfs2_xdr_enc_renameargs(struct rpc_rqst *req, __be32 *p, | |||
746 | * diropargs to; | 720 | * diropargs to; |
747 | * }; | 721 | * }; |
748 | */ | 722 | */ |
749 | static int nfs2_xdr_enc_linkargs(struct rpc_rqst *req, __be32 *p, | 723 | static void nfs2_xdr_enc_linkargs(struct rpc_rqst *req, |
750 | const struct nfs_linkargs *args) | 724 | struct xdr_stream *xdr, |
725 | const struct nfs_linkargs *args) | ||
751 | { | 726 | { |
752 | struct xdr_stream xdr; | 727 | encode_fhandle(xdr, args->fromfh); |
753 | 728 | encode_diropargs(xdr, args->tofh, args->toname, args->tolen); | |
754 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
755 | encode_fhandle(&xdr, args->fromfh); | ||
756 | encode_diropargs(&xdr, args->tofh, args->toname, args->tolen); | ||
757 | return 0; | ||
758 | } | 729 | } |
759 | 730 | ||
760 | /* | 731 | /* |
@@ -766,16 +737,13 @@ static int nfs2_xdr_enc_linkargs(struct rpc_rqst *req, __be32 *p, | |||
766 | * sattr attributes; | 737 | * sattr attributes; |
767 | * }; | 738 | * }; |
768 | */ | 739 | */ |
769 | static int nfs2_xdr_enc_symlinkargs(struct rpc_rqst *req, __be32 *p, | 740 | static void nfs2_xdr_enc_symlinkargs(struct rpc_rqst *req, |
770 | const struct nfs_symlinkargs *args) | 741 | struct xdr_stream *xdr, |
742 | const struct nfs_symlinkargs *args) | ||
771 | { | 743 | { |
772 | struct xdr_stream xdr; | 744 | encode_diropargs(xdr, args->fromfh, args->fromname, args->fromlen); |
773 | 745 | encode_path(xdr, args->pages, args->pathlen); | |
774 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 746 | encode_sattr(xdr, args->sattr); |
775 | encode_diropargs(&xdr, args->fromfh, args->fromname, args->fromlen); | ||
776 | encode_path(&xdr, args->pages, args->pathlen); | ||
777 | encode_sattr(&xdr, args->sattr); | ||
778 | return 0; | ||
779 | } | 747 | } |
780 | 748 | ||
781 | /* | 749 | /* |
@@ -799,16 +767,13 @@ static void encode_readdirargs(struct xdr_stream *xdr, | |||
799 | *p = cpu_to_be32(args->count); | 767 | *p = cpu_to_be32(args->count); |
800 | } | 768 | } |
801 | 769 | ||
802 | static int nfs2_xdr_enc_readdirargs(struct rpc_rqst *req, __be32 *p, | 770 | static void nfs2_xdr_enc_readdirargs(struct rpc_rqst *req, |
803 | const struct nfs_readdirargs *args) | 771 | struct xdr_stream *xdr, |
772 | const struct nfs_readdirargs *args) | ||
804 | { | 773 | { |
805 | struct xdr_stream xdr; | 774 | encode_readdirargs(xdr, args); |
806 | |||
807 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
808 | encode_readdirargs(&xdr, args); | ||
809 | prepare_reply_buffer(req, args->pages, 0, | 775 | prepare_reply_buffer(req, args->pages, 0, |
810 | args->count, NFS_readdirres_sz); | 776 | args->count, NFS_readdirres_sz); |
811 | return 0; | ||
812 | } | 777 | } |
813 | 778 | ||
814 | /* | 779 | /* |
@@ -1184,7 +1149,7 @@ int nfs_stat_to_errno(enum nfs_stat status) | |||
1184 | #define PROC(proc, argtype, restype, timer) \ | 1149 | #define PROC(proc, argtype, restype, timer) \ |
1185 | [NFSPROC_##proc] = { \ | 1150 | [NFSPROC_##proc] = { \ |
1186 | .p_proc = NFSPROC_##proc, \ | 1151 | .p_proc = NFSPROC_##proc, \ |
1187 | .p_encode = (kxdrproc_t)nfs2_xdr_enc_##argtype, \ | 1152 | .p_encode = (kxdreproc_t)nfs2_xdr_enc_##argtype, \ |
1188 | .p_decode = (kxdrproc_t)nfs2_xdr_dec_##restype, \ | 1153 | .p_decode = (kxdrproc_t)nfs2_xdr_dec_##restype, \ |
1189 | .p_arglen = NFS_##argtype##_sz, \ | 1154 | .p_arglen = NFS_##argtype##_sz, \ |
1190 | .p_replen = NFS_##restype##_sz, \ | 1155 | .p_replen = NFS_##restype##_sz, \ |
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c index 15c93ccd90c5..ae1b1a43f05e 100644 --- a/fs/nfs/nfs3xdr.c +++ b/fs/nfs/nfs3xdr.c | |||
@@ -835,14 +835,11 @@ static void encode_diropargs3(struct xdr_stream *xdr, const struct nfs_fh *fh, | |||
835 | * nfs_fh3 object; | 835 | * nfs_fh3 object; |
836 | * }; | 836 | * }; |
837 | */ | 837 | */ |
838 | static int nfs3_xdr_enc_getattr3args(struct rpc_rqst *req, __be32 *p, | 838 | static void nfs3_xdr_enc_getattr3args(struct rpc_rqst *req, |
839 | const struct nfs_fh *fh) | 839 | struct xdr_stream *xdr, |
840 | const struct nfs_fh *fh) | ||
840 | { | 841 | { |
841 | struct xdr_stream xdr; | 842 | encode_nfs_fh3(xdr, fh); |
842 | |||
843 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
844 | encode_nfs_fh3(&xdr, fh); | ||
845 | return 0; | ||
846 | } | 843 | } |
847 | 844 | ||
848 | /* | 845 | /* |
@@ -876,16 +873,13 @@ static void encode_sattrguard3(struct xdr_stream *xdr, | |||
876 | } | 873 | } |
877 | } | 874 | } |
878 | 875 | ||
879 | static int nfs3_xdr_enc_setattr3args(struct rpc_rqst *req, __be32 *p, | 876 | static void nfs3_xdr_enc_setattr3args(struct rpc_rqst *req, |
880 | const struct nfs3_sattrargs *args) | 877 | struct xdr_stream *xdr, |
878 | const struct nfs3_sattrargs *args) | ||
881 | { | 879 | { |
882 | struct xdr_stream xdr; | 880 | encode_nfs_fh3(xdr, args->fh); |
883 | 881 | encode_sattr3(xdr, args->sattr); | |
884 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 882 | encode_sattrguard3(xdr, args); |
885 | encode_nfs_fh3(&xdr, args->fh); | ||
886 | encode_sattr3(&xdr, args->sattr); | ||
887 | encode_sattrguard3(&xdr, args); | ||
888 | return 0; | ||
889 | } | 883 | } |
890 | 884 | ||
891 | /* | 885 | /* |
@@ -895,14 +889,11 @@ static int nfs3_xdr_enc_setattr3args(struct rpc_rqst *req, __be32 *p, | |||
895 | * diropargs3 what; | 889 | * diropargs3 what; |
896 | * }; | 890 | * }; |
897 | */ | 891 | */ |
898 | static int nfs3_xdr_enc_lookup3args(struct rpc_rqst *req, __be32 *p, | 892 | static void nfs3_xdr_enc_lookup3args(struct rpc_rqst *req, |
899 | const struct nfs3_diropargs *args) | 893 | struct xdr_stream *xdr, |
894 | const struct nfs3_diropargs *args) | ||
900 | { | 895 | { |
901 | struct xdr_stream xdr; | 896 | encode_diropargs3(xdr, args->fh, args->name, args->len); |
902 | |||
903 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
904 | encode_diropargs3(&xdr, args->fh, args->name, args->len); | ||
905 | return 0; | ||
906 | } | 897 | } |
907 | 898 | ||
908 | /* | 899 | /* |
@@ -920,14 +911,11 @@ static void encode_access3args(struct xdr_stream *xdr, | |||
920 | encode_uint32(xdr, args->access); | 911 | encode_uint32(xdr, args->access); |
921 | } | 912 | } |
922 | 913 | ||
923 | static int nfs3_xdr_enc_access3args(struct rpc_rqst *req, __be32 *p, | 914 | static void nfs3_xdr_enc_access3args(struct rpc_rqst *req, |
924 | const struct nfs3_accessargs *args) | 915 | struct xdr_stream *xdr, |
916 | const struct nfs3_accessargs *args) | ||
925 | { | 917 | { |
926 | struct xdr_stream xdr; | 918 | encode_access3args(xdr, args); |
927 | |||
928 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
929 | encode_access3args(&xdr, args); | ||
930 | return 0; | ||
931 | } | 919 | } |
932 | 920 | ||
933 | /* | 921 | /* |
@@ -937,16 +925,13 @@ static int nfs3_xdr_enc_access3args(struct rpc_rqst *req, __be32 *p, | |||
937 | * nfs_fh3 symlink; | 925 | * nfs_fh3 symlink; |
938 | * }; | 926 | * }; |
939 | */ | 927 | */ |
940 | static int nfs3_xdr_enc_readlink3args(struct rpc_rqst *req, __be32 *p, | 928 | static void nfs3_xdr_enc_readlink3args(struct rpc_rqst *req, |
941 | const struct nfs3_readlinkargs *args) | 929 | struct xdr_stream *xdr, |
930 | const struct nfs3_readlinkargs *args) | ||
942 | { | 931 | { |
943 | struct xdr_stream xdr; | 932 | encode_nfs_fh3(xdr, args->fh); |
944 | |||
945 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
946 | encode_nfs_fh3(&xdr, args->fh); | ||
947 | prepare_reply_buffer(req, args->pages, args->pgbase, | 933 | prepare_reply_buffer(req, args->pages, args->pgbase, |
948 | args->pglen, NFS3_readlinkres_sz); | 934 | args->pglen, NFS3_readlinkres_sz); |
949 | return 0; | ||
950 | } | 935 | } |
951 | 936 | ||
952 | /* | 937 | /* |
@@ -970,17 +955,14 @@ static void encode_read3args(struct xdr_stream *xdr, | |||
970 | *p = cpu_to_be32(args->count); | 955 | *p = cpu_to_be32(args->count); |
971 | } | 956 | } |
972 | 957 | ||
973 | static int nfs3_xdr_enc_read3args(struct rpc_rqst *req, __be32 *p, | 958 | static void nfs3_xdr_enc_read3args(struct rpc_rqst *req, |
974 | const struct nfs_readargs *args) | 959 | struct xdr_stream *xdr, |
960 | const struct nfs_readargs *args) | ||
975 | { | 961 | { |
976 | struct xdr_stream xdr; | 962 | encode_read3args(xdr, args); |
977 | |||
978 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
979 | encode_read3args(&xdr, args); | ||
980 | prepare_reply_buffer(req, args->pages, args->pgbase, | 963 | prepare_reply_buffer(req, args->pages, args->pgbase, |
981 | args->count, NFS3_readres_sz); | 964 | args->count, NFS3_readres_sz); |
982 | req->rq_rcv_buf.flags |= XDRBUF_READ; | 965 | req->rq_rcv_buf.flags |= XDRBUF_READ; |
983 | return 0; | ||
984 | } | 966 | } |
985 | 967 | ||
986 | /* | 968 | /* |
@@ -1015,15 +997,12 @@ static void encode_write3args(struct xdr_stream *xdr, | |||
1015 | xdr_write_pages(xdr, args->pages, args->pgbase, args->count); | 997 | xdr_write_pages(xdr, args->pages, args->pgbase, args->count); |
1016 | } | 998 | } |
1017 | 999 | ||
1018 | static int nfs3_xdr_enc_write3args(struct rpc_rqst *req, __be32 *p, | 1000 | static void nfs3_xdr_enc_write3args(struct rpc_rqst *req, |
1019 | const struct nfs_writeargs *args) | 1001 | struct xdr_stream *xdr, |
1002 | const struct nfs_writeargs *args) | ||
1020 | { | 1003 | { |
1021 | struct xdr_stream xdr; | 1004 | encode_write3args(xdr, args); |
1022 | 1005 | xdr->buf->flags |= XDRBUF_WRITE; | |
1023 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
1024 | encode_write3args(&xdr, args); | ||
1025 | xdr.buf->flags |= XDRBUF_WRITE; | ||
1026 | return 0; | ||
1027 | } | 1006 | } |
1028 | 1007 | ||
1029 | /* | 1008 | /* |
@@ -1065,15 +1044,12 @@ static void encode_createhow3(struct xdr_stream *xdr, | |||
1065 | } | 1044 | } |
1066 | } | 1045 | } |
1067 | 1046 | ||
1068 | static int nfs3_xdr_enc_create3args(struct rpc_rqst *req, __be32 *p, | 1047 | static void nfs3_xdr_enc_create3args(struct rpc_rqst *req, |
1069 | const struct nfs3_createargs *args) | 1048 | struct xdr_stream *xdr, |
1049 | const struct nfs3_createargs *args) | ||
1070 | { | 1050 | { |
1071 | struct xdr_stream xdr; | 1051 | encode_diropargs3(xdr, args->fh, args->name, args->len); |
1072 | 1052 | encode_createhow3(xdr, args); | |
1073 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
1074 | encode_diropargs3(&xdr, args->fh, args->name, args->len); | ||
1075 | encode_createhow3(&xdr, args); | ||
1076 | return 0; | ||
1077 | } | 1053 | } |
1078 | 1054 | ||
1079 | /* | 1055 | /* |
@@ -1084,15 +1060,12 @@ static int nfs3_xdr_enc_create3args(struct rpc_rqst *req, __be32 *p, | |||
1084 | * sattr3 attributes; | 1060 | * sattr3 attributes; |
1085 | * }; | 1061 | * }; |
1086 | */ | 1062 | */ |
1087 | static int nfs3_xdr_enc_mkdir3args(struct rpc_rqst *req, __be32 *p, | 1063 | static void nfs3_xdr_enc_mkdir3args(struct rpc_rqst *req, |
1088 | const struct nfs3_mkdirargs *args) | 1064 | struct xdr_stream *xdr, |
1065 | const struct nfs3_mkdirargs *args) | ||
1089 | { | 1066 | { |
1090 | struct xdr_stream xdr; | 1067 | encode_diropargs3(xdr, args->fh, args->name, args->len); |
1091 | 1068 | encode_sattr3(xdr, args->sattr); | |
1092 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
1093 | encode_diropargs3(&xdr, args->fh, args->name, args->len); | ||
1094 | encode_sattr3(&xdr, args->sattr); | ||
1095 | return 0; | ||
1096 | } | 1069 | } |
1097 | 1070 | ||
1098 | /* | 1071 | /* |
@@ -1115,15 +1088,12 @@ static void encode_symlinkdata3(struct xdr_stream *xdr, | |||
1115 | encode_nfspath3(xdr, args->pages, args->pathlen); | 1088 | encode_nfspath3(xdr, args->pages, args->pathlen); |
1116 | } | 1089 | } |
1117 | 1090 | ||
1118 | static int nfs3_xdr_enc_symlink3args(struct rpc_rqst *req, __be32 *p, | 1091 | static void nfs3_xdr_enc_symlink3args(struct rpc_rqst *req, |
1119 | const struct nfs3_symlinkargs *args) | 1092 | struct xdr_stream *xdr, |
1093 | const struct nfs3_symlinkargs *args) | ||
1120 | { | 1094 | { |
1121 | struct xdr_stream xdr; | 1095 | encode_diropargs3(xdr, args->fromfh, args->fromname, args->fromlen); |
1122 | 1096 | encode_symlinkdata3(xdr, args); | |
1123 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
1124 | encode_diropargs3(&xdr, args->fromfh, args->fromname, args->fromlen); | ||
1125 | encode_symlinkdata3(&xdr, args); | ||
1126 | return 0; | ||
1127 | } | 1097 | } |
1128 | 1098 | ||
1129 | /* | 1099 | /* |
@@ -1178,15 +1148,12 @@ static void encode_mknoddata3(struct xdr_stream *xdr, | |||
1178 | } | 1148 | } |
1179 | } | 1149 | } |
1180 | 1150 | ||
1181 | static int nfs3_xdr_enc_mknod3args(struct rpc_rqst *req, __be32 *p, | 1151 | static void nfs3_xdr_enc_mknod3args(struct rpc_rqst *req, |
1182 | const struct nfs3_mknodargs *args) | 1152 | struct xdr_stream *xdr, |
1153 | const struct nfs3_mknodargs *args) | ||
1183 | { | 1154 | { |
1184 | struct xdr_stream xdr; | 1155 | encode_diropargs3(xdr, args->fh, args->name, args->len); |
1185 | 1156 | encode_mknoddata3(xdr, args); | |
1186 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
1187 | encode_diropargs3(&xdr, args->fh, args->name, args->len); | ||
1188 | encode_mknoddata3(&xdr, args); | ||
1189 | return 0; | ||
1190 | } | 1157 | } |
1191 | 1158 | ||
1192 | /* | 1159 | /* |
@@ -1196,14 +1163,11 @@ static int nfs3_xdr_enc_mknod3args(struct rpc_rqst *req, __be32 *p, | |||
1196 | * diropargs3 object; | 1163 | * diropargs3 object; |
1197 | * }; | 1164 | * }; |
1198 | */ | 1165 | */ |
1199 | static int nfs3_xdr_enc_remove3args(struct rpc_rqst *req, __be32 *p, | 1166 | static void nfs3_xdr_enc_remove3args(struct rpc_rqst *req, |
1200 | const struct nfs_removeargs *args) | 1167 | struct xdr_stream *xdr, |
1168 | const struct nfs_removeargs *args) | ||
1201 | { | 1169 | { |
1202 | struct xdr_stream xdr; | 1170 | encode_diropargs3(xdr, args->fh, args->name.name, args->name.len); |
1203 | |||
1204 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
1205 | encode_diropargs3(&xdr, args->fh, args->name.name, args->name.len); | ||
1206 | return 0; | ||
1207 | } | 1171 | } |
1208 | 1172 | ||
1209 | /* | 1173 | /* |
@@ -1214,17 +1178,15 @@ static int nfs3_xdr_enc_remove3args(struct rpc_rqst *req, __be32 *p, | |||
1214 | * diropargs3 to; | 1178 | * diropargs3 to; |
1215 | * }; | 1179 | * }; |
1216 | */ | 1180 | */ |
1217 | static int nfs3_xdr_enc_rename3args(struct rpc_rqst *req, __be32 *p, | 1181 | static void nfs3_xdr_enc_rename3args(struct rpc_rqst *req, |
1218 | const struct nfs_renameargs *args) | 1182 | struct xdr_stream *xdr, |
1183 | const struct nfs_renameargs *args) | ||
1219 | { | 1184 | { |
1220 | const struct qstr *old = args->old_name; | 1185 | const struct qstr *old = args->old_name; |
1221 | const struct qstr *new = args->new_name; | 1186 | const struct qstr *new = args->new_name; |
1222 | struct xdr_stream xdr; | ||
1223 | 1187 | ||
1224 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1188 | encode_diropargs3(xdr, args->old_dir, old->name, old->len); |
1225 | encode_diropargs3(&xdr, args->old_dir, old->name, old->len); | 1189 | encode_diropargs3(xdr, args->new_dir, new->name, new->len); |
1226 | encode_diropargs3(&xdr, args->new_dir, new->name, new->len); | ||
1227 | return 0; | ||
1228 | } | 1190 | } |
1229 | 1191 | ||
1230 | /* | 1192 | /* |
@@ -1235,15 +1197,12 @@ static int nfs3_xdr_enc_rename3args(struct rpc_rqst *req, __be32 *p, | |||
1235 | * diropargs3 link; | 1197 | * diropargs3 link; |
1236 | * }; | 1198 | * }; |
1237 | */ | 1199 | */ |
1238 | static int nfs3_xdr_enc_link3args(struct rpc_rqst *req, __be32 *p, | 1200 | static void nfs3_xdr_enc_link3args(struct rpc_rqst *req, |
1239 | const struct nfs3_linkargs *args) | 1201 | struct xdr_stream *xdr, |
1202 | const struct nfs3_linkargs *args) | ||
1240 | { | 1203 | { |
1241 | struct xdr_stream xdr; | 1204 | encode_nfs_fh3(xdr, args->fromfh); |
1242 | 1205 | encode_diropargs3(xdr, args->tofh, args->toname, args->tolen); | |
1243 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
1244 | encode_nfs_fh3(&xdr, args->fromfh); | ||
1245 | encode_diropargs3(&xdr, args->tofh, args->toname, args->tolen); | ||
1246 | return 0; | ||
1247 | } | 1206 | } |
1248 | 1207 | ||
1249 | /* | 1208 | /* |
@@ -1269,16 +1228,13 @@ static void encode_readdir3args(struct xdr_stream *xdr, | |||
1269 | *p = cpu_to_be32(args->count); | 1228 | *p = cpu_to_be32(args->count); |
1270 | } | 1229 | } |
1271 | 1230 | ||
1272 | static int nfs3_xdr_enc_readdir3args(struct rpc_rqst *req, __be32 *p, | 1231 | static void nfs3_xdr_enc_readdir3args(struct rpc_rqst *req, |
1273 | const struct nfs3_readdirargs *args) | 1232 | struct xdr_stream *xdr, |
1233 | const struct nfs3_readdirargs *args) | ||
1274 | { | 1234 | { |
1275 | struct xdr_stream xdr; | 1235 | encode_readdir3args(xdr, args); |
1276 | |||
1277 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
1278 | encode_readdir3args(&xdr, args); | ||
1279 | prepare_reply_buffer(req, args->pages, 0, | 1236 | prepare_reply_buffer(req, args->pages, 0, |
1280 | args->count, NFS3_readdirres_sz); | 1237 | args->count, NFS3_readdirres_sz); |
1281 | return 0; | ||
1282 | } | 1238 | } |
1283 | 1239 | ||
1284 | /* | 1240 | /* |
@@ -1312,16 +1268,13 @@ static void encode_readdirplus3args(struct xdr_stream *xdr, | |||
1312 | *p = cpu_to_be32(args->count); | 1268 | *p = cpu_to_be32(args->count); |
1313 | } | 1269 | } |
1314 | 1270 | ||
1315 | static int nfs3_xdr_enc_readdirplus3args(struct rpc_rqst *req, __be32 *p, | 1271 | static void nfs3_xdr_enc_readdirplus3args(struct rpc_rqst *req, |
1316 | const struct nfs3_readdirargs *args) | 1272 | struct xdr_stream *xdr, |
1273 | const struct nfs3_readdirargs *args) | ||
1317 | { | 1274 | { |
1318 | struct xdr_stream xdr; | 1275 | encode_readdirplus3args(xdr, args); |
1319 | |||
1320 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
1321 | encode_readdirplus3args(&xdr, args); | ||
1322 | prepare_reply_buffer(req, args->pages, 0, | 1276 | prepare_reply_buffer(req, args->pages, 0, |
1323 | args->count, NFS3_readdirres_sz); | 1277 | args->count, NFS3_readdirres_sz); |
1324 | return 0; | ||
1325 | } | 1278 | } |
1326 | 1279 | ||
1327 | /* | 1280 | /* |
@@ -1345,57 +1298,49 @@ static void encode_commit3args(struct xdr_stream *xdr, | |||
1345 | *p = cpu_to_be32(args->count); | 1298 | *p = cpu_to_be32(args->count); |
1346 | } | 1299 | } |
1347 | 1300 | ||
1348 | static int nfs3_xdr_enc_commit3args(struct rpc_rqst *req, __be32 *p, | 1301 | static void nfs3_xdr_enc_commit3args(struct rpc_rqst *req, |
1349 | const struct nfs_writeargs *args) | 1302 | struct xdr_stream *xdr, |
1303 | const struct nfs_writeargs *args) | ||
1350 | { | 1304 | { |
1351 | struct xdr_stream xdr; | 1305 | encode_commit3args(xdr, args); |
1352 | |||
1353 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
1354 | encode_commit3args(&xdr, args); | ||
1355 | return 0; | ||
1356 | } | 1306 | } |
1357 | 1307 | ||
1358 | #ifdef CONFIG_NFS_V3_ACL | 1308 | #ifdef CONFIG_NFS_V3_ACL |
1359 | 1309 | ||
1360 | static int nfs3_xdr_enc_getacl3args(struct rpc_rqst *req, __be32 *p, | 1310 | static void nfs3_xdr_enc_getacl3args(struct rpc_rqst *req, |
1361 | const struct nfs3_getaclargs *args) | 1311 | struct xdr_stream *xdr, |
1312 | const struct nfs3_getaclargs *args) | ||
1362 | { | 1313 | { |
1363 | struct xdr_stream xdr; | 1314 | encode_nfs_fh3(xdr, args->fh); |
1364 | 1315 | encode_uint32(xdr, args->mask); | |
1365 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | ||
1366 | encode_nfs_fh3(&xdr, args->fh); | ||
1367 | encode_uint32(&xdr, args->mask); | ||
1368 | if (args->mask & (NFS_ACL | NFS_DFACL)) | 1316 | if (args->mask & (NFS_ACL | NFS_DFACL)) |
1369 | prepare_reply_buffer(req, args->pages, 0, | 1317 | prepare_reply_buffer(req, args->pages, 0, |
1370 | NFSACL_MAXPAGES << PAGE_SHIFT, | 1318 | NFSACL_MAXPAGES << PAGE_SHIFT, |
1371 | ACL3_getaclres_sz); | 1319 | ACL3_getaclres_sz); |
1372 | return 0; | ||
1373 | } | 1320 | } |
1374 | 1321 | ||
1375 | static int nfs3_xdr_enc_setacl3args(struct rpc_rqst *req, __be32 *p, | 1322 | static void nfs3_xdr_enc_setacl3args(struct rpc_rqst *req, |
1376 | const struct nfs3_setaclargs *args) | 1323 | struct xdr_stream *xdr, |
1324 | const struct nfs3_setaclargs *args) | ||
1377 | { | 1325 | { |
1378 | struct xdr_stream xdr; | ||
1379 | unsigned int base; | 1326 | unsigned int base; |
1380 | int error; | 1327 | int error; |
1381 | 1328 | ||
1382 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1329 | encode_nfs_fh3(xdr, NFS_FH(args->inode)); |
1383 | encode_nfs_fh3(&xdr, NFS_FH(args->inode)); | 1330 | encode_uint32(xdr, args->mask); |
1384 | encode_uint32(&xdr, args->mask); | ||
1385 | if (args->npages != 0) | 1331 | if (args->npages != 0) |
1386 | xdr_write_pages(&xdr, args->pages, 0, args->len); | 1332 | xdr_write_pages(xdr, args->pages, 0, args->len); |
1387 | 1333 | ||
1388 | base = req->rq_slen; | 1334 | base = req->rq_slen; |
1389 | error = nfsacl_encode(xdr.buf, base, args->inode, | 1335 | error = nfsacl_encode(xdr->buf, base, args->inode, |
1390 | (args->mask & NFS_ACL) ? | 1336 | (args->mask & NFS_ACL) ? |
1391 | args->acl_access : NULL, 1, 0); | 1337 | args->acl_access : NULL, 1, 0); |
1392 | BUG_ON(error < 0); | 1338 | BUG_ON(error < 0); |
1393 | error = nfsacl_encode(xdr.buf, base + error, args->inode, | 1339 | error = nfsacl_encode(xdr->buf, base + error, args->inode, |
1394 | (args->mask & NFS_DFACL) ? | 1340 | (args->mask & NFS_DFACL) ? |
1395 | args->acl_default : NULL, 1, | 1341 | args->acl_default : NULL, 1, |
1396 | NFS_ACL_DEFAULT); | 1342 | NFS_ACL_DEFAULT); |
1397 | BUG_ON(error < 0); | 1343 | BUG_ON(error < 0); |
1398 | return 0; | ||
1399 | } | 1344 | } |
1400 | 1345 | ||
1401 | #endif /* CONFIG_NFS_V3_ACL */ | 1346 | #endif /* CONFIG_NFS_V3_ACL */ |
@@ -2506,7 +2451,7 @@ out_default: | |||
2506 | #define PROC(proc, argtype, restype, timer) \ | 2451 | #define PROC(proc, argtype, restype, timer) \ |
2507 | [NFS3PROC_##proc] = { \ | 2452 | [NFS3PROC_##proc] = { \ |
2508 | .p_proc = NFS3PROC_##proc, \ | 2453 | .p_proc = NFS3PROC_##proc, \ |
2509 | .p_encode = (kxdrproc_t)nfs3_xdr_enc_##argtype##3args, \ | 2454 | .p_encode = (kxdreproc_t)nfs3_xdr_enc_##argtype##3args, \ |
2510 | .p_decode = (kxdrproc_t)nfs3_xdr_dec_##restype##3res, \ | 2455 | .p_decode = (kxdrproc_t)nfs3_xdr_dec_##restype##3res, \ |
2511 | .p_arglen = NFS3_##argtype##args_sz, \ | 2456 | .p_arglen = NFS3_##argtype##args_sz, \ |
2512 | .p_replen = NFS3_##restype##res_sz, \ | 2457 | .p_replen = NFS3_##restype##res_sz, \ |
@@ -2549,7 +2494,7 @@ struct rpc_version nfs_version3 = { | |||
2549 | static struct rpc_procinfo nfs3_acl_procedures[] = { | 2494 | static struct rpc_procinfo nfs3_acl_procedures[] = { |
2550 | [ACLPROC3_GETACL] = { | 2495 | [ACLPROC3_GETACL] = { |
2551 | .p_proc = ACLPROC3_GETACL, | 2496 | .p_proc = ACLPROC3_GETACL, |
2552 | .p_encode = (kxdrproc_t)nfs3_xdr_enc_getacl3args, | 2497 | .p_encode = (kxdreproc_t)nfs3_xdr_enc_getacl3args, |
2553 | .p_decode = (kxdrproc_t)nfs3_xdr_dec_getacl3res, | 2498 | .p_decode = (kxdrproc_t)nfs3_xdr_dec_getacl3res, |
2554 | .p_arglen = ACL3_getaclargs_sz, | 2499 | .p_arglen = ACL3_getaclargs_sz, |
2555 | .p_replen = ACL3_getaclres_sz, | 2500 | .p_replen = ACL3_getaclres_sz, |
@@ -2558,7 +2503,7 @@ static struct rpc_procinfo nfs3_acl_procedures[] = { | |||
2558 | }, | 2503 | }, |
2559 | [ACLPROC3_SETACL] = { | 2504 | [ACLPROC3_SETACL] = { |
2560 | .p_proc = ACLPROC3_SETACL, | 2505 | .p_proc = ACLPROC3_SETACL, |
2561 | .p_encode = (kxdrproc_t)nfs3_xdr_enc_setacl3args, | 2506 | .p_encode = (kxdreproc_t)nfs3_xdr_enc_setacl3args, |
2562 | .p_decode = (kxdrproc_t)nfs3_xdr_dec_setacl3res, | 2507 | .p_decode = (kxdrproc_t)nfs3_xdr_dec_setacl3res, |
2563 | .p_arglen = ACL3_setaclargs_sz, | 2508 | .p_arglen = ACL3_setaclargs_sz, |
2564 | .p_replen = ACL3_setaclres_sz, | 2509 | .p_replen = ACL3_setaclres_sz, |
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index a15fe99fea86..6ec38b3e4a3d 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -1510,7 +1510,7 @@ encode_restorefh(struct xdr_stream *xdr, struct compound_hdr *hdr) | |||
1510 | hdr->replen += decode_restorefh_maxsz; | 1510 | hdr->replen += decode_restorefh_maxsz; |
1511 | } | 1511 | } |
1512 | 1512 | ||
1513 | static int | 1513 | static void |
1514 | encode_setacl(struct xdr_stream *xdr, struct nfs_setaclargs *arg, struct compound_hdr *hdr) | 1514 | encode_setacl(struct xdr_stream *xdr, struct nfs_setaclargs *arg, struct compound_hdr *hdr) |
1515 | { | 1515 | { |
1516 | __be32 *p; | 1516 | __be32 *p; |
@@ -1521,14 +1521,12 @@ encode_setacl(struct xdr_stream *xdr, struct nfs_setaclargs *arg, struct compoun | |||
1521 | p = reserve_space(xdr, 2*4); | 1521 | p = reserve_space(xdr, 2*4); |
1522 | *p++ = cpu_to_be32(1); | 1522 | *p++ = cpu_to_be32(1); |
1523 | *p = cpu_to_be32(FATTR4_WORD0_ACL); | 1523 | *p = cpu_to_be32(FATTR4_WORD0_ACL); |
1524 | if (arg->acl_len % 4) | 1524 | BUG_ON(arg->acl_len % 4); |
1525 | return -EINVAL; | ||
1526 | p = reserve_space(xdr, 4); | 1525 | p = reserve_space(xdr, 4); |
1527 | *p = cpu_to_be32(arg->acl_len); | 1526 | *p = cpu_to_be32(arg->acl_len); |
1528 | xdr_write_pages(xdr, arg->acl_pages, arg->acl_pgbase, arg->acl_len); | 1527 | xdr_write_pages(xdr, arg->acl_pages, arg->acl_pgbase, arg->acl_len); |
1529 | hdr->nops++; | 1528 | hdr->nops++; |
1530 | hdr->replen += decode_setacl_maxsz; | 1529 | hdr->replen += decode_setacl_maxsz; |
1531 | return 0; | ||
1532 | } | 1530 | } |
1533 | 1531 | ||
1534 | static void | 1532 | static void |
@@ -1833,393 +1831,362 @@ static u32 nfs4_xdr_minorversion(const struct nfs4_sequence_args *args) | |||
1833 | /* | 1831 | /* |
1834 | * Encode an ACCESS request | 1832 | * Encode an ACCESS request |
1835 | */ | 1833 | */ |
1836 | static int nfs4_xdr_enc_access(struct rpc_rqst *req, __be32 *p, const struct nfs4_accessargs *args) | 1834 | static void nfs4_xdr_enc_access(struct rpc_rqst *req, struct xdr_stream *xdr, |
1835 | const struct nfs4_accessargs *args) | ||
1837 | { | 1836 | { |
1838 | struct xdr_stream xdr; | ||
1839 | struct compound_hdr hdr = { | 1837 | struct compound_hdr hdr = { |
1840 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 1838 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
1841 | }; | 1839 | }; |
1842 | 1840 | ||
1843 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1841 | encode_compound_hdr(xdr, req, &hdr); |
1844 | encode_compound_hdr(&xdr, req, &hdr); | 1842 | encode_sequence(xdr, &args->seq_args, &hdr); |
1845 | encode_sequence(&xdr, &args->seq_args, &hdr); | 1843 | encode_putfh(xdr, args->fh, &hdr); |
1846 | encode_putfh(&xdr, args->fh, &hdr); | 1844 | encode_access(xdr, args->access, &hdr); |
1847 | encode_access(&xdr, args->access, &hdr); | 1845 | encode_getfattr(xdr, args->bitmask, &hdr); |
1848 | encode_getfattr(&xdr, args->bitmask, &hdr); | ||
1849 | encode_nops(&hdr); | 1846 | encode_nops(&hdr); |
1850 | return 0; | ||
1851 | } | 1847 | } |
1852 | 1848 | ||
1853 | /* | 1849 | /* |
1854 | * Encode LOOKUP request | 1850 | * Encode LOOKUP request |
1855 | */ | 1851 | */ |
1856 | static int nfs4_xdr_enc_lookup(struct rpc_rqst *req, __be32 *p, const struct nfs4_lookup_arg *args) | 1852 | static void nfs4_xdr_enc_lookup(struct rpc_rqst *req, struct xdr_stream *xdr, |
1853 | const struct nfs4_lookup_arg *args) | ||
1857 | { | 1854 | { |
1858 | struct xdr_stream xdr; | ||
1859 | struct compound_hdr hdr = { | 1855 | struct compound_hdr hdr = { |
1860 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 1856 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
1861 | }; | 1857 | }; |
1862 | 1858 | ||
1863 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1859 | encode_compound_hdr(xdr, req, &hdr); |
1864 | encode_compound_hdr(&xdr, req, &hdr); | 1860 | encode_sequence(xdr, &args->seq_args, &hdr); |
1865 | encode_sequence(&xdr, &args->seq_args, &hdr); | 1861 | encode_putfh(xdr, args->dir_fh, &hdr); |
1866 | encode_putfh(&xdr, args->dir_fh, &hdr); | 1862 | encode_lookup(xdr, args->name, &hdr); |
1867 | encode_lookup(&xdr, args->name, &hdr); | 1863 | encode_getfh(xdr, &hdr); |
1868 | encode_getfh(&xdr, &hdr); | 1864 | encode_getfattr(xdr, args->bitmask, &hdr); |
1869 | encode_getfattr(&xdr, args->bitmask, &hdr); | ||
1870 | encode_nops(&hdr); | 1865 | encode_nops(&hdr); |
1871 | return 0; | ||
1872 | } | 1866 | } |
1873 | 1867 | ||
1874 | /* | 1868 | /* |
1875 | * Encode LOOKUP_ROOT request | 1869 | * Encode LOOKUP_ROOT request |
1876 | */ | 1870 | */ |
1877 | static int nfs4_xdr_enc_lookup_root(struct rpc_rqst *req, __be32 *p, const struct nfs4_lookup_root_arg *args) | 1871 | static void nfs4_xdr_enc_lookup_root(struct rpc_rqst *req, |
1872 | struct xdr_stream *xdr, | ||
1873 | const struct nfs4_lookup_root_arg *args) | ||
1878 | { | 1874 | { |
1879 | struct xdr_stream xdr; | ||
1880 | struct compound_hdr hdr = { | 1875 | struct compound_hdr hdr = { |
1881 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 1876 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
1882 | }; | 1877 | }; |
1883 | 1878 | ||
1884 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1879 | encode_compound_hdr(xdr, req, &hdr); |
1885 | encode_compound_hdr(&xdr, req, &hdr); | 1880 | encode_sequence(xdr, &args->seq_args, &hdr); |
1886 | encode_sequence(&xdr, &args->seq_args, &hdr); | 1881 | encode_putrootfh(xdr, &hdr); |
1887 | encode_putrootfh(&xdr, &hdr); | 1882 | encode_getfh(xdr, &hdr); |
1888 | encode_getfh(&xdr, &hdr); | 1883 | encode_getfattr(xdr, args->bitmask, &hdr); |
1889 | encode_getfattr(&xdr, args->bitmask, &hdr); | ||
1890 | encode_nops(&hdr); | 1884 | encode_nops(&hdr); |
1891 | return 0; | ||
1892 | } | 1885 | } |
1893 | 1886 | ||
1894 | /* | 1887 | /* |
1895 | * Encode REMOVE request | 1888 | * Encode REMOVE request |
1896 | */ | 1889 | */ |
1897 | static int nfs4_xdr_enc_remove(struct rpc_rqst *req, __be32 *p, const struct nfs_removeargs *args) | 1890 | static void nfs4_xdr_enc_remove(struct rpc_rqst *req, struct xdr_stream *xdr, |
1891 | const struct nfs_removeargs *args) | ||
1898 | { | 1892 | { |
1899 | struct xdr_stream xdr; | ||
1900 | struct compound_hdr hdr = { | 1893 | struct compound_hdr hdr = { |
1901 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 1894 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
1902 | }; | 1895 | }; |
1903 | 1896 | ||
1904 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1897 | encode_compound_hdr(xdr, req, &hdr); |
1905 | encode_compound_hdr(&xdr, req, &hdr); | 1898 | encode_sequence(xdr, &args->seq_args, &hdr); |
1906 | encode_sequence(&xdr, &args->seq_args, &hdr); | 1899 | encode_putfh(xdr, args->fh, &hdr); |
1907 | encode_putfh(&xdr, args->fh, &hdr); | 1900 | encode_remove(xdr, &args->name, &hdr); |
1908 | encode_remove(&xdr, &args->name, &hdr); | 1901 | encode_getfattr(xdr, args->bitmask, &hdr); |
1909 | encode_getfattr(&xdr, args->bitmask, &hdr); | ||
1910 | encode_nops(&hdr); | 1902 | encode_nops(&hdr); |
1911 | return 0; | ||
1912 | } | 1903 | } |
1913 | 1904 | ||
1914 | /* | 1905 | /* |
1915 | * Encode RENAME request | 1906 | * Encode RENAME request |
1916 | */ | 1907 | */ |
1917 | static int nfs4_xdr_enc_rename(struct rpc_rqst *req, __be32 *p, const struct nfs_renameargs *args) | 1908 | static void nfs4_xdr_enc_rename(struct rpc_rqst *req, struct xdr_stream *xdr, |
1909 | const struct nfs_renameargs *args) | ||
1918 | { | 1910 | { |
1919 | struct xdr_stream xdr; | ||
1920 | struct compound_hdr hdr = { | 1911 | struct compound_hdr hdr = { |
1921 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 1912 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
1922 | }; | 1913 | }; |
1923 | 1914 | ||
1924 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1915 | encode_compound_hdr(xdr, req, &hdr); |
1925 | encode_compound_hdr(&xdr, req, &hdr); | 1916 | encode_sequence(xdr, &args->seq_args, &hdr); |
1926 | encode_sequence(&xdr, &args->seq_args, &hdr); | 1917 | encode_putfh(xdr, args->old_dir, &hdr); |
1927 | encode_putfh(&xdr, args->old_dir, &hdr); | 1918 | encode_savefh(xdr, &hdr); |
1928 | encode_savefh(&xdr, &hdr); | 1919 | encode_putfh(xdr, args->new_dir, &hdr); |
1929 | encode_putfh(&xdr, args->new_dir, &hdr); | 1920 | encode_rename(xdr, args->old_name, args->new_name, &hdr); |
1930 | encode_rename(&xdr, args->old_name, args->new_name, &hdr); | 1921 | encode_getfattr(xdr, args->bitmask, &hdr); |
1931 | encode_getfattr(&xdr, args->bitmask, &hdr); | 1922 | encode_restorefh(xdr, &hdr); |
1932 | encode_restorefh(&xdr, &hdr); | 1923 | encode_getfattr(xdr, args->bitmask, &hdr); |
1933 | encode_getfattr(&xdr, args->bitmask, &hdr); | ||
1934 | encode_nops(&hdr); | 1924 | encode_nops(&hdr); |
1935 | return 0; | ||
1936 | } | 1925 | } |
1937 | 1926 | ||
1938 | /* | 1927 | /* |
1939 | * Encode LINK request | 1928 | * Encode LINK request |
1940 | */ | 1929 | */ |
1941 | static int nfs4_xdr_enc_link(struct rpc_rqst *req, __be32 *p, const struct nfs4_link_arg *args) | 1930 | static void nfs4_xdr_enc_link(struct rpc_rqst *req, struct xdr_stream *xdr, |
1931 | const struct nfs4_link_arg *args) | ||
1942 | { | 1932 | { |
1943 | struct xdr_stream xdr; | ||
1944 | struct compound_hdr hdr = { | 1933 | struct compound_hdr hdr = { |
1945 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 1934 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
1946 | }; | 1935 | }; |
1947 | 1936 | ||
1948 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1937 | encode_compound_hdr(xdr, req, &hdr); |
1949 | encode_compound_hdr(&xdr, req, &hdr); | 1938 | encode_sequence(xdr, &args->seq_args, &hdr); |
1950 | encode_sequence(&xdr, &args->seq_args, &hdr); | 1939 | encode_putfh(xdr, args->fh, &hdr); |
1951 | encode_putfh(&xdr, args->fh, &hdr); | 1940 | encode_savefh(xdr, &hdr); |
1952 | encode_savefh(&xdr, &hdr); | 1941 | encode_putfh(xdr, args->dir_fh, &hdr); |
1953 | encode_putfh(&xdr, args->dir_fh, &hdr); | 1942 | encode_link(xdr, args->name, &hdr); |
1954 | encode_link(&xdr, args->name, &hdr); | 1943 | encode_getfattr(xdr, args->bitmask, &hdr); |
1955 | encode_getfattr(&xdr, args->bitmask, &hdr); | 1944 | encode_restorefh(xdr, &hdr); |
1956 | encode_restorefh(&xdr, &hdr); | 1945 | encode_getfattr(xdr, args->bitmask, &hdr); |
1957 | encode_getfattr(&xdr, args->bitmask, &hdr); | ||
1958 | encode_nops(&hdr); | 1946 | encode_nops(&hdr); |
1959 | return 0; | ||
1960 | } | 1947 | } |
1961 | 1948 | ||
1962 | /* | 1949 | /* |
1963 | * Encode CREATE request | 1950 | * Encode CREATE request |
1964 | */ | 1951 | */ |
1965 | static int nfs4_xdr_enc_create(struct rpc_rqst *req, __be32 *p, const struct nfs4_create_arg *args) | 1952 | static void nfs4_xdr_enc_create(struct rpc_rqst *req, struct xdr_stream *xdr, |
1953 | const struct nfs4_create_arg *args) | ||
1966 | { | 1954 | { |
1967 | struct xdr_stream xdr; | ||
1968 | struct compound_hdr hdr = { | 1955 | struct compound_hdr hdr = { |
1969 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 1956 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
1970 | }; | 1957 | }; |
1971 | 1958 | ||
1972 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1959 | encode_compound_hdr(xdr, req, &hdr); |
1973 | encode_compound_hdr(&xdr, req, &hdr); | 1960 | encode_sequence(xdr, &args->seq_args, &hdr); |
1974 | encode_sequence(&xdr, &args->seq_args, &hdr); | 1961 | encode_putfh(xdr, args->dir_fh, &hdr); |
1975 | encode_putfh(&xdr, args->dir_fh, &hdr); | 1962 | encode_savefh(xdr, &hdr); |
1976 | encode_savefh(&xdr, &hdr); | 1963 | encode_create(xdr, args, &hdr); |
1977 | encode_create(&xdr, args, &hdr); | 1964 | encode_getfh(xdr, &hdr); |
1978 | encode_getfh(&xdr, &hdr); | 1965 | encode_getfattr(xdr, args->bitmask, &hdr); |
1979 | encode_getfattr(&xdr, args->bitmask, &hdr); | 1966 | encode_restorefh(xdr, &hdr); |
1980 | encode_restorefh(&xdr, &hdr); | 1967 | encode_getfattr(xdr, args->bitmask, &hdr); |
1981 | encode_getfattr(&xdr, args->bitmask, &hdr); | ||
1982 | encode_nops(&hdr); | 1968 | encode_nops(&hdr); |
1983 | return 0; | ||
1984 | } | 1969 | } |
1985 | 1970 | ||
1986 | /* | 1971 | /* |
1987 | * Encode SYMLINK request | 1972 | * Encode SYMLINK request |
1988 | */ | 1973 | */ |
1989 | static int nfs4_xdr_enc_symlink(struct rpc_rqst *req, __be32 *p, const struct nfs4_create_arg *args) | 1974 | static void nfs4_xdr_enc_symlink(struct rpc_rqst *req, struct xdr_stream *xdr, |
1975 | const struct nfs4_create_arg *args) | ||
1990 | { | 1976 | { |
1991 | return nfs4_xdr_enc_create(req, p, args); | 1977 | nfs4_xdr_enc_create(req, xdr, args); |
1992 | } | 1978 | } |
1993 | 1979 | ||
1994 | /* | 1980 | /* |
1995 | * Encode GETATTR request | 1981 | * Encode GETATTR request |
1996 | */ | 1982 | */ |
1997 | static int nfs4_xdr_enc_getattr(struct rpc_rqst *req, __be32 *p, const struct nfs4_getattr_arg *args) | 1983 | static void nfs4_xdr_enc_getattr(struct rpc_rqst *req, struct xdr_stream *xdr, |
1984 | const struct nfs4_getattr_arg *args) | ||
1998 | { | 1985 | { |
1999 | struct xdr_stream xdr; | ||
2000 | struct compound_hdr hdr = { | 1986 | struct compound_hdr hdr = { |
2001 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 1987 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
2002 | }; | 1988 | }; |
2003 | 1989 | ||
2004 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1990 | encode_compound_hdr(xdr, req, &hdr); |
2005 | encode_compound_hdr(&xdr, req, &hdr); | 1991 | encode_sequence(xdr, &args->seq_args, &hdr); |
2006 | encode_sequence(&xdr, &args->seq_args, &hdr); | 1992 | encode_putfh(xdr, args->fh, &hdr); |
2007 | encode_putfh(&xdr, args->fh, &hdr); | 1993 | encode_getfattr(xdr, args->bitmask, &hdr); |
2008 | encode_getfattr(&xdr, args->bitmask, &hdr); | ||
2009 | encode_nops(&hdr); | 1994 | encode_nops(&hdr); |
2010 | return 0; | ||
2011 | } | 1995 | } |
2012 | 1996 | ||
2013 | /* | 1997 | /* |
2014 | * Encode a CLOSE request | 1998 | * Encode a CLOSE request |
2015 | */ | 1999 | */ |
2016 | static int nfs4_xdr_enc_close(struct rpc_rqst *req, __be32 *p, struct nfs_closeargs *args) | 2000 | static void nfs4_xdr_enc_close(struct rpc_rqst *req, struct xdr_stream *xdr, |
2001 | struct nfs_closeargs *args) | ||
2017 | { | 2002 | { |
2018 | struct xdr_stream xdr; | ||
2019 | struct compound_hdr hdr = { | 2003 | struct compound_hdr hdr = { |
2020 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 2004 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
2021 | }; | 2005 | }; |
2022 | 2006 | ||
2023 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2007 | encode_compound_hdr(xdr, req, &hdr); |
2024 | encode_compound_hdr(&xdr, req, &hdr); | 2008 | encode_sequence(xdr, &args->seq_args, &hdr); |
2025 | encode_sequence(&xdr, &args->seq_args, &hdr); | 2009 | encode_putfh(xdr, args->fh, &hdr); |
2026 | encode_putfh(&xdr, args->fh, &hdr); | 2010 | encode_close(xdr, args, &hdr); |
2027 | encode_close(&xdr, args, &hdr); | 2011 | encode_getfattr(xdr, args->bitmask, &hdr); |
2028 | encode_getfattr(&xdr, args->bitmask, &hdr); | ||
2029 | encode_nops(&hdr); | 2012 | encode_nops(&hdr); |
2030 | return 0; | ||
2031 | } | 2013 | } |
2032 | 2014 | ||
2033 | /* | 2015 | /* |
2034 | * Encode an OPEN request | 2016 | * Encode an OPEN request |
2035 | */ | 2017 | */ |
2036 | static int nfs4_xdr_enc_open(struct rpc_rqst *req, __be32 *p, struct nfs_openargs *args) | 2018 | static void nfs4_xdr_enc_open(struct rpc_rqst *req, struct xdr_stream *xdr, |
2019 | struct nfs_openargs *args) | ||
2037 | { | 2020 | { |
2038 | struct xdr_stream xdr; | ||
2039 | struct compound_hdr hdr = { | 2021 | struct compound_hdr hdr = { |
2040 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 2022 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
2041 | }; | 2023 | }; |
2042 | 2024 | ||
2043 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2025 | encode_compound_hdr(xdr, req, &hdr); |
2044 | encode_compound_hdr(&xdr, req, &hdr); | 2026 | encode_sequence(xdr, &args->seq_args, &hdr); |
2045 | encode_sequence(&xdr, &args->seq_args, &hdr); | 2027 | encode_putfh(xdr, args->fh, &hdr); |
2046 | encode_putfh(&xdr, args->fh, &hdr); | 2028 | encode_savefh(xdr, &hdr); |
2047 | encode_savefh(&xdr, &hdr); | 2029 | encode_open(xdr, args, &hdr); |
2048 | encode_open(&xdr, args, &hdr); | 2030 | encode_getfh(xdr, &hdr); |
2049 | encode_getfh(&xdr, &hdr); | 2031 | encode_getfattr(xdr, args->bitmask, &hdr); |
2050 | encode_getfattr(&xdr, args->bitmask, &hdr); | 2032 | encode_restorefh(xdr, &hdr); |
2051 | encode_restorefh(&xdr, &hdr); | 2033 | encode_getfattr(xdr, args->bitmask, &hdr); |
2052 | encode_getfattr(&xdr, args->bitmask, &hdr); | ||
2053 | encode_nops(&hdr); | 2034 | encode_nops(&hdr); |
2054 | return 0; | ||
2055 | } | 2035 | } |
2056 | 2036 | ||
2057 | /* | 2037 | /* |
2058 | * Encode an OPEN_CONFIRM request | 2038 | * Encode an OPEN_CONFIRM request |
2059 | */ | 2039 | */ |
2060 | static int nfs4_xdr_enc_open_confirm(struct rpc_rqst *req, __be32 *p, struct nfs_open_confirmargs *args) | 2040 | static void nfs4_xdr_enc_open_confirm(struct rpc_rqst *req, |
2041 | struct xdr_stream *xdr, | ||
2042 | struct nfs_open_confirmargs *args) | ||
2061 | { | 2043 | { |
2062 | struct xdr_stream xdr; | ||
2063 | struct compound_hdr hdr = { | 2044 | struct compound_hdr hdr = { |
2064 | .nops = 0, | 2045 | .nops = 0, |
2065 | }; | 2046 | }; |
2066 | 2047 | ||
2067 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2048 | encode_compound_hdr(xdr, req, &hdr); |
2068 | encode_compound_hdr(&xdr, req, &hdr); | 2049 | encode_putfh(xdr, args->fh, &hdr); |
2069 | encode_putfh(&xdr, args->fh, &hdr); | 2050 | encode_open_confirm(xdr, args, &hdr); |
2070 | encode_open_confirm(&xdr, args, &hdr); | ||
2071 | encode_nops(&hdr); | 2051 | encode_nops(&hdr); |
2072 | return 0; | ||
2073 | } | 2052 | } |
2074 | 2053 | ||
2075 | /* | 2054 | /* |
2076 | * Encode an OPEN request with no attributes. | 2055 | * Encode an OPEN request with no attributes. |
2077 | */ | 2056 | */ |
2078 | static int nfs4_xdr_enc_open_noattr(struct rpc_rqst *req, __be32 *p, struct nfs_openargs *args) | 2057 | static void nfs4_xdr_enc_open_noattr(struct rpc_rqst *req, |
2058 | struct xdr_stream *xdr, | ||
2059 | struct nfs_openargs *args) | ||
2079 | { | 2060 | { |
2080 | struct xdr_stream xdr; | ||
2081 | struct compound_hdr hdr = { | 2061 | struct compound_hdr hdr = { |
2082 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 2062 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
2083 | }; | 2063 | }; |
2084 | 2064 | ||
2085 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2065 | encode_compound_hdr(xdr, req, &hdr); |
2086 | encode_compound_hdr(&xdr, req, &hdr); | 2066 | encode_sequence(xdr, &args->seq_args, &hdr); |
2087 | encode_sequence(&xdr, &args->seq_args, &hdr); | 2067 | encode_putfh(xdr, args->fh, &hdr); |
2088 | encode_putfh(&xdr, args->fh, &hdr); | 2068 | encode_open(xdr, args, &hdr); |
2089 | encode_open(&xdr, args, &hdr); | 2069 | encode_getfattr(xdr, args->bitmask, &hdr); |
2090 | encode_getfattr(&xdr, args->bitmask, &hdr); | ||
2091 | encode_nops(&hdr); | 2070 | encode_nops(&hdr); |
2092 | return 0; | ||
2093 | } | 2071 | } |
2094 | 2072 | ||
2095 | /* | 2073 | /* |
2096 | * Encode an OPEN_DOWNGRADE request | 2074 | * Encode an OPEN_DOWNGRADE request |
2097 | */ | 2075 | */ |
2098 | static int nfs4_xdr_enc_open_downgrade(struct rpc_rqst *req, __be32 *p, struct nfs_closeargs *args) | 2076 | static void nfs4_xdr_enc_open_downgrade(struct rpc_rqst *req, |
2077 | struct xdr_stream *xdr, | ||
2078 | struct nfs_closeargs *args) | ||
2099 | { | 2079 | { |
2100 | struct xdr_stream xdr; | ||
2101 | struct compound_hdr hdr = { | 2080 | struct compound_hdr hdr = { |
2102 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 2081 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
2103 | }; | 2082 | }; |
2104 | 2083 | ||
2105 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2084 | encode_compound_hdr(xdr, req, &hdr); |
2106 | encode_compound_hdr(&xdr, req, &hdr); | 2085 | encode_sequence(xdr, &args->seq_args, &hdr); |
2107 | encode_sequence(&xdr, &args->seq_args, &hdr); | 2086 | encode_putfh(xdr, args->fh, &hdr); |
2108 | encode_putfh(&xdr, args->fh, &hdr); | 2087 | encode_open_downgrade(xdr, args, &hdr); |
2109 | encode_open_downgrade(&xdr, args, &hdr); | 2088 | encode_getfattr(xdr, args->bitmask, &hdr); |
2110 | encode_getfattr(&xdr, args->bitmask, &hdr); | ||
2111 | encode_nops(&hdr); | 2089 | encode_nops(&hdr); |
2112 | return 0; | ||
2113 | } | 2090 | } |
2114 | 2091 | ||
2115 | /* | 2092 | /* |
2116 | * Encode a LOCK request | 2093 | * Encode a LOCK request |
2117 | */ | 2094 | */ |
2118 | static int nfs4_xdr_enc_lock(struct rpc_rqst *req, __be32 *p, struct nfs_lock_args *args) | 2095 | static void nfs4_xdr_enc_lock(struct rpc_rqst *req, struct xdr_stream *xdr, |
2096 | struct nfs_lock_args *args) | ||
2119 | { | 2097 | { |
2120 | struct xdr_stream xdr; | ||
2121 | struct compound_hdr hdr = { | 2098 | struct compound_hdr hdr = { |
2122 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 2099 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
2123 | }; | 2100 | }; |
2124 | 2101 | ||
2125 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2102 | encode_compound_hdr(xdr, req, &hdr); |
2126 | encode_compound_hdr(&xdr, req, &hdr); | 2103 | encode_sequence(xdr, &args->seq_args, &hdr); |
2127 | encode_sequence(&xdr, &args->seq_args, &hdr); | 2104 | encode_putfh(xdr, args->fh, &hdr); |
2128 | encode_putfh(&xdr, args->fh, &hdr); | 2105 | encode_lock(xdr, args, &hdr); |
2129 | encode_lock(&xdr, args, &hdr); | ||
2130 | encode_nops(&hdr); | 2106 | encode_nops(&hdr); |
2131 | return 0; | ||
2132 | } | 2107 | } |
2133 | 2108 | ||
2134 | /* | 2109 | /* |
2135 | * Encode a LOCKT request | 2110 | * Encode a LOCKT request |
2136 | */ | 2111 | */ |
2137 | static int nfs4_xdr_enc_lockt(struct rpc_rqst *req, __be32 *p, struct nfs_lockt_args *args) | 2112 | static void nfs4_xdr_enc_lockt(struct rpc_rqst *req, struct xdr_stream *xdr, |
2113 | struct nfs_lockt_args *args) | ||
2138 | { | 2114 | { |
2139 | struct xdr_stream xdr; | ||
2140 | struct compound_hdr hdr = { | 2115 | struct compound_hdr hdr = { |
2141 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 2116 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
2142 | }; | 2117 | }; |
2143 | 2118 | ||
2144 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2119 | encode_compound_hdr(xdr, req, &hdr); |
2145 | encode_compound_hdr(&xdr, req, &hdr); | 2120 | encode_sequence(xdr, &args->seq_args, &hdr); |
2146 | encode_sequence(&xdr, &args->seq_args, &hdr); | 2121 | encode_putfh(xdr, args->fh, &hdr); |
2147 | encode_putfh(&xdr, args->fh, &hdr); | 2122 | encode_lockt(xdr, args, &hdr); |
2148 | encode_lockt(&xdr, args, &hdr); | ||
2149 | encode_nops(&hdr); | 2123 | encode_nops(&hdr); |
2150 | return 0; | ||
2151 | } | 2124 | } |
2152 | 2125 | ||
2153 | /* | 2126 | /* |
2154 | * Encode a LOCKU request | 2127 | * Encode a LOCKU request |
2155 | */ | 2128 | */ |
2156 | static int nfs4_xdr_enc_locku(struct rpc_rqst *req, __be32 *p, struct nfs_locku_args *args) | 2129 | static void nfs4_xdr_enc_locku(struct rpc_rqst *req, struct xdr_stream *xdr, |
2130 | struct nfs_locku_args *args) | ||
2157 | { | 2131 | { |
2158 | struct xdr_stream xdr; | ||
2159 | struct compound_hdr hdr = { | 2132 | struct compound_hdr hdr = { |
2160 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 2133 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
2161 | }; | 2134 | }; |
2162 | 2135 | ||
2163 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2136 | encode_compound_hdr(xdr, req, &hdr); |
2164 | encode_compound_hdr(&xdr, req, &hdr); | 2137 | encode_sequence(xdr, &args->seq_args, &hdr); |
2165 | encode_sequence(&xdr, &args->seq_args, &hdr); | 2138 | encode_putfh(xdr, args->fh, &hdr); |
2166 | encode_putfh(&xdr, args->fh, &hdr); | 2139 | encode_locku(xdr, args, &hdr); |
2167 | encode_locku(&xdr, args, &hdr); | ||
2168 | encode_nops(&hdr); | 2140 | encode_nops(&hdr); |
2169 | return 0; | ||
2170 | } | 2141 | } |
2171 | 2142 | ||
2172 | static int nfs4_xdr_enc_release_lockowner(struct rpc_rqst *req, __be32 *p, struct nfs_release_lockowner_args *args) | 2143 | static void nfs4_xdr_enc_release_lockowner(struct rpc_rqst *req, |
2144 | struct xdr_stream *xdr, | ||
2145 | struct nfs_release_lockowner_args *args) | ||
2173 | { | 2146 | { |
2174 | struct xdr_stream xdr; | ||
2175 | struct compound_hdr hdr = { | 2147 | struct compound_hdr hdr = { |
2176 | .minorversion = 0, | 2148 | .minorversion = 0, |
2177 | }; | 2149 | }; |
2178 | 2150 | ||
2179 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2151 | encode_compound_hdr(xdr, req, &hdr); |
2180 | encode_compound_hdr(&xdr, req, &hdr); | 2152 | encode_release_lockowner(xdr, &args->lock_owner, &hdr); |
2181 | encode_release_lockowner(&xdr, &args->lock_owner, &hdr); | ||
2182 | encode_nops(&hdr); | 2153 | encode_nops(&hdr); |
2183 | return 0; | ||
2184 | } | 2154 | } |
2185 | 2155 | ||
2186 | /* | 2156 | /* |
2187 | * Encode a READLINK request | 2157 | * Encode a READLINK request |
2188 | */ | 2158 | */ |
2189 | static int nfs4_xdr_enc_readlink(struct rpc_rqst *req, __be32 *p, const struct nfs4_readlink *args) | 2159 | static void nfs4_xdr_enc_readlink(struct rpc_rqst *req, struct xdr_stream *xdr, |
2160 | const struct nfs4_readlink *args) | ||
2190 | { | 2161 | { |
2191 | struct xdr_stream xdr; | ||
2192 | struct compound_hdr hdr = { | 2162 | struct compound_hdr hdr = { |
2193 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 2163 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
2194 | }; | 2164 | }; |
2195 | 2165 | ||
2196 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2166 | encode_compound_hdr(xdr, req, &hdr); |
2197 | encode_compound_hdr(&xdr, req, &hdr); | 2167 | encode_sequence(xdr, &args->seq_args, &hdr); |
2198 | encode_sequence(&xdr, &args->seq_args, &hdr); | 2168 | encode_putfh(xdr, args->fh, &hdr); |
2199 | encode_putfh(&xdr, args->fh, &hdr); | 2169 | encode_readlink(xdr, args, req, &hdr); |
2200 | encode_readlink(&xdr, args, req, &hdr); | ||
2201 | 2170 | ||
2202 | xdr_inline_pages(&req->rq_rcv_buf, hdr.replen << 2, args->pages, | 2171 | xdr_inline_pages(&req->rq_rcv_buf, hdr.replen << 2, args->pages, |
2203 | args->pgbase, args->pglen); | 2172 | args->pgbase, args->pglen); |
2204 | encode_nops(&hdr); | 2173 | encode_nops(&hdr); |
2205 | return 0; | ||
2206 | } | 2174 | } |
2207 | 2175 | ||
2208 | /* | 2176 | /* |
2209 | * Encode a READDIR request | 2177 | * Encode a READDIR request |
2210 | */ | 2178 | */ |
2211 | static int nfs4_xdr_enc_readdir(struct rpc_rqst *req, __be32 *p, const struct nfs4_readdir_arg *args) | 2179 | static void nfs4_xdr_enc_readdir(struct rpc_rqst *req, struct xdr_stream *xdr, |
2180 | const struct nfs4_readdir_arg *args) | ||
2212 | { | 2181 | { |
2213 | struct xdr_stream xdr; | ||
2214 | struct compound_hdr hdr = { | 2182 | struct compound_hdr hdr = { |
2215 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 2183 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
2216 | }; | 2184 | }; |
2217 | 2185 | ||
2218 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2186 | encode_compound_hdr(xdr, req, &hdr); |
2219 | encode_compound_hdr(&xdr, req, &hdr); | 2187 | encode_sequence(xdr, &args->seq_args, &hdr); |
2220 | encode_sequence(&xdr, &args->seq_args, &hdr); | 2188 | encode_putfh(xdr, args->fh, &hdr); |
2221 | encode_putfh(&xdr, args->fh, &hdr); | 2189 | encode_readdir(xdr, args, req, &hdr); |
2222 | encode_readdir(&xdr, args, req, &hdr); | ||
2223 | 2190 | ||
2224 | xdr_inline_pages(&req->rq_rcv_buf, hdr.replen << 2, args->pages, | 2191 | xdr_inline_pages(&req->rq_rcv_buf, hdr.replen << 2, args->pages, |
2225 | args->pgbase, args->count); | 2192 | args->pgbase, args->count); |
@@ -2227,428 +2194,387 @@ static int nfs4_xdr_enc_readdir(struct rpc_rqst *req, __be32 *p, const struct nf | |||
2227 | __func__, hdr.replen << 2, args->pages, | 2194 | __func__, hdr.replen << 2, args->pages, |
2228 | args->pgbase, args->count); | 2195 | args->pgbase, args->count); |
2229 | encode_nops(&hdr); | 2196 | encode_nops(&hdr); |
2230 | return 0; | ||
2231 | } | 2197 | } |
2232 | 2198 | ||
2233 | /* | 2199 | /* |
2234 | * Encode a READ request | 2200 | * Encode a READ request |
2235 | */ | 2201 | */ |
2236 | static int nfs4_xdr_enc_read(struct rpc_rqst *req, __be32 *p, struct nfs_readargs *args) | 2202 | static void nfs4_xdr_enc_read(struct rpc_rqst *req, struct xdr_stream *xdr, |
2203 | struct nfs_readargs *args) | ||
2237 | { | 2204 | { |
2238 | struct xdr_stream xdr; | ||
2239 | struct compound_hdr hdr = { | 2205 | struct compound_hdr hdr = { |
2240 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 2206 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
2241 | }; | 2207 | }; |
2242 | 2208 | ||
2243 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2209 | encode_compound_hdr(xdr, req, &hdr); |
2244 | encode_compound_hdr(&xdr, req, &hdr); | 2210 | encode_sequence(xdr, &args->seq_args, &hdr); |
2245 | encode_sequence(&xdr, &args->seq_args, &hdr); | 2211 | encode_putfh(xdr, args->fh, &hdr); |
2246 | encode_putfh(&xdr, args->fh, &hdr); | 2212 | encode_read(xdr, args, &hdr); |
2247 | encode_read(&xdr, args, &hdr); | ||
2248 | 2213 | ||
2249 | xdr_inline_pages(&req->rq_rcv_buf, hdr.replen << 2, | 2214 | xdr_inline_pages(&req->rq_rcv_buf, hdr.replen << 2, |
2250 | args->pages, args->pgbase, args->count); | 2215 | args->pages, args->pgbase, args->count); |
2251 | req->rq_rcv_buf.flags |= XDRBUF_READ; | 2216 | req->rq_rcv_buf.flags |= XDRBUF_READ; |
2252 | encode_nops(&hdr); | 2217 | encode_nops(&hdr); |
2253 | return 0; | ||
2254 | } | 2218 | } |
2255 | 2219 | ||
2256 | /* | 2220 | /* |
2257 | * Encode an SETATTR request | 2221 | * Encode an SETATTR request |
2258 | */ | 2222 | */ |
2259 | static int nfs4_xdr_enc_setattr(struct rpc_rqst *req, __be32 *p, struct nfs_setattrargs *args) | 2223 | static void nfs4_xdr_enc_setattr(struct rpc_rqst *req, struct xdr_stream *xdr, |
2224 | struct nfs_setattrargs *args) | ||
2260 | { | 2225 | { |
2261 | struct xdr_stream xdr; | ||
2262 | struct compound_hdr hdr = { | 2226 | struct compound_hdr hdr = { |
2263 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 2227 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
2264 | }; | 2228 | }; |
2265 | 2229 | ||
2266 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2230 | encode_compound_hdr(xdr, req, &hdr); |
2267 | encode_compound_hdr(&xdr, req, &hdr); | 2231 | encode_sequence(xdr, &args->seq_args, &hdr); |
2268 | encode_sequence(&xdr, &args->seq_args, &hdr); | 2232 | encode_putfh(xdr, args->fh, &hdr); |
2269 | encode_putfh(&xdr, args->fh, &hdr); | 2233 | encode_setattr(xdr, args, args->server, &hdr); |
2270 | encode_setattr(&xdr, args, args->server, &hdr); | 2234 | encode_getfattr(xdr, args->bitmask, &hdr); |
2271 | encode_getfattr(&xdr, args->bitmask, &hdr); | ||
2272 | encode_nops(&hdr); | 2235 | encode_nops(&hdr); |
2273 | return 0; | ||
2274 | } | 2236 | } |
2275 | 2237 | ||
2276 | /* | 2238 | /* |
2277 | * Encode a GETACL request | 2239 | * Encode a GETACL request |
2278 | */ | 2240 | */ |
2279 | static int | 2241 | static void nfs4_xdr_enc_getacl(struct rpc_rqst *req, struct xdr_stream *xdr, |
2280 | nfs4_xdr_enc_getacl(struct rpc_rqst *req, __be32 *p, | 2242 | struct nfs_getaclargs *args) |
2281 | struct nfs_getaclargs *args) | ||
2282 | { | 2243 | { |
2283 | struct xdr_stream xdr; | ||
2284 | struct compound_hdr hdr = { | 2244 | struct compound_hdr hdr = { |
2285 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 2245 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
2286 | }; | 2246 | }; |
2287 | uint32_t replen; | 2247 | uint32_t replen; |
2288 | 2248 | ||
2289 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2249 | encode_compound_hdr(xdr, req, &hdr); |
2290 | encode_compound_hdr(&xdr, req, &hdr); | 2250 | encode_sequence(xdr, &args->seq_args, &hdr); |
2291 | encode_sequence(&xdr, &args->seq_args, &hdr); | 2251 | encode_putfh(xdr, args->fh, &hdr); |
2292 | encode_putfh(&xdr, args->fh, &hdr); | ||
2293 | replen = hdr.replen + op_decode_hdr_maxsz + nfs4_fattr_bitmap_maxsz + 1; | 2252 | replen = hdr.replen + op_decode_hdr_maxsz + nfs4_fattr_bitmap_maxsz + 1; |
2294 | encode_getattr_two(&xdr, FATTR4_WORD0_ACL, 0, &hdr); | 2253 | encode_getattr_two(xdr, FATTR4_WORD0_ACL, 0, &hdr); |
2295 | 2254 | ||
2296 | xdr_inline_pages(&req->rq_rcv_buf, replen << 2, | 2255 | xdr_inline_pages(&req->rq_rcv_buf, replen << 2, |
2297 | args->acl_pages, args->acl_pgbase, args->acl_len); | 2256 | args->acl_pages, args->acl_pgbase, args->acl_len); |
2298 | encode_nops(&hdr); | 2257 | encode_nops(&hdr); |
2299 | return 0; | ||
2300 | } | 2258 | } |
2301 | 2259 | ||
2302 | /* | 2260 | /* |
2303 | * Encode a WRITE request | 2261 | * Encode a WRITE request |
2304 | */ | 2262 | */ |
2305 | static int nfs4_xdr_enc_write(struct rpc_rqst *req, __be32 *p, struct nfs_writeargs *args) | 2263 | static void nfs4_xdr_enc_write(struct rpc_rqst *req, struct xdr_stream *xdr, |
2264 | struct nfs_writeargs *args) | ||
2306 | { | 2265 | { |
2307 | struct xdr_stream xdr; | ||
2308 | struct compound_hdr hdr = { | 2266 | struct compound_hdr hdr = { |
2309 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 2267 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
2310 | }; | 2268 | }; |
2311 | 2269 | ||
2312 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2270 | encode_compound_hdr(xdr, req, &hdr); |
2313 | encode_compound_hdr(&xdr, req, &hdr); | 2271 | encode_sequence(xdr, &args->seq_args, &hdr); |
2314 | encode_sequence(&xdr, &args->seq_args, &hdr); | 2272 | encode_putfh(xdr, args->fh, &hdr); |
2315 | encode_putfh(&xdr, args->fh, &hdr); | 2273 | encode_write(xdr, args, &hdr); |
2316 | encode_write(&xdr, args, &hdr); | ||
2317 | req->rq_snd_buf.flags |= XDRBUF_WRITE; | 2274 | req->rq_snd_buf.flags |= XDRBUF_WRITE; |
2318 | encode_getfattr(&xdr, args->bitmask, &hdr); | 2275 | encode_getfattr(xdr, args->bitmask, &hdr); |
2319 | encode_nops(&hdr); | 2276 | encode_nops(&hdr); |
2320 | return 0; | ||
2321 | } | 2277 | } |
2322 | 2278 | ||
2323 | /* | 2279 | /* |
2324 | * a COMMIT request | 2280 | * a COMMIT request |
2325 | */ | 2281 | */ |
2326 | static int nfs4_xdr_enc_commit(struct rpc_rqst *req, __be32 *p, struct nfs_writeargs *args) | 2282 | static void nfs4_xdr_enc_commit(struct rpc_rqst *req, struct xdr_stream *xdr, |
2283 | struct nfs_writeargs *args) | ||
2327 | { | 2284 | { |
2328 | struct xdr_stream xdr; | ||
2329 | struct compound_hdr hdr = { | 2285 | struct compound_hdr hdr = { |
2330 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 2286 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
2331 | }; | 2287 | }; |
2332 | 2288 | ||
2333 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2289 | encode_compound_hdr(xdr, req, &hdr); |
2334 | encode_compound_hdr(&xdr, req, &hdr); | 2290 | encode_sequence(xdr, &args->seq_args, &hdr); |
2335 | encode_sequence(&xdr, &args->seq_args, &hdr); | 2291 | encode_putfh(xdr, args->fh, &hdr); |
2336 | encode_putfh(&xdr, args->fh, &hdr); | 2292 | encode_commit(xdr, args, &hdr); |
2337 | encode_commit(&xdr, args, &hdr); | 2293 | encode_getfattr(xdr, args->bitmask, &hdr); |
2338 | encode_getfattr(&xdr, args->bitmask, &hdr); | ||
2339 | encode_nops(&hdr); | 2294 | encode_nops(&hdr); |
2340 | return 0; | ||
2341 | } | 2295 | } |
2342 | 2296 | ||
2343 | /* | 2297 | /* |
2344 | * FSINFO request | 2298 | * FSINFO request |
2345 | */ | 2299 | */ |
2346 | static int nfs4_xdr_enc_fsinfo(struct rpc_rqst *req, __be32 *p, struct nfs4_fsinfo_arg *args) | 2300 | static void nfs4_xdr_enc_fsinfo(struct rpc_rqst *req, struct xdr_stream *xdr, |
2301 | struct nfs4_fsinfo_arg *args) | ||
2347 | { | 2302 | { |
2348 | struct xdr_stream xdr; | ||
2349 | struct compound_hdr hdr = { | 2303 | struct compound_hdr hdr = { |
2350 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 2304 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
2351 | }; | 2305 | }; |
2352 | 2306 | ||
2353 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2307 | encode_compound_hdr(xdr, req, &hdr); |
2354 | encode_compound_hdr(&xdr, req, &hdr); | 2308 | encode_sequence(xdr, &args->seq_args, &hdr); |
2355 | encode_sequence(&xdr, &args->seq_args, &hdr); | 2309 | encode_putfh(xdr, args->fh, &hdr); |
2356 | encode_putfh(&xdr, args->fh, &hdr); | 2310 | encode_fsinfo(xdr, args->bitmask, &hdr); |
2357 | encode_fsinfo(&xdr, args->bitmask, &hdr); | ||
2358 | encode_nops(&hdr); | 2311 | encode_nops(&hdr); |
2359 | return 0; | ||
2360 | } | 2312 | } |
2361 | 2313 | ||
2362 | /* | 2314 | /* |
2363 | * a PATHCONF request | 2315 | * a PATHCONF request |
2364 | */ | 2316 | */ |
2365 | static int nfs4_xdr_enc_pathconf(struct rpc_rqst *req, __be32 *p, const struct nfs4_pathconf_arg *args) | 2317 | static void nfs4_xdr_enc_pathconf(struct rpc_rqst *req, struct xdr_stream *xdr, |
2318 | const struct nfs4_pathconf_arg *args) | ||
2366 | { | 2319 | { |
2367 | struct xdr_stream xdr; | ||
2368 | struct compound_hdr hdr = { | 2320 | struct compound_hdr hdr = { |
2369 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 2321 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
2370 | }; | 2322 | }; |
2371 | 2323 | ||
2372 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2324 | encode_compound_hdr(xdr, req, &hdr); |
2373 | encode_compound_hdr(&xdr, req, &hdr); | 2325 | encode_sequence(xdr, &args->seq_args, &hdr); |
2374 | encode_sequence(&xdr, &args->seq_args, &hdr); | 2326 | encode_putfh(xdr, args->fh, &hdr); |
2375 | encode_putfh(&xdr, args->fh, &hdr); | 2327 | encode_getattr_one(xdr, args->bitmask[0] & nfs4_pathconf_bitmap[0], |
2376 | encode_getattr_one(&xdr, args->bitmask[0] & nfs4_pathconf_bitmap[0], | ||
2377 | &hdr); | 2328 | &hdr); |
2378 | encode_nops(&hdr); | 2329 | encode_nops(&hdr); |
2379 | return 0; | ||
2380 | } | 2330 | } |
2381 | 2331 | ||
2382 | /* | 2332 | /* |
2383 | * a STATFS request | 2333 | * a STATFS request |
2384 | */ | 2334 | */ |
2385 | static int nfs4_xdr_enc_statfs(struct rpc_rqst *req, __be32 *p, const struct nfs4_statfs_arg *args) | 2335 | static void nfs4_xdr_enc_statfs(struct rpc_rqst *req, struct xdr_stream *xdr, |
2336 | const struct nfs4_statfs_arg *args) | ||
2386 | { | 2337 | { |
2387 | struct xdr_stream xdr; | ||
2388 | struct compound_hdr hdr = { | 2338 | struct compound_hdr hdr = { |
2389 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 2339 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
2390 | }; | 2340 | }; |
2391 | 2341 | ||
2392 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2342 | encode_compound_hdr(xdr, req, &hdr); |
2393 | encode_compound_hdr(&xdr, req, &hdr); | 2343 | encode_sequence(xdr, &args->seq_args, &hdr); |
2394 | encode_sequence(&xdr, &args->seq_args, &hdr); | 2344 | encode_putfh(xdr, args->fh, &hdr); |
2395 | encode_putfh(&xdr, args->fh, &hdr); | 2345 | encode_getattr_two(xdr, args->bitmask[0] & nfs4_statfs_bitmap[0], |
2396 | encode_getattr_two(&xdr, args->bitmask[0] & nfs4_statfs_bitmap[0], | ||
2397 | args->bitmask[1] & nfs4_statfs_bitmap[1], &hdr); | 2346 | args->bitmask[1] & nfs4_statfs_bitmap[1], &hdr); |
2398 | encode_nops(&hdr); | 2347 | encode_nops(&hdr); |
2399 | return 0; | ||
2400 | } | 2348 | } |
2401 | 2349 | ||
2402 | /* | 2350 | /* |
2403 | * GETATTR_BITMAP request | 2351 | * GETATTR_BITMAP request |
2404 | */ | 2352 | */ |
2405 | static int nfs4_xdr_enc_server_caps(struct rpc_rqst *req, __be32 *p, | 2353 | static void nfs4_xdr_enc_server_caps(struct rpc_rqst *req, |
2406 | struct nfs4_server_caps_arg *args) | 2354 | struct xdr_stream *xdr, |
2355 | struct nfs4_server_caps_arg *args) | ||
2407 | { | 2356 | { |
2408 | struct xdr_stream xdr; | ||
2409 | struct compound_hdr hdr = { | 2357 | struct compound_hdr hdr = { |
2410 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 2358 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
2411 | }; | 2359 | }; |
2412 | 2360 | ||
2413 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2361 | encode_compound_hdr(xdr, req, &hdr); |
2414 | encode_compound_hdr(&xdr, req, &hdr); | 2362 | encode_sequence(xdr, &args->seq_args, &hdr); |
2415 | encode_sequence(&xdr, &args->seq_args, &hdr); | 2363 | encode_putfh(xdr, args->fhandle, &hdr); |
2416 | encode_putfh(&xdr, args->fhandle, &hdr); | 2364 | encode_getattr_one(xdr, FATTR4_WORD0_SUPPORTED_ATTRS| |
2417 | encode_getattr_one(&xdr, FATTR4_WORD0_SUPPORTED_ATTRS| | ||
2418 | FATTR4_WORD0_LINK_SUPPORT| | 2365 | FATTR4_WORD0_LINK_SUPPORT| |
2419 | FATTR4_WORD0_SYMLINK_SUPPORT| | 2366 | FATTR4_WORD0_SYMLINK_SUPPORT| |
2420 | FATTR4_WORD0_ACLSUPPORT, &hdr); | 2367 | FATTR4_WORD0_ACLSUPPORT, &hdr); |
2421 | encode_nops(&hdr); | 2368 | encode_nops(&hdr); |
2422 | return 0; | ||
2423 | } | 2369 | } |
2424 | 2370 | ||
2425 | /* | 2371 | /* |
2426 | * a RENEW request | 2372 | * a RENEW request |
2427 | */ | 2373 | */ |
2428 | static int nfs4_xdr_enc_renew(struct rpc_rqst *req, __be32 *p, struct nfs_client *clp) | 2374 | static void nfs4_xdr_enc_renew(struct rpc_rqst *req, struct xdr_stream *xdr, |
2375 | struct nfs_client *clp) | ||
2429 | { | 2376 | { |
2430 | struct xdr_stream xdr; | ||
2431 | struct compound_hdr hdr = { | 2377 | struct compound_hdr hdr = { |
2432 | .nops = 0, | 2378 | .nops = 0, |
2433 | }; | 2379 | }; |
2434 | 2380 | ||
2435 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2381 | encode_compound_hdr(xdr, req, &hdr); |
2436 | encode_compound_hdr(&xdr, req, &hdr); | 2382 | encode_renew(xdr, clp, &hdr); |
2437 | encode_renew(&xdr, clp, &hdr); | ||
2438 | encode_nops(&hdr); | 2383 | encode_nops(&hdr); |
2439 | return 0; | ||
2440 | } | 2384 | } |
2441 | 2385 | ||
2442 | /* | 2386 | /* |
2443 | * a SETCLIENTID request | 2387 | * a SETCLIENTID request |
2444 | */ | 2388 | */ |
2445 | static int nfs4_xdr_enc_setclientid(struct rpc_rqst *req, __be32 *p, struct nfs4_setclientid *sc) | 2389 | static void nfs4_xdr_enc_setclientid(struct rpc_rqst *req, |
2390 | struct xdr_stream *xdr, | ||
2391 | struct nfs4_setclientid *sc) | ||
2446 | { | 2392 | { |
2447 | struct xdr_stream xdr; | ||
2448 | struct compound_hdr hdr = { | 2393 | struct compound_hdr hdr = { |
2449 | .nops = 0, | 2394 | .nops = 0, |
2450 | }; | 2395 | }; |
2451 | 2396 | ||
2452 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2397 | encode_compound_hdr(xdr, req, &hdr); |
2453 | encode_compound_hdr(&xdr, req, &hdr); | 2398 | encode_setclientid(xdr, sc, &hdr); |
2454 | encode_setclientid(&xdr, sc, &hdr); | ||
2455 | encode_nops(&hdr); | 2399 | encode_nops(&hdr); |
2456 | return 0; | ||
2457 | } | 2400 | } |
2458 | 2401 | ||
2459 | /* | 2402 | /* |
2460 | * a SETCLIENTID_CONFIRM request | 2403 | * a SETCLIENTID_CONFIRM request |
2461 | */ | 2404 | */ |
2462 | static int nfs4_xdr_enc_setclientid_confirm(struct rpc_rqst *req, __be32 *p, struct nfs4_setclientid_res *arg) | 2405 | static void nfs4_xdr_enc_setclientid_confirm(struct rpc_rqst *req, |
2406 | struct xdr_stream *xdr, | ||
2407 | struct nfs4_setclientid_res *arg) | ||
2463 | { | 2408 | { |
2464 | struct xdr_stream xdr; | ||
2465 | struct compound_hdr hdr = { | 2409 | struct compound_hdr hdr = { |
2466 | .nops = 0, | 2410 | .nops = 0, |
2467 | }; | 2411 | }; |
2468 | const u32 lease_bitmap[2] = { FATTR4_WORD0_LEASE_TIME, 0 }; | 2412 | const u32 lease_bitmap[2] = { FATTR4_WORD0_LEASE_TIME, 0 }; |
2469 | 2413 | ||
2470 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2414 | encode_compound_hdr(xdr, req, &hdr); |
2471 | encode_compound_hdr(&xdr, req, &hdr); | 2415 | encode_setclientid_confirm(xdr, arg, &hdr); |
2472 | encode_setclientid_confirm(&xdr, arg, &hdr); | 2416 | encode_putrootfh(xdr, &hdr); |
2473 | encode_putrootfh(&xdr, &hdr); | 2417 | encode_fsinfo(xdr, lease_bitmap, &hdr); |
2474 | encode_fsinfo(&xdr, lease_bitmap, &hdr); | ||
2475 | encode_nops(&hdr); | 2418 | encode_nops(&hdr); |
2476 | return 0; | ||
2477 | } | 2419 | } |
2478 | 2420 | ||
2479 | /* | 2421 | /* |
2480 | * DELEGRETURN request | 2422 | * DELEGRETURN request |
2481 | */ | 2423 | */ |
2482 | static int nfs4_xdr_enc_delegreturn(struct rpc_rqst *req, __be32 *p, const struct nfs4_delegreturnargs *args) | 2424 | static void nfs4_xdr_enc_delegreturn(struct rpc_rqst *req, |
2425 | struct xdr_stream *xdr, | ||
2426 | const struct nfs4_delegreturnargs *args) | ||
2483 | { | 2427 | { |
2484 | struct xdr_stream xdr; | ||
2485 | struct compound_hdr hdr = { | 2428 | struct compound_hdr hdr = { |
2486 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 2429 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
2487 | }; | 2430 | }; |
2488 | 2431 | ||
2489 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2432 | encode_compound_hdr(xdr, req, &hdr); |
2490 | encode_compound_hdr(&xdr, req, &hdr); | 2433 | encode_sequence(xdr, &args->seq_args, &hdr); |
2491 | encode_sequence(&xdr, &args->seq_args, &hdr); | 2434 | encode_putfh(xdr, args->fhandle, &hdr); |
2492 | encode_putfh(&xdr, args->fhandle, &hdr); | 2435 | encode_delegreturn(xdr, args->stateid, &hdr); |
2493 | encode_delegreturn(&xdr, args->stateid, &hdr); | 2436 | encode_getfattr(xdr, args->bitmask, &hdr); |
2494 | encode_getfattr(&xdr, args->bitmask, &hdr); | ||
2495 | encode_nops(&hdr); | 2437 | encode_nops(&hdr); |
2496 | return 0; | ||
2497 | } | 2438 | } |
2498 | 2439 | ||
2499 | /* | 2440 | /* |
2500 | * Encode FS_LOCATIONS request | 2441 | * Encode FS_LOCATIONS request |
2501 | */ | 2442 | */ |
2502 | static int nfs4_xdr_enc_fs_locations(struct rpc_rqst *req, __be32 *p, struct nfs4_fs_locations_arg *args) | 2443 | static void nfs4_xdr_enc_fs_locations(struct rpc_rqst *req, |
2444 | struct xdr_stream *xdr, | ||
2445 | struct nfs4_fs_locations_arg *args) | ||
2503 | { | 2446 | { |
2504 | struct xdr_stream xdr; | ||
2505 | struct compound_hdr hdr = { | 2447 | struct compound_hdr hdr = { |
2506 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 2448 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
2507 | }; | 2449 | }; |
2508 | uint32_t replen; | 2450 | uint32_t replen; |
2509 | 2451 | ||
2510 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2452 | encode_compound_hdr(xdr, req, &hdr); |
2511 | encode_compound_hdr(&xdr, req, &hdr); | 2453 | encode_sequence(xdr, &args->seq_args, &hdr); |
2512 | encode_sequence(&xdr, &args->seq_args, &hdr); | 2454 | encode_putfh(xdr, args->dir_fh, &hdr); |
2513 | encode_putfh(&xdr, args->dir_fh, &hdr); | 2455 | encode_lookup(xdr, args->name, &hdr); |
2514 | encode_lookup(&xdr, args->name, &hdr); | ||
2515 | replen = hdr.replen; /* get the attribute into args->page */ | 2456 | replen = hdr.replen; /* get the attribute into args->page */ |
2516 | encode_fs_locations(&xdr, args->bitmask, &hdr); | 2457 | encode_fs_locations(xdr, args->bitmask, &hdr); |
2517 | 2458 | ||
2518 | xdr_inline_pages(&req->rq_rcv_buf, replen << 2, &args->page, | 2459 | xdr_inline_pages(&req->rq_rcv_buf, replen << 2, &args->page, |
2519 | 0, PAGE_SIZE); | 2460 | 0, PAGE_SIZE); |
2520 | encode_nops(&hdr); | 2461 | encode_nops(&hdr); |
2521 | return 0; | ||
2522 | } | 2462 | } |
2523 | 2463 | ||
2524 | #if defined(CONFIG_NFS_V4_1) | 2464 | #if defined(CONFIG_NFS_V4_1) |
2525 | /* | 2465 | /* |
2526 | * EXCHANGE_ID request | 2466 | * EXCHANGE_ID request |
2527 | */ | 2467 | */ |
2528 | static int nfs4_xdr_enc_exchange_id(struct rpc_rqst *req, uint32_t *p, | 2468 | static void nfs4_xdr_enc_exchange_id(struct rpc_rqst *req, |
2529 | struct nfs41_exchange_id_args *args) | 2469 | struct xdr_stream *xdr, |
2470 | struct nfs41_exchange_id_args *args) | ||
2530 | { | 2471 | { |
2531 | struct xdr_stream xdr; | ||
2532 | struct compound_hdr hdr = { | 2472 | struct compound_hdr hdr = { |
2533 | .minorversion = args->client->cl_mvops->minor_version, | 2473 | .minorversion = args->client->cl_mvops->minor_version, |
2534 | }; | 2474 | }; |
2535 | 2475 | ||
2536 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2476 | encode_compound_hdr(xdr, req, &hdr); |
2537 | encode_compound_hdr(&xdr, req, &hdr); | 2477 | encode_exchange_id(xdr, args, &hdr); |
2538 | encode_exchange_id(&xdr, args, &hdr); | ||
2539 | encode_nops(&hdr); | 2478 | encode_nops(&hdr); |
2540 | return 0; | ||
2541 | } | 2479 | } |
2542 | 2480 | ||
2543 | /* | 2481 | /* |
2544 | * a CREATE_SESSION request | 2482 | * a CREATE_SESSION request |
2545 | */ | 2483 | */ |
2546 | static int nfs4_xdr_enc_create_session(struct rpc_rqst *req, uint32_t *p, | 2484 | static void nfs4_xdr_enc_create_session(struct rpc_rqst *req, |
2547 | struct nfs41_create_session_args *args) | 2485 | struct xdr_stream *xdr, |
2486 | struct nfs41_create_session_args *args) | ||
2548 | { | 2487 | { |
2549 | struct xdr_stream xdr; | ||
2550 | struct compound_hdr hdr = { | 2488 | struct compound_hdr hdr = { |
2551 | .minorversion = args->client->cl_mvops->minor_version, | 2489 | .minorversion = args->client->cl_mvops->minor_version, |
2552 | }; | 2490 | }; |
2553 | 2491 | ||
2554 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2492 | encode_compound_hdr(xdr, req, &hdr); |
2555 | encode_compound_hdr(&xdr, req, &hdr); | 2493 | encode_create_session(xdr, args, &hdr); |
2556 | encode_create_session(&xdr, args, &hdr); | ||
2557 | encode_nops(&hdr); | 2494 | encode_nops(&hdr); |
2558 | return 0; | ||
2559 | } | 2495 | } |
2560 | 2496 | ||
2561 | /* | 2497 | /* |
2562 | * a DESTROY_SESSION request | 2498 | * a DESTROY_SESSION request |
2563 | */ | 2499 | */ |
2564 | static int nfs4_xdr_enc_destroy_session(struct rpc_rqst *req, uint32_t *p, | 2500 | static void nfs4_xdr_enc_destroy_session(struct rpc_rqst *req, |
2565 | struct nfs4_session *session) | 2501 | struct xdr_stream *xdr, |
2502 | struct nfs4_session *session) | ||
2566 | { | 2503 | { |
2567 | struct xdr_stream xdr; | ||
2568 | struct compound_hdr hdr = { | 2504 | struct compound_hdr hdr = { |
2569 | .minorversion = session->clp->cl_mvops->minor_version, | 2505 | .minorversion = session->clp->cl_mvops->minor_version, |
2570 | }; | 2506 | }; |
2571 | 2507 | ||
2572 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2508 | encode_compound_hdr(xdr, req, &hdr); |
2573 | encode_compound_hdr(&xdr, req, &hdr); | 2509 | encode_destroy_session(xdr, session, &hdr); |
2574 | encode_destroy_session(&xdr, session, &hdr); | ||
2575 | encode_nops(&hdr); | 2510 | encode_nops(&hdr); |
2576 | return 0; | ||
2577 | } | 2511 | } |
2578 | 2512 | ||
2579 | /* | 2513 | /* |
2580 | * a SEQUENCE request | 2514 | * a SEQUENCE request |
2581 | */ | 2515 | */ |
2582 | static int nfs4_xdr_enc_sequence(struct rpc_rqst *req, uint32_t *p, | 2516 | static void nfs4_xdr_enc_sequence(struct rpc_rqst *req, struct xdr_stream *xdr, |
2583 | struct nfs4_sequence_args *args) | 2517 | struct nfs4_sequence_args *args) |
2584 | { | 2518 | { |
2585 | struct xdr_stream xdr; | ||
2586 | struct compound_hdr hdr = { | 2519 | struct compound_hdr hdr = { |
2587 | .minorversion = nfs4_xdr_minorversion(args), | 2520 | .minorversion = nfs4_xdr_minorversion(args), |
2588 | }; | 2521 | }; |
2589 | 2522 | ||
2590 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2523 | encode_compound_hdr(xdr, req, &hdr); |
2591 | encode_compound_hdr(&xdr, req, &hdr); | 2524 | encode_sequence(xdr, args, &hdr); |
2592 | encode_sequence(&xdr, args, &hdr); | ||
2593 | encode_nops(&hdr); | 2525 | encode_nops(&hdr); |
2594 | return 0; | ||
2595 | } | 2526 | } |
2596 | 2527 | ||
2597 | /* | 2528 | /* |
2598 | * a GET_LEASE_TIME request | 2529 | * a GET_LEASE_TIME request |
2599 | */ | 2530 | */ |
2600 | static int nfs4_xdr_enc_get_lease_time(struct rpc_rqst *req, uint32_t *p, | 2531 | static void nfs4_xdr_enc_get_lease_time(struct rpc_rqst *req, |
2601 | struct nfs4_get_lease_time_args *args) | 2532 | struct xdr_stream *xdr, |
2533 | struct nfs4_get_lease_time_args *args) | ||
2602 | { | 2534 | { |
2603 | struct xdr_stream xdr; | ||
2604 | struct compound_hdr hdr = { | 2535 | struct compound_hdr hdr = { |
2605 | .minorversion = nfs4_xdr_minorversion(&args->la_seq_args), | 2536 | .minorversion = nfs4_xdr_minorversion(&args->la_seq_args), |
2606 | }; | 2537 | }; |
2607 | const u32 lease_bitmap[2] = { FATTR4_WORD0_LEASE_TIME, 0 }; | 2538 | const u32 lease_bitmap[2] = { FATTR4_WORD0_LEASE_TIME, 0 }; |
2608 | 2539 | ||
2609 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2540 | encode_compound_hdr(xdr, req, &hdr); |
2610 | encode_compound_hdr(&xdr, req, &hdr); | 2541 | encode_sequence(xdr, &args->la_seq_args, &hdr); |
2611 | encode_sequence(&xdr, &args->la_seq_args, &hdr); | 2542 | encode_putrootfh(xdr, &hdr); |
2612 | encode_putrootfh(&xdr, &hdr); | 2543 | encode_fsinfo(xdr, lease_bitmap, &hdr); |
2613 | encode_fsinfo(&xdr, lease_bitmap, &hdr); | ||
2614 | encode_nops(&hdr); | 2544 | encode_nops(&hdr); |
2615 | return 0; | ||
2616 | } | 2545 | } |
2617 | 2546 | ||
2618 | /* | 2547 | /* |
2619 | * a RECLAIM_COMPLETE request | 2548 | * a RECLAIM_COMPLETE request |
2620 | */ | 2549 | */ |
2621 | static int nfs4_xdr_enc_reclaim_complete(struct rpc_rqst *req, uint32_t *p, | 2550 | static void nfs4_xdr_enc_reclaim_complete(struct rpc_rqst *req, |
2622 | struct nfs41_reclaim_complete_args *args) | 2551 | struct xdr_stream *xdr, |
2552 | struct nfs41_reclaim_complete_args *args) | ||
2623 | { | 2553 | { |
2624 | struct xdr_stream xdr; | ||
2625 | struct compound_hdr hdr = { | 2554 | struct compound_hdr hdr = { |
2626 | .minorversion = nfs4_xdr_minorversion(&args->seq_args) | 2555 | .minorversion = nfs4_xdr_minorversion(&args->seq_args) |
2627 | }; | 2556 | }; |
2628 | 2557 | ||
2629 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2558 | encode_compound_hdr(xdr, req, &hdr); |
2630 | encode_compound_hdr(&xdr, req, &hdr); | 2559 | encode_sequence(xdr, &args->seq_args, &hdr); |
2631 | encode_sequence(&xdr, &args->seq_args, &hdr); | 2560 | encode_reclaim_complete(xdr, args, &hdr); |
2632 | encode_reclaim_complete(&xdr, args, &hdr); | ||
2633 | encode_nops(&hdr); | 2561 | encode_nops(&hdr); |
2634 | return 0; | ||
2635 | } | 2562 | } |
2636 | 2563 | ||
2637 | /* | 2564 | /* |
2638 | * Encode GETDEVICEINFO request | 2565 | * Encode GETDEVICEINFO request |
2639 | */ | 2566 | */ |
2640 | static int nfs4_xdr_enc_getdeviceinfo(struct rpc_rqst *req, uint32_t *p, | 2567 | static void nfs4_xdr_enc_getdeviceinfo(struct rpc_rqst *req, |
2641 | struct nfs4_getdeviceinfo_args *args) | 2568 | struct xdr_stream *xdr, |
2569 | struct nfs4_getdeviceinfo_args *args) | ||
2642 | { | 2570 | { |
2643 | struct xdr_stream xdr; | ||
2644 | struct compound_hdr hdr = { | 2571 | struct compound_hdr hdr = { |
2645 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 2572 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
2646 | }; | 2573 | }; |
2647 | 2574 | ||
2648 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2575 | encode_compound_hdr(xdr, req, &hdr); |
2649 | encode_compound_hdr(&xdr, req, &hdr); | 2576 | encode_sequence(xdr, &args->seq_args, &hdr); |
2650 | encode_sequence(&xdr, &args->seq_args, &hdr); | 2577 | encode_getdeviceinfo(xdr, args, &hdr); |
2651 | encode_getdeviceinfo(&xdr, args, &hdr); | ||
2652 | 2578 | ||
2653 | /* set up reply kvec. Subtract notification bitmap max size (2) | 2579 | /* set up reply kvec. Subtract notification bitmap max size (2) |
2654 | * so that notification bitmap is put in xdr_buf tail */ | 2580 | * so that notification bitmap is put in xdr_buf tail */ |
@@ -2657,27 +2583,24 @@ static int nfs4_xdr_enc_getdeviceinfo(struct rpc_rqst *req, uint32_t *p, | |||
2657 | args->pdev->pglen); | 2583 | args->pdev->pglen); |
2658 | 2584 | ||
2659 | encode_nops(&hdr); | 2585 | encode_nops(&hdr); |
2660 | return 0; | ||
2661 | } | 2586 | } |
2662 | 2587 | ||
2663 | /* | 2588 | /* |
2664 | * Encode LAYOUTGET request | 2589 | * Encode LAYOUTGET request |
2665 | */ | 2590 | */ |
2666 | static int nfs4_xdr_enc_layoutget(struct rpc_rqst *req, uint32_t *p, | 2591 | static void nfs4_xdr_enc_layoutget(struct rpc_rqst *req, |
2667 | struct nfs4_layoutget_args *args) | 2592 | struct xdr_stream *xdr, |
2593 | struct nfs4_layoutget_args *args) | ||
2668 | { | 2594 | { |
2669 | struct xdr_stream xdr; | ||
2670 | struct compound_hdr hdr = { | 2595 | struct compound_hdr hdr = { |
2671 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 2596 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
2672 | }; | 2597 | }; |
2673 | 2598 | ||
2674 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2599 | encode_compound_hdr(xdr, req, &hdr); |
2675 | encode_compound_hdr(&xdr, req, &hdr); | 2600 | encode_sequence(xdr, &args->seq_args, &hdr); |
2676 | encode_sequence(&xdr, &args->seq_args, &hdr); | 2601 | encode_putfh(xdr, NFS_FH(args->inode), &hdr); |
2677 | encode_putfh(&xdr, NFS_FH(args->inode), &hdr); | 2602 | encode_layoutget(xdr, args, &hdr); |
2678 | encode_layoutget(&xdr, args, &hdr); | ||
2679 | encode_nops(&hdr); | 2603 | encode_nops(&hdr); |
2680 | return 0; | ||
2681 | } | 2604 | } |
2682 | #endif /* CONFIG_NFS_V4_1 */ | 2605 | #endif /* CONFIG_NFS_V4_1 */ |
2683 | 2606 | ||
@@ -5368,22 +5291,18 @@ out: | |||
5368 | /* | 5291 | /* |
5369 | * Encode an SETACL request | 5292 | * Encode an SETACL request |
5370 | */ | 5293 | */ |
5371 | static int | 5294 | static void nfs4_xdr_enc_setacl(struct rpc_rqst *req, struct xdr_stream *xdr, |
5372 | nfs4_xdr_enc_setacl(struct rpc_rqst *req, __be32 *p, struct nfs_setaclargs *args) | 5295 | struct nfs_setaclargs *args) |
5373 | { | 5296 | { |
5374 | struct xdr_stream xdr; | ||
5375 | struct compound_hdr hdr = { | 5297 | struct compound_hdr hdr = { |
5376 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | 5298 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
5377 | }; | 5299 | }; |
5378 | int status; | ||
5379 | 5300 | ||
5380 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 5301 | encode_compound_hdr(xdr, req, &hdr); |
5381 | encode_compound_hdr(&xdr, req, &hdr); | 5302 | encode_sequence(xdr, &args->seq_args, &hdr); |
5382 | encode_sequence(&xdr, &args->seq_args, &hdr); | 5303 | encode_putfh(xdr, args->fh, &hdr); |
5383 | encode_putfh(&xdr, args->fh, &hdr); | 5304 | encode_setacl(xdr, args, &hdr); |
5384 | status = encode_setacl(&xdr, args, &hdr); | ||
5385 | encode_nops(&hdr); | 5305 | encode_nops(&hdr); |
5386 | return status; | ||
5387 | } | 5306 | } |
5388 | 5307 | ||
5389 | /* | 5308 | /* |
@@ -6316,7 +6235,7 @@ nfs4_stat_to_errno(int stat) | |||
6316 | #define PROC(proc, argtype, restype) \ | 6235 | #define PROC(proc, argtype, restype) \ |
6317 | [NFSPROC4_CLNT_##proc] = { \ | 6236 | [NFSPROC4_CLNT_##proc] = { \ |
6318 | .p_proc = NFSPROC4_COMPOUND, \ | 6237 | .p_proc = NFSPROC4_COMPOUND, \ |
6319 | .p_encode = (kxdrproc_t)nfs4_xdr_##argtype, \ | 6238 | .p_encode = (kxdreproc_t)nfs4_xdr_##argtype, \ |
6320 | .p_decode = (kxdrproc_t)nfs4_xdr_##restype, \ | 6239 | .p_decode = (kxdrproc_t)nfs4_xdr_##restype, \ |
6321 | .p_arglen = NFS4_##argtype##_sz, \ | 6240 | .p_arglen = NFS4_##argtype##_sz, \ |
6322 | .p_replen = NFS4_##restype##_sz, \ | 6241 | .p_replen = NFS4_##restype##_sz, \ |