diff options
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/nfs4xdr.c | 578 |
1 files changed, 180 insertions, 398 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 8f6c061bb6c4..d1e4c8f8a0a9 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -607,7 +607,7 @@ static void encode_nfs4_verifier(struct xdr_stream *xdr, const nfs4_verifier *ve | |||
607 | xdr_encode_opaque_fixed(p, verf->data, NFS4_VERIFIER_SIZE); | 607 | xdr_encode_opaque_fixed(p, verf->data, NFS4_VERIFIER_SIZE); |
608 | } | 608 | } |
609 | 609 | ||
610 | static int encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const struct nfs_server *server) | 610 | static void encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const struct nfs_server *server) |
611 | { | 611 | { |
612 | char owner_name[IDMAP_NAMESZ]; | 612 | char owner_name[IDMAP_NAMESZ]; |
613 | char owner_group[IDMAP_NAMESZ]; | 613 | char owner_group[IDMAP_NAMESZ]; |
@@ -618,7 +618,6 @@ static int encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const s | |||
618 | int len; | 618 | int len; |
619 | uint32_t bmval0 = 0; | 619 | uint32_t bmval0 = 0; |
620 | uint32_t bmval1 = 0; | 620 | uint32_t bmval1 = 0; |
621 | int status; | ||
622 | 621 | ||
623 | /* | 622 | /* |
624 | * We reserve enough space to write the entire attribute buffer at once. | 623 | * We reserve enough space to write the entire attribute buffer at once. |
@@ -729,12 +728,10 @@ static int encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const s | |||
729 | *q++ = htonl(bmval1); | 728 | *q++ = htonl(bmval1); |
730 | *q++ = htonl(len); | 729 | *q++ = htonl(len); |
731 | 730 | ||
732 | status = 0; | ||
733 | /* out: */ | 731 | /* out: */ |
734 | return status; | ||
735 | } | 732 | } |
736 | 733 | ||
737 | static int encode_access(struct xdr_stream *xdr, u32 access, struct compound_hdr *hdr) | 734 | static void encode_access(struct xdr_stream *xdr, u32 access, struct compound_hdr *hdr) |
738 | { | 735 | { |
739 | __be32 *p; | 736 | __be32 *p; |
740 | 737 | ||
@@ -742,11 +739,9 @@ static int encode_access(struct xdr_stream *xdr, u32 access, struct compound_hdr | |||
742 | WRITE32(OP_ACCESS); | 739 | WRITE32(OP_ACCESS); |
743 | WRITE32(access); | 740 | WRITE32(access); |
744 | hdr->nops++; | 741 | hdr->nops++; |
745 | |||
746 | return 0; | ||
747 | } | 742 | } |
748 | 743 | ||
749 | static int encode_close(struct xdr_stream *xdr, const struct nfs_closeargs *arg, struct compound_hdr *hdr) | 744 | static void encode_close(struct xdr_stream *xdr, const struct nfs_closeargs *arg, struct compound_hdr *hdr) |
750 | { | 745 | { |
751 | __be32 *p; | 746 | __be32 *p; |
752 | 747 | ||
@@ -755,11 +750,9 @@ static int encode_close(struct xdr_stream *xdr, const struct nfs_closeargs *arg, | |||
755 | WRITE32(arg->seqid->sequence->counter); | 750 | WRITE32(arg->seqid->sequence->counter); |
756 | WRITEMEM(arg->stateid->data, NFS4_STATEID_SIZE); | 751 | WRITEMEM(arg->stateid->data, NFS4_STATEID_SIZE); |
757 | hdr->nops++; | 752 | hdr->nops++; |
758 | |||
759 | return 0; | ||
760 | } | 753 | } |
761 | 754 | ||
762 | static int encode_commit(struct xdr_stream *xdr, const struct nfs_writeargs *args, struct compound_hdr *hdr) | 755 | static void encode_commit(struct xdr_stream *xdr, const struct nfs_writeargs *args, struct compound_hdr *hdr) |
763 | { | 756 | { |
764 | __be32 *p; | 757 | __be32 *p; |
765 | 758 | ||
@@ -768,11 +761,9 @@ static int encode_commit(struct xdr_stream *xdr, const struct nfs_writeargs *arg | |||
768 | WRITE64(args->offset); | 761 | WRITE64(args->offset); |
769 | WRITE32(args->count); | 762 | WRITE32(args->count); |
770 | hdr->nops++; | 763 | hdr->nops++; |
771 | |||
772 | return 0; | ||
773 | } | 764 | } |
774 | 765 | ||
775 | static int encode_create(struct xdr_stream *xdr, const struct nfs4_create_arg *create, struct compound_hdr *hdr) | 766 | static void encode_create(struct xdr_stream *xdr, const struct nfs4_create_arg *create, struct compound_hdr *hdr) |
776 | { | 767 | { |
777 | __be32 *p; | 768 | __be32 *p; |
778 | 769 | ||
@@ -802,10 +793,10 @@ static int encode_create(struct xdr_stream *xdr, const struct nfs4_create_arg *c | |||
802 | WRITEMEM(create->name->name, create->name->len); | 793 | WRITEMEM(create->name->name, create->name->len); |
803 | hdr->nops++; | 794 | hdr->nops++; |
804 | 795 | ||
805 | return encode_attrs(xdr, create->attrs, create->server); | 796 | encode_attrs(xdr, create->attrs, create->server); |
806 | } | 797 | } |
807 | 798 | ||
808 | static int encode_getattr_one(struct xdr_stream *xdr, uint32_t bitmap, struct compound_hdr *hdr) | 799 | static void encode_getattr_one(struct xdr_stream *xdr, uint32_t bitmap, struct compound_hdr *hdr) |
809 | { | 800 | { |
810 | __be32 *p; | 801 | __be32 *p; |
811 | 802 | ||
@@ -814,10 +805,9 @@ static int encode_getattr_one(struct xdr_stream *xdr, uint32_t bitmap, struct co | |||
814 | WRITE32(1); | 805 | WRITE32(1); |
815 | WRITE32(bitmap); | 806 | WRITE32(bitmap); |
816 | hdr->nops++; | 807 | hdr->nops++; |
817 | return 0; | ||
818 | } | 808 | } |
819 | 809 | ||
820 | static int encode_getattr_two(struct xdr_stream *xdr, uint32_t bm0, uint32_t bm1, struct compound_hdr *hdr) | 810 | static void encode_getattr_two(struct xdr_stream *xdr, uint32_t bm0, uint32_t bm1, struct compound_hdr *hdr) |
821 | { | 811 | { |
822 | __be32 *p; | 812 | __be32 *p; |
823 | 813 | ||
@@ -827,42 +817,36 @@ static int encode_getattr_two(struct xdr_stream *xdr, uint32_t bm0, uint32_t bm1 | |||
827 | WRITE32(bm0); | 817 | WRITE32(bm0); |
828 | WRITE32(bm1); | 818 | WRITE32(bm1); |
829 | hdr->nops++; | 819 | hdr->nops++; |
830 | return 0; | ||
831 | } | 820 | } |
832 | 821 | ||
833 | static int encode_getfattr(struct xdr_stream *xdr, const u32* bitmask, struct compound_hdr *hdr) | 822 | static void encode_getfattr(struct xdr_stream *xdr, const u32* bitmask, struct compound_hdr *hdr) |
834 | { | 823 | { |
835 | return encode_getattr_two(xdr, | 824 | encode_getattr_two(xdr, bitmask[0] & nfs4_fattr_bitmap[0], |
836 | bitmask[0] & nfs4_fattr_bitmap[0], | 825 | bitmask[1] & nfs4_fattr_bitmap[1], hdr); |
837 | bitmask[1] & nfs4_fattr_bitmap[1], hdr); | ||
838 | } | 826 | } |
839 | 827 | ||
840 | static int encode_fsinfo(struct xdr_stream *xdr, const u32* bitmask, struct compound_hdr *hdr) | 828 | static void encode_fsinfo(struct xdr_stream *xdr, const u32* bitmask, struct compound_hdr *hdr) |
841 | { | 829 | { |
842 | return encode_getattr_two(xdr, bitmask[0] & nfs4_fsinfo_bitmap[0], | 830 | encode_getattr_two(xdr, bitmask[0] & nfs4_fsinfo_bitmap[0], |
843 | bitmask[1] & nfs4_fsinfo_bitmap[1], hdr); | 831 | bitmask[1] & nfs4_fsinfo_bitmap[1], hdr); |
844 | } | 832 | } |
845 | 833 | ||
846 | static int encode_fs_locations(struct xdr_stream *xdr, const u32* bitmask, struct compound_hdr *hdr) | 834 | static void encode_fs_locations(struct xdr_stream *xdr, const u32* bitmask, struct compound_hdr *hdr) |
847 | { | 835 | { |
848 | return encode_getattr_two(xdr, | 836 | encode_getattr_two(xdr, bitmask[0] & nfs4_fs_locations_bitmap[0], |
849 | bitmask[0] & nfs4_fs_locations_bitmap[0], | 837 | bitmask[1] & nfs4_fs_locations_bitmap[1], hdr); |
850 | bitmask[1] & nfs4_fs_locations_bitmap[1], | ||
851 | hdr); | ||
852 | } | 838 | } |
853 | 839 | ||
854 | static int encode_getfh(struct xdr_stream *xdr, struct compound_hdr *hdr) | 840 | static void encode_getfh(struct xdr_stream *xdr, struct compound_hdr *hdr) |
855 | { | 841 | { |
856 | __be32 *p; | 842 | __be32 *p; |
857 | 843 | ||
858 | RESERVE_SPACE(4); | 844 | RESERVE_SPACE(4); |
859 | WRITE32(OP_GETFH); | 845 | WRITE32(OP_GETFH); |
860 | hdr->nops++; | 846 | hdr->nops++; |
861 | |||
862 | return 0; | ||
863 | } | 847 | } |
864 | 848 | ||
865 | static int encode_link(struct xdr_stream *xdr, const struct qstr *name, struct compound_hdr *hdr) | 849 | static void encode_link(struct xdr_stream *xdr, const struct qstr *name, struct compound_hdr *hdr) |
866 | { | 850 | { |
867 | __be32 *p; | 851 | __be32 *p; |
868 | 852 | ||
@@ -871,8 +855,6 @@ static int encode_link(struct xdr_stream *xdr, const struct qstr *name, struct c | |||
871 | WRITE32(name->len); | 855 | WRITE32(name->len); |
872 | WRITEMEM(name->name, name->len); | 856 | WRITEMEM(name->name, name->len); |
873 | hdr->nops++; | 857 | hdr->nops++; |
874 | |||
875 | return 0; | ||
876 | } | 858 | } |
877 | 859 | ||
878 | static inline int nfs4_lock_type(struct file_lock *fl, int block) | 860 | static inline int nfs4_lock_type(struct file_lock *fl, int block) |
@@ -893,7 +875,7 @@ static inline uint64_t nfs4_lock_length(struct file_lock *fl) | |||
893 | * opcode,type,reclaim,offset,length,new_lock_owner = 32 | 875 | * opcode,type,reclaim,offset,length,new_lock_owner = 32 |
894 | * open_seqid,open_stateid,lock_seqid,lock_owner.clientid, lock_owner.id = 40 | 876 | * open_seqid,open_stateid,lock_seqid,lock_owner.clientid, lock_owner.id = 40 |
895 | */ | 877 | */ |
896 | static int encode_lock(struct xdr_stream *xdr, const struct nfs_lock_args *args, struct compound_hdr *hdr) | 878 | static void encode_lock(struct xdr_stream *xdr, const struct nfs_lock_args *args, struct compound_hdr *hdr) |
897 | { | 879 | { |
898 | __be32 *p; | 880 | __be32 *p; |
899 | 881 | ||
@@ -920,11 +902,9 @@ static int encode_lock(struct xdr_stream *xdr, const struct nfs_lock_args *args, | |||
920 | WRITE32(args->lock_seqid->sequence->counter); | 902 | WRITE32(args->lock_seqid->sequence->counter); |
921 | } | 903 | } |
922 | hdr->nops++; | 904 | hdr->nops++; |
923 | |||
924 | return 0; | ||
925 | } | 905 | } |
926 | 906 | ||
927 | static int encode_lockt(struct xdr_stream *xdr, const struct nfs_lockt_args *args, struct compound_hdr *hdr) | 907 | static void encode_lockt(struct xdr_stream *xdr, const struct nfs_lockt_args *args, struct compound_hdr *hdr) |
928 | { | 908 | { |
929 | __be32 *p; | 909 | __be32 *p; |
930 | 910 | ||
@@ -938,11 +918,9 @@ static int encode_lockt(struct xdr_stream *xdr, const struct nfs_lockt_args *arg | |||
938 | WRITEMEM("lock id:", 8); | 918 | WRITEMEM("lock id:", 8); |
939 | WRITE64(args->lock_owner.id); | 919 | WRITE64(args->lock_owner.id); |
940 | hdr->nops++; | 920 | hdr->nops++; |
941 | |||
942 | return 0; | ||
943 | } | 921 | } |
944 | 922 | ||
945 | static int encode_locku(struct xdr_stream *xdr, const struct nfs_locku_args *args, struct compound_hdr *hdr) | 923 | static void encode_locku(struct xdr_stream *xdr, const struct nfs_locku_args *args, struct compound_hdr *hdr) |
946 | { | 924 | { |
947 | __be32 *p; | 925 | __be32 *p; |
948 | 926 | ||
@@ -954,11 +932,9 @@ static int encode_locku(struct xdr_stream *xdr, const struct nfs_locku_args *arg | |||
954 | WRITE64(args->fl->fl_start); | 932 | WRITE64(args->fl->fl_start); |
955 | WRITE64(nfs4_lock_length(args->fl)); | 933 | WRITE64(nfs4_lock_length(args->fl)); |
956 | hdr->nops++; | 934 | hdr->nops++; |
957 | |||
958 | return 0; | ||
959 | } | 935 | } |
960 | 936 | ||
961 | static int encode_lookup(struct xdr_stream *xdr, const struct qstr *name, struct compound_hdr *hdr) | 937 | static void encode_lookup(struct xdr_stream *xdr, const struct qstr *name, struct compound_hdr *hdr) |
962 | { | 938 | { |
963 | int len = name->len; | 939 | int len = name->len; |
964 | __be32 *p; | 940 | __be32 *p; |
@@ -968,8 +944,6 @@ static int encode_lookup(struct xdr_stream *xdr, const struct qstr *name, struct | |||
968 | WRITE32(len); | 944 | WRITE32(len); |
969 | WRITEMEM(name->name, len); | 945 | WRITEMEM(name->name, len); |
970 | hdr->nops++; | 946 | hdr->nops++; |
971 | |||
972 | return 0; | ||
973 | } | 947 | } |
974 | 948 | ||
975 | static void encode_share_access(struct xdr_stream *xdr, fmode_t fmode) | 949 | static void encode_share_access(struct xdr_stream *xdr, fmode_t fmode) |
@@ -1091,7 +1065,7 @@ static inline void encode_claim_delegate_cur(struct xdr_stream *xdr, const struc | |||
1091 | encode_string(xdr, name->len, name->name); | 1065 | encode_string(xdr, name->len, name->name); |
1092 | } | 1066 | } |
1093 | 1067 | ||
1094 | static int encode_open(struct xdr_stream *xdr, const struct nfs_openargs *arg, struct compound_hdr *hdr) | 1068 | static void encode_open(struct xdr_stream *xdr, const struct nfs_openargs *arg, struct compound_hdr *hdr) |
1095 | { | 1069 | { |
1096 | encode_openhdr(xdr, arg); | 1070 | encode_openhdr(xdr, arg); |
1097 | encode_opentype(xdr, arg); | 1071 | encode_opentype(xdr, arg); |
@@ -1109,10 +1083,9 @@ static int encode_open(struct xdr_stream *xdr, const struct nfs_openargs *arg, s | |||
1109 | BUG(); | 1083 | BUG(); |
1110 | } | 1084 | } |
1111 | hdr->nops++; | 1085 | hdr->nops++; |
1112 | return 0; | ||
1113 | } | 1086 | } |
1114 | 1087 | ||
1115 | static int encode_open_confirm(struct xdr_stream *xdr, const struct nfs_open_confirmargs *arg, struct compound_hdr *hdr) | 1088 | static void encode_open_confirm(struct xdr_stream *xdr, const struct nfs_open_confirmargs *arg, struct compound_hdr *hdr) |
1116 | { | 1089 | { |
1117 | __be32 *p; | 1090 | __be32 *p; |
1118 | 1091 | ||
@@ -1121,11 +1094,9 @@ static int encode_open_confirm(struct xdr_stream *xdr, const struct nfs_open_con | |||
1121 | WRITEMEM(arg->stateid->data, NFS4_STATEID_SIZE); | 1094 | WRITEMEM(arg->stateid->data, NFS4_STATEID_SIZE); |
1122 | WRITE32(arg->seqid->sequence->counter); | 1095 | WRITE32(arg->seqid->sequence->counter); |
1123 | hdr->nops++; | 1096 | hdr->nops++; |
1124 | |||
1125 | return 0; | ||
1126 | } | 1097 | } |
1127 | 1098 | ||
1128 | static int encode_open_downgrade(struct xdr_stream *xdr, const struct nfs_closeargs *arg, struct compound_hdr *hdr) | 1099 | static void encode_open_downgrade(struct xdr_stream *xdr, const struct nfs_closeargs *arg, struct compound_hdr *hdr) |
1129 | { | 1100 | { |
1130 | __be32 *p; | 1101 | __be32 *p; |
1131 | 1102 | ||
@@ -1135,10 +1106,9 @@ static int encode_open_downgrade(struct xdr_stream *xdr, const struct nfs_closea | |||
1135 | WRITE32(arg->seqid->sequence->counter); | 1106 | WRITE32(arg->seqid->sequence->counter); |
1136 | encode_share_access(xdr, arg->fmode); | 1107 | encode_share_access(xdr, arg->fmode); |
1137 | hdr->nops++; | 1108 | hdr->nops++; |
1138 | return 0; | ||
1139 | } | 1109 | } |
1140 | 1110 | ||
1141 | static int | 1111 | static void |
1142 | encode_putfh(struct xdr_stream *xdr, const struct nfs_fh *fh, struct compound_hdr *hdr) | 1112 | encode_putfh(struct xdr_stream *xdr, const struct nfs_fh *fh, struct compound_hdr *hdr) |
1143 | { | 1113 | { |
1144 | int len = fh->size; | 1114 | int len = fh->size; |
@@ -1149,19 +1119,15 @@ encode_putfh(struct xdr_stream *xdr, const struct nfs_fh *fh, struct compound_hd | |||
1149 | WRITE32(len); | 1119 | WRITE32(len); |
1150 | WRITEMEM(fh->data, len); | 1120 | WRITEMEM(fh->data, len); |
1151 | hdr->nops++; | 1121 | hdr->nops++; |
1152 | |||
1153 | return 0; | ||
1154 | } | 1122 | } |
1155 | 1123 | ||
1156 | static int encode_putrootfh(struct xdr_stream *xdr, struct compound_hdr *hdr) | 1124 | static void encode_putrootfh(struct xdr_stream *xdr, struct compound_hdr *hdr) |
1157 | { | 1125 | { |
1158 | __be32 *p; | 1126 | __be32 *p; |
1159 | 1127 | ||
1160 | RESERVE_SPACE(4); | 1128 | RESERVE_SPACE(4); |
1161 | WRITE32(OP_PUTROOTFH); | 1129 | WRITE32(OP_PUTROOTFH); |
1162 | hdr->nops++; | 1130 | hdr->nops++; |
1163 | |||
1164 | return 0; | ||
1165 | } | 1131 | } |
1166 | 1132 | ||
1167 | static void encode_stateid(struct xdr_stream *xdr, const struct nfs_open_context *ctx) | 1133 | static void encode_stateid(struct xdr_stream *xdr, const struct nfs_open_context *ctx) |
@@ -1177,7 +1143,7 @@ static void encode_stateid(struct xdr_stream *xdr, const struct nfs_open_context | |||
1177 | WRITEMEM(zero_stateid.data, NFS4_STATEID_SIZE); | 1143 | WRITEMEM(zero_stateid.data, NFS4_STATEID_SIZE); |
1178 | } | 1144 | } |
1179 | 1145 | ||
1180 | static int encode_read(struct xdr_stream *xdr, const struct nfs_readargs *args, struct compound_hdr *hdr) | 1146 | static void encode_read(struct xdr_stream *xdr, const struct nfs_readargs *args, struct compound_hdr *hdr) |
1181 | { | 1147 | { |
1182 | __be32 *p; | 1148 | __be32 *p; |
1183 | 1149 | ||
@@ -1190,11 +1156,9 @@ static int encode_read(struct xdr_stream *xdr, const struct nfs_readargs *args, | |||
1190 | WRITE64(args->offset); | 1156 | WRITE64(args->offset); |
1191 | WRITE32(args->count); | 1157 | WRITE32(args->count); |
1192 | hdr->nops++; | 1158 | hdr->nops++; |
1193 | |||
1194 | return 0; | ||
1195 | } | 1159 | } |
1196 | 1160 | ||
1197 | static int encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg *readdir, struct rpc_rqst *req, struct compound_hdr *hdr) | 1161 | static void encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg *readdir, struct rpc_rqst *req, struct compound_hdr *hdr) |
1198 | { | 1162 | { |
1199 | uint32_t attrs[2] = { | 1163 | uint32_t attrs[2] = { |
1200 | FATTR4_WORD0_RDATTR_ERROR|FATTR4_WORD0_FILEID, | 1164 | FATTR4_WORD0_RDATTR_ERROR|FATTR4_WORD0_FILEID, |
@@ -1224,22 +1188,18 @@ static int encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg | |||
1224 | ((u32 *)readdir->verifier.data)[1], | 1188 | ((u32 *)readdir->verifier.data)[1], |
1225 | attrs[0] & readdir->bitmask[0], | 1189 | attrs[0] & readdir->bitmask[0], |
1226 | attrs[1] & readdir->bitmask[1]); | 1190 | attrs[1] & readdir->bitmask[1]); |
1227 | |||
1228 | return 0; | ||
1229 | } | 1191 | } |
1230 | 1192 | ||
1231 | static int encode_readlink(struct xdr_stream *xdr, const struct nfs4_readlink *readlink, struct rpc_rqst *req, struct compound_hdr *hdr) | 1193 | static void encode_readlink(struct xdr_stream *xdr, const struct nfs4_readlink *readlink, struct rpc_rqst *req, struct compound_hdr *hdr) |
1232 | { | 1194 | { |
1233 | __be32 *p; | 1195 | __be32 *p; |
1234 | 1196 | ||
1235 | RESERVE_SPACE(4); | 1197 | RESERVE_SPACE(4); |
1236 | WRITE32(OP_READLINK); | 1198 | WRITE32(OP_READLINK); |
1237 | hdr->nops++; | 1199 | hdr->nops++; |
1238 | |||
1239 | return 0; | ||
1240 | } | 1200 | } |
1241 | 1201 | ||
1242 | static int encode_remove(struct xdr_stream *xdr, const struct qstr *name, struct compound_hdr *hdr) | 1202 | static void encode_remove(struct xdr_stream *xdr, const struct qstr *name, struct compound_hdr *hdr) |
1243 | { | 1203 | { |
1244 | __be32 *p; | 1204 | __be32 *p; |
1245 | 1205 | ||
@@ -1248,11 +1208,9 @@ static int encode_remove(struct xdr_stream *xdr, const struct qstr *name, struct | |||
1248 | WRITE32(name->len); | 1208 | WRITE32(name->len); |
1249 | WRITEMEM(name->name, name->len); | 1209 | WRITEMEM(name->name, name->len); |
1250 | hdr->nops++; | 1210 | hdr->nops++; |
1251 | |||
1252 | return 0; | ||
1253 | } | 1211 | } |
1254 | 1212 | ||
1255 | static int encode_rename(struct xdr_stream *xdr, const struct qstr *oldname, const struct qstr *newname, struct compound_hdr *hdr) | 1213 | static void encode_rename(struct xdr_stream *xdr, const struct qstr *oldname, const struct qstr *newname, struct compound_hdr *hdr) |
1256 | { | 1214 | { |
1257 | __be32 *p; | 1215 | __be32 *p; |
1258 | 1216 | ||
@@ -1265,11 +1223,9 @@ static int encode_rename(struct xdr_stream *xdr, const struct qstr *oldname, con | |||
1265 | WRITE32(newname->len); | 1223 | WRITE32(newname->len); |
1266 | WRITEMEM(newname->name, newname->len); | 1224 | WRITEMEM(newname->name, newname->len); |
1267 | hdr->nops++; | 1225 | hdr->nops++; |
1268 | |||
1269 | return 0; | ||
1270 | } | 1226 | } |
1271 | 1227 | ||
1272 | static int encode_renew(struct xdr_stream *xdr, const struct nfs_client *client_stateid, struct compound_hdr *hdr) | 1228 | static void encode_renew(struct xdr_stream *xdr, const struct nfs_client *client_stateid, struct compound_hdr *hdr) |
1273 | { | 1229 | { |
1274 | __be32 *p; | 1230 | __be32 *p; |
1275 | 1231 | ||
@@ -1277,11 +1233,9 @@ static int encode_renew(struct xdr_stream *xdr, const struct nfs_client *client_ | |||
1277 | WRITE32(OP_RENEW); | 1233 | WRITE32(OP_RENEW); |
1278 | WRITE64(client_stateid->cl_clientid); | 1234 | WRITE64(client_stateid->cl_clientid); |
1279 | hdr->nops++; | 1235 | hdr->nops++; |
1280 | |||
1281 | return 0; | ||
1282 | } | 1236 | } |
1283 | 1237 | ||
1284 | static int | 1238 | static void |
1285 | encode_restorefh(struct xdr_stream *xdr, struct compound_hdr *hdr) | 1239 | encode_restorefh(struct xdr_stream *xdr, struct compound_hdr *hdr) |
1286 | { | 1240 | { |
1287 | __be32 *p; | 1241 | __be32 *p; |
@@ -1289,8 +1243,6 @@ encode_restorefh(struct xdr_stream *xdr, struct compound_hdr *hdr) | |||
1289 | RESERVE_SPACE(4); | 1243 | RESERVE_SPACE(4); |
1290 | WRITE32(OP_RESTOREFH); | 1244 | WRITE32(OP_RESTOREFH); |
1291 | hdr->nops++; | 1245 | hdr->nops++; |
1292 | |||
1293 | return 0; | ||
1294 | } | 1246 | } |
1295 | 1247 | ||
1296 | static int | 1248 | static int |
@@ -1313,7 +1265,7 @@ encode_setacl(struct xdr_stream *xdr, struct nfs_setaclargs *arg, struct compoun | |||
1313 | return 0; | 1265 | return 0; |
1314 | } | 1266 | } |
1315 | 1267 | ||
1316 | static int | 1268 | static void |
1317 | encode_savefh(struct xdr_stream *xdr, struct compound_hdr *hdr) | 1269 | encode_savefh(struct xdr_stream *xdr, struct compound_hdr *hdr) |
1318 | { | 1270 | { |
1319 | __be32 *p; | 1271 | __be32 *p; |
@@ -1321,27 +1273,20 @@ encode_savefh(struct xdr_stream *xdr, struct compound_hdr *hdr) | |||
1321 | RESERVE_SPACE(4); | 1273 | RESERVE_SPACE(4); |
1322 | WRITE32(OP_SAVEFH); | 1274 | WRITE32(OP_SAVEFH); |
1323 | hdr->nops++; | 1275 | hdr->nops++; |
1324 | |||
1325 | return 0; | ||
1326 | } | 1276 | } |
1327 | 1277 | ||
1328 | static int encode_setattr(struct xdr_stream *xdr, const struct nfs_setattrargs *arg, const struct nfs_server *server, struct compound_hdr *hdr) | 1278 | static void encode_setattr(struct xdr_stream *xdr, const struct nfs_setattrargs *arg, const struct nfs_server *server, struct compound_hdr *hdr) |
1329 | { | 1279 | { |
1330 | int status; | ||
1331 | __be32 *p; | 1280 | __be32 *p; |
1332 | 1281 | ||
1333 | RESERVE_SPACE(4+NFS4_STATEID_SIZE); | 1282 | RESERVE_SPACE(4+NFS4_STATEID_SIZE); |
1334 | WRITE32(OP_SETATTR); | 1283 | WRITE32(OP_SETATTR); |
1335 | WRITEMEM(arg->stateid.data, NFS4_STATEID_SIZE); | 1284 | WRITEMEM(arg->stateid.data, NFS4_STATEID_SIZE); |
1336 | hdr->nops++; | 1285 | hdr->nops++; |
1337 | 1286 | encode_attrs(xdr, arg->iap, server); | |
1338 | if ((status = encode_attrs(xdr, arg->iap, server))) | ||
1339 | return status; | ||
1340 | |||
1341 | return 0; | ||
1342 | } | 1287 | } |
1343 | 1288 | ||
1344 | static int encode_setclientid(struct xdr_stream *xdr, const struct nfs4_setclientid *setclientid, struct compound_hdr *hdr) | 1289 | static void encode_setclientid(struct xdr_stream *xdr, const struct nfs4_setclientid *setclientid, struct compound_hdr *hdr) |
1345 | { | 1290 | { |
1346 | __be32 *p; | 1291 | __be32 *p; |
1347 | 1292 | ||
@@ -1357,11 +1302,9 @@ static int encode_setclientid(struct xdr_stream *xdr, const struct nfs4_setclien | |||
1357 | RESERVE_SPACE(4); | 1302 | RESERVE_SPACE(4); |
1358 | WRITE32(setclientid->sc_cb_ident); | 1303 | WRITE32(setclientid->sc_cb_ident); |
1359 | hdr->nops++; | 1304 | hdr->nops++; |
1360 | |||
1361 | return 0; | ||
1362 | } | 1305 | } |
1363 | 1306 | ||
1364 | static int encode_setclientid_confirm(struct xdr_stream *xdr, const struct nfs_client *client_state, struct compound_hdr *hdr) | 1307 | static void encode_setclientid_confirm(struct xdr_stream *xdr, const struct nfs_client *client_state, struct compound_hdr *hdr) |
1365 | { | 1308 | { |
1366 | __be32 *p; | 1309 | __be32 *p; |
1367 | 1310 | ||
@@ -1370,11 +1313,9 @@ static int encode_setclientid_confirm(struct xdr_stream *xdr, const struct nfs_c | |||
1370 | WRITE64(client_state->cl_clientid); | 1313 | WRITE64(client_state->cl_clientid); |
1371 | WRITEMEM(client_state->cl_confirm.data, NFS4_VERIFIER_SIZE); | 1314 | WRITEMEM(client_state->cl_confirm.data, NFS4_VERIFIER_SIZE); |
1372 | hdr->nops++; | 1315 | hdr->nops++; |
1373 | |||
1374 | return 0; | ||
1375 | } | 1316 | } |
1376 | 1317 | ||
1377 | static int encode_write(struct xdr_stream *xdr, const struct nfs_writeargs *args, struct compound_hdr *hdr) | 1318 | static void encode_write(struct xdr_stream *xdr, const struct nfs_writeargs *args, struct compound_hdr *hdr) |
1378 | { | 1319 | { |
1379 | __be32 *p; | 1320 | __be32 *p; |
1380 | 1321 | ||
@@ -1390,11 +1331,9 @@ static int encode_write(struct xdr_stream *xdr, const struct nfs_writeargs *args | |||
1390 | 1331 | ||
1391 | xdr_write_pages(xdr, args->pages, args->pgbase, args->count); | 1332 | xdr_write_pages(xdr, args->pages, args->pgbase, args->count); |
1392 | hdr->nops++; | 1333 | hdr->nops++; |
1393 | |||
1394 | return 0; | ||
1395 | } | 1334 | } |
1396 | 1335 | ||
1397 | static int encode_delegreturn(struct xdr_stream *xdr, const nfs4_stateid *stateid, struct compound_hdr *hdr) | 1336 | static void encode_delegreturn(struct xdr_stream *xdr, const nfs4_stateid *stateid, struct compound_hdr *hdr) |
1398 | { | 1337 | { |
1399 | __be32 *p; | 1338 | __be32 *p; |
1400 | 1339 | ||
@@ -1403,8 +1342,6 @@ static int encode_delegreturn(struct xdr_stream *xdr, const nfs4_stateid *statei | |||
1403 | WRITE32(OP_DELEGRETURN); | 1342 | WRITE32(OP_DELEGRETURN); |
1404 | WRITEMEM(stateid->data, NFS4_STATEID_SIZE); | 1343 | WRITEMEM(stateid->data, NFS4_STATEID_SIZE); |
1405 | hdr->nops++; | 1344 | hdr->nops++; |
1406 | return 0; | ||
1407 | |||
1408 | } | 1345 | } |
1409 | /* | 1346 | /* |
1410 | * END OF "GENERIC" ENCODE ROUTINES. | 1347 | * END OF "GENERIC" ENCODE ROUTINES. |
@@ -1419,20 +1356,14 @@ static int nfs4_xdr_enc_access(struct rpc_rqst *req, __be32 *p, const struct nfs | |||
1419 | struct compound_hdr hdr = { | 1356 | struct compound_hdr hdr = { |
1420 | .nops = 0, | 1357 | .nops = 0, |
1421 | }; | 1358 | }; |
1422 | int status; | ||
1423 | 1359 | ||
1424 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1360 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
1425 | encode_compound_hdr(&xdr, &hdr); | 1361 | encode_compound_hdr(&xdr, &hdr); |
1426 | status = encode_putfh(&xdr, args->fh, &hdr); | 1362 | encode_putfh(&xdr, args->fh, &hdr); |
1427 | if (status != 0) | 1363 | encode_access(&xdr, args->access, &hdr); |
1428 | goto out; | 1364 | encode_getfattr(&xdr, args->bitmask, &hdr); |
1429 | status = encode_access(&xdr, args->access, &hdr); | ||
1430 | if (status != 0) | ||
1431 | goto out; | ||
1432 | status = encode_getfattr(&xdr, args->bitmask, &hdr); | ||
1433 | out: | ||
1434 | encode_nops(&hdr); | 1365 | encode_nops(&hdr); |
1435 | return status; | 1366 | return 0; |
1436 | } | 1367 | } |
1437 | 1368 | ||
1438 | /* | 1369 | /* |
@@ -1444,20 +1375,15 @@ static int nfs4_xdr_enc_lookup(struct rpc_rqst *req, __be32 *p, const struct nfs | |||
1444 | struct compound_hdr hdr = { | 1375 | struct compound_hdr hdr = { |
1445 | .nops = 0, | 1376 | .nops = 0, |
1446 | }; | 1377 | }; |
1447 | int status; | ||
1448 | 1378 | ||
1449 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1379 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
1450 | encode_compound_hdr(&xdr, &hdr); | 1380 | encode_compound_hdr(&xdr, &hdr); |
1451 | if ((status = encode_putfh(&xdr, args->dir_fh, &hdr)) != 0) | 1381 | encode_putfh(&xdr, args->dir_fh, &hdr); |
1452 | goto out; | 1382 | encode_lookup(&xdr, args->name, &hdr); |
1453 | if ((status = encode_lookup(&xdr, args->name, &hdr)) != 0) | 1383 | encode_getfh(&xdr, &hdr); |
1454 | goto out; | 1384 | encode_getfattr(&xdr, args->bitmask, &hdr); |
1455 | if ((status = encode_getfh(&xdr, &hdr)) != 0) | ||
1456 | goto out; | ||
1457 | status = encode_getfattr(&xdr, args->bitmask, &hdr); | ||
1458 | out: | ||
1459 | encode_nops(&hdr); | 1385 | encode_nops(&hdr); |
1460 | return status; | 1386 | return 0; |
1461 | } | 1387 | } |
1462 | 1388 | ||
1463 | /* | 1389 | /* |
@@ -1469,17 +1395,14 @@ static int nfs4_xdr_enc_lookup_root(struct rpc_rqst *req, __be32 *p, const struc | |||
1469 | struct compound_hdr hdr = { | 1395 | struct compound_hdr hdr = { |
1470 | .nops = 0, | 1396 | .nops = 0, |
1471 | }; | 1397 | }; |
1472 | int status; | ||
1473 | 1398 | ||
1474 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1399 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
1475 | encode_compound_hdr(&xdr, &hdr); | 1400 | encode_compound_hdr(&xdr, &hdr); |
1476 | if ((status = encode_putrootfh(&xdr, &hdr)) != 0) | 1401 | encode_putrootfh(&xdr, &hdr); |
1477 | goto out; | 1402 | encode_getfh(&xdr, &hdr); |
1478 | if ((status = encode_getfh(&xdr, &hdr)) == 0) | 1403 | encode_getfattr(&xdr, args->bitmask, &hdr); |
1479 | status = encode_getfattr(&xdr, args->bitmask, &hdr); | ||
1480 | out: | ||
1481 | encode_nops(&hdr); | 1404 | encode_nops(&hdr); |
1482 | return status; | 1405 | return 0; |
1483 | } | 1406 | } |
1484 | 1407 | ||
1485 | /* | 1408 | /* |
@@ -1491,18 +1414,14 @@ static int nfs4_xdr_enc_remove(struct rpc_rqst *req, __be32 *p, const struct nfs | |||
1491 | struct compound_hdr hdr = { | 1414 | struct compound_hdr hdr = { |
1492 | .nops = 0, | 1415 | .nops = 0, |
1493 | }; | 1416 | }; |
1494 | int status; | ||
1495 | 1417 | ||
1496 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1418 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
1497 | encode_compound_hdr(&xdr, &hdr); | 1419 | encode_compound_hdr(&xdr, &hdr); |
1498 | if ((status = encode_putfh(&xdr, args->fh, &hdr)) != 0) | 1420 | encode_putfh(&xdr, args->fh, &hdr); |
1499 | goto out; | 1421 | encode_remove(&xdr, &args->name, &hdr); |
1500 | if ((status = encode_remove(&xdr, &args->name, &hdr)) != 0) | 1422 | encode_getfattr(&xdr, args->bitmask, &hdr); |
1501 | goto out; | ||
1502 | status = encode_getfattr(&xdr, args->bitmask, &hdr); | ||
1503 | out: | ||
1504 | encode_nops(&hdr); | 1423 | encode_nops(&hdr); |
1505 | return status; | 1424 | return 0; |
1506 | } | 1425 | } |
1507 | 1426 | ||
1508 | /* | 1427 | /* |
@@ -1514,27 +1433,18 @@ static int nfs4_xdr_enc_rename(struct rpc_rqst *req, __be32 *p, const struct nfs | |||
1514 | struct compound_hdr hdr = { | 1433 | struct compound_hdr hdr = { |
1515 | .nops = 0, | 1434 | .nops = 0, |
1516 | }; | 1435 | }; |
1517 | int status; | ||
1518 | 1436 | ||
1519 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1437 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
1520 | encode_compound_hdr(&xdr, &hdr); | 1438 | encode_compound_hdr(&xdr, &hdr); |
1521 | if ((status = encode_putfh(&xdr, args->old_dir, &hdr)) != 0) | 1439 | encode_putfh(&xdr, args->old_dir, &hdr); |
1522 | goto out; | 1440 | encode_savefh(&xdr, &hdr); |
1523 | if ((status = encode_savefh(&xdr, &hdr)) != 0) | 1441 | encode_putfh(&xdr, args->new_dir, &hdr); |
1524 | goto out; | 1442 | encode_rename(&xdr, args->old_name, args->new_name, &hdr); |
1525 | if ((status = encode_putfh(&xdr, args->new_dir, &hdr)) != 0) | 1443 | encode_getfattr(&xdr, args->bitmask, &hdr); |
1526 | goto out; | 1444 | encode_restorefh(&xdr, &hdr); |
1527 | if ((status = encode_rename(&xdr, args->old_name, args->new_name, | 1445 | encode_getfattr(&xdr, args->bitmask, &hdr); |
1528 | &hdr)) != 0) | ||
1529 | goto out; | ||
1530 | if ((status = encode_getfattr(&xdr, args->bitmask, &hdr)) != 0) | ||
1531 | goto out; | ||
1532 | if ((status = encode_restorefh(&xdr, &hdr)) != 0) | ||
1533 | goto out; | ||
1534 | status = encode_getfattr(&xdr, args->bitmask, &hdr); | ||
1535 | out: | ||
1536 | encode_nops(&hdr); | 1446 | encode_nops(&hdr); |
1537 | return status; | 1447 | return 0; |
1538 | } | 1448 | } |
1539 | 1449 | ||
1540 | /* | 1450 | /* |
@@ -1546,26 +1456,18 @@ static int nfs4_xdr_enc_link(struct rpc_rqst *req, __be32 *p, const struct nfs4_ | |||
1546 | struct compound_hdr hdr = { | 1456 | struct compound_hdr hdr = { |
1547 | .nops = 0, | 1457 | .nops = 0, |
1548 | }; | 1458 | }; |
1549 | int status; | ||
1550 | 1459 | ||
1551 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1460 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
1552 | encode_compound_hdr(&xdr, &hdr); | 1461 | encode_compound_hdr(&xdr, &hdr); |
1553 | if ((status = encode_putfh(&xdr, args->fh, &hdr)) != 0) | 1462 | encode_putfh(&xdr, args->fh, &hdr); |
1554 | goto out; | 1463 | encode_savefh(&xdr, &hdr); |
1555 | if ((status = encode_savefh(&xdr, &hdr)) != 0) | 1464 | encode_putfh(&xdr, args->dir_fh, &hdr); |
1556 | goto out; | 1465 | encode_link(&xdr, args->name, &hdr); |
1557 | if ((status = encode_putfh(&xdr, args->dir_fh, &hdr)) != 0) | 1466 | encode_getfattr(&xdr, args->bitmask, &hdr); |
1558 | goto out; | 1467 | encode_restorefh(&xdr, &hdr); |
1559 | if ((status = encode_link(&xdr, args->name, &hdr)) != 0) | 1468 | encode_getfattr(&xdr, args->bitmask, &hdr); |
1560 | goto out; | ||
1561 | if ((status = encode_getfattr(&xdr, args->bitmask, &hdr)) != 0) | ||
1562 | goto out; | ||
1563 | if ((status = encode_restorefh(&xdr, &hdr)) != 0) | ||
1564 | goto out; | ||
1565 | status = encode_getfattr(&xdr, args->bitmask, &hdr); | ||
1566 | out: | ||
1567 | encode_nops(&hdr); | 1469 | encode_nops(&hdr); |
1568 | return status; | 1470 | return 0; |
1569 | } | 1471 | } |
1570 | 1472 | ||
1571 | /* | 1473 | /* |
@@ -1577,26 +1479,18 @@ static int nfs4_xdr_enc_create(struct rpc_rqst *req, __be32 *p, const struct nfs | |||
1577 | struct compound_hdr hdr = { | 1479 | struct compound_hdr hdr = { |
1578 | .nops = 0, | 1480 | .nops = 0, |
1579 | }; | 1481 | }; |
1580 | int status; | ||
1581 | 1482 | ||
1582 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1483 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
1583 | encode_compound_hdr(&xdr, &hdr); | 1484 | encode_compound_hdr(&xdr, &hdr); |
1584 | if ((status = encode_putfh(&xdr, args->dir_fh, &hdr)) != 0) | 1485 | encode_putfh(&xdr, args->dir_fh, &hdr); |
1585 | goto out; | 1486 | encode_savefh(&xdr, &hdr); |
1586 | if ((status = encode_savefh(&xdr, &hdr)) != 0) | 1487 | encode_create(&xdr, args, &hdr); |
1587 | goto out; | 1488 | encode_getfh(&xdr, &hdr); |
1588 | if ((status = encode_create(&xdr, args, &hdr)) != 0) | 1489 | encode_getfattr(&xdr, args->bitmask, &hdr); |
1589 | goto out; | 1490 | encode_restorefh(&xdr, &hdr); |
1590 | if ((status = encode_getfh(&xdr, &hdr)) != 0) | 1491 | encode_getfattr(&xdr, args->bitmask, &hdr); |
1591 | goto out; | ||
1592 | if ((status = encode_getfattr(&xdr, args->bitmask, &hdr)) != 0) | ||
1593 | goto out; | ||
1594 | if ((status = encode_restorefh(&xdr, &hdr)) != 0) | ||
1595 | goto out; | ||
1596 | status = encode_getfattr(&xdr, args->bitmask, &hdr); | ||
1597 | out: | ||
1598 | encode_nops(&hdr); | 1492 | encode_nops(&hdr); |
1599 | return status; | 1493 | return 0; |
1600 | } | 1494 | } |
1601 | 1495 | ||
1602 | /* | 1496 | /* |
@@ -1616,14 +1510,13 @@ static int nfs4_xdr_enc_getattr(struct rpc_rqst *req, __be32 *p, const struct nf | |||
1616 | struct compound_hdr hdr = { | 1510 | struct compound_hdr hdr = { |
1617 | .nops = 0, | 1511 | .nops = 0, |
1618 | }; | 1512 | }; |
1619 | int status; | ||
1620 | 1513 | ||
1621 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1514 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
1622 | encode_compound_hdr(&xdr, &hdr); | 1515 | encode_compound_hdr(&xdr, &hdr); |
1623 | if ((status = encode_putfh(&xdr, args->fh, &hdr)) == 0) | 1516 | encode_putfh(&xdr, args->fh, &hdr); |
1624 | status = encode_getfattr(&xdr, args->bitmask, &hdr); | 1517 | encode_getfattr(&xdr, args->bitmask, &hdr); |
1625 | encode_nops(&hdr); | 1518 | encode_nops(&hdr); |
1626 | return status; | 1519 | return 0; |
1627 | } | 1520 | } |
1628 | 1521 | ||
1629 | /* | 1522 | /* |
@@ -1635,20 +1528,14 @@ static int nfs4_xdr_enc_close(struct rpc_rqst *req, __be32 *p, struct nfs_closea | |||
1635 | struct compound_hdr hdr = { | 1528 | struct compound_hdr hdr = { |
1636 | .nops = 0, | 1529 | .nops = 0, |
1637 | }; | 1530 | }; |
1638 | int status; | ||
1639 | 1531 | ||
1640 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1532 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
1641 | encode_compound_hdr(&xdr, &hdr); | 1533 | encode_compound_hdr(&xdr, &hdr); |
1642 | status = encode_putfh(&xdr, args->fh, &hdr); | 1534 | encode_putfh(&xdr, args->fh, &hdr); |
1643 | if(status) | 1535 | encode_close(&xdr, args, &hdr); |
1644 | goto out; | 1536 | encode_getfattr(&xdr, args->bitmask, &hdr); |
1645 | status = encode_close(&xdr, args, &hdr); | ||
1646 | if (status != 0) | ||
1647 | goto out; | ||
1648 | status = encode_getfattr(&xdr, args->bitmask, &hdr); | ||
1649 | out: | ||
1650 | encode_nops(&hdr); | 1537 | encode_nops(&hdr); |
1651 | return status; | 1538 | return 0; |
1652 | } | 1539 | } |
1653 | 1540 | ||
1654 | /* | 1541 | /* |
@@ -1660,32 +1547,18 @@ static int nfs4_xdr_enc_open(struct rpc_rqst *req, __be32 *p, struct nfs_openarg | |||
1660 | struct compound_hdr hdr = { | 1547 | struct compound_hdr hdr = { |
1661 | .nops = 0, | 1548 | .nops = 0, |
1662 | }; | 1549 | }; |
1663 | int status; | ||
1664 | 1550 | ||
1665 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1551 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
1666 | encode_compound_hdr(&xdr, &hdr); | 1552 | encode_compound_hdr(&xdr, &hdr); |
1667 | status = encode_putfh(&xdr, args->fh, &hdr); | 1553 | encode_putfh(&xdr, args->fh, &hdr); |
1668 | if (status) | 1554 | encode_savefh(&xdr, &hdr); |
1669 | goto out; | 1555 | encode_open(&xdr, args, &hdr); |
1670 | status = encode_savefh(&xdr, &hdr); | 1556 | encode_getfh(&xdr, &hdr); |
1671 | if (status) | 1557 | encode_getfattr(&xdr, args->bitmask, &hdr); |
1672 | goto out; | 1558 | encode_restorefh(&xdr, &hdr); |
1673 | status = encode_open(&xdr, args, &hdr); | 1559 | encode_getfattr(&xdr, args->bitmask, &hdr); |
1674 | if (status) | ||
1675 | goto out; | ||
1676 | status = encode_getfh(&xdr, &hdr); | ||
1677 | if (status) | ||
1678 | goto out; | ||
1679 | status = encode_getfattr(&xdr, args->bitmask, &hdr); | ||
1680 | if (status) | ||
1681 | goto out; | ||
1682 | status = encode_restorefh(&xdr, &hdr); | ||
1683 | if (status) | ||
1684 | goto out; | ||
1685 | status = encode_getfattr(&xdr, args->bitmask, &hdr); | ||
1686 | out: | ||
1687 | encode_nops(&hdr); | 1560 | encode_nops(&hdr); |
1688 | return status; | 1561 | return 0; |
1689 | } | 1562 | } |
1690 | 1563 | ||
1691 | /* | 1564 | /* |
@@ -1697,17 +1570,13 @@ static int nfs4_xdr_enc_open_confirm(struct rpc_rqst *req, __be32 *p, struct nfs | |||
1697 | struct compound_hdr hdr = { | 1570 | struct compound_hdr hdr = { |
1698 | .nops = 0, | 1571 | .nops = 0, |
1699 | }; | 1572 | }; |
1700 | int status; | ||
1701 | 1573 | ||
1702 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1574 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
1703 | encode_compound_hdr(&xdr, &hdr); | 1575 | encode_compound_hdr(&xdr, &hdr); |
1704 | status = encode_putfh(&xdr, args->fh, &hdr); | 1576 | encode_putfh(&xdr, args->fh, &hdr); |
1705 | if(status) | 1577 | encode_open_confirm(&xdr, args, &hdr); |
1706 | goto out; | ||
1707 | status = encode_open_confirm(&xdr, args, &hdr); | ||
1708 | out: | ||
1709 | encode_nops(&hdr); | 1578 | encode_nops(&hdr); |
1710 | return status; | 1579 | return 0; |
1711 | } | 1580 | } |
1712 | 1581 | ||
1713 | /* | 1582 | /* |
@@ -1719,20 +1588,14 @@ static int nfs4_xdr_enc_open_noattr(struct rpc_rqst *req, __be32 *p, struct nfs_ | |||
1719 | struct compound_hdr hdr = { | 1588 | struct compound_hdr hdr = { |
1720 | .nops = 0, | 1589 | .nops = 0, |
1721 | }; | 1590 | }; |
1722 | int status; | ||
1723 | 1591 | ||
1724 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1592 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
1725 | encode_compound_hdr(&xdr, &hdr); | 1593 | encode_compound_hdr(&xdr, &hdr); |
1726 | status = encode_putfh(&xdr, args->fh, &hdr); | 1594 | encode_putfh(&xdr, args->fh, &hdr); |
1727 | if (status) | 1595 | encode_open(&xdr, args, &hdr); |
1728 | goto out; | 1596 | encode_getfattr(&xdr, args->bitmask, &hdr); |
1729 | status = encode_open(&xdr, args, &hdr); | ||
1730 | if (status) | ||
1731 | goto out; | ||
1732 | status = encode_getfattr(&xdr, args->bitmask, &hdr); | ||
1733 | out: | ||
1734 | encode_nops(&hdr); | 1597 | encode_nops(&hdr); |
1735 | return status; | 1598 | return 0; |
1736 | } | 1599 | } |
1737 | 1600 | ||
1738 | /* | 1601 | /* |
@@ -1744,20 +1607,14 @@ static int nfs4_xdr_enc_open_downgrade(struct rpc_rqst *req, __be32 *p, struct n | |||
1744 | struct compound_hdr hdr = { | 1607 | struct compound_hdr hdr = { |
1745 | .nops = 0, | 1608 | .nops = 0, |
1746 | }; | 1609 | }; |
1747 | int status; | ||
1748 | 1610 | ||
1749 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1611 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
1750 | encode_compound_hdr(&xdr, &hdr); | 1612 | encode_compound_hdr(&xdr, &hdr); |
1751 | status = encode_putfh(&xdr, args->fh, &hdr); | 1613 | encode_putfh(&xdr, args->fh, &hdr); |
1752 | if (status) | 1614 | encode_open_downgrade(&xdr, args, &hdr); |
1753 | goto out; | 1615 | encode_getfattr(&xdr, args->bitmask, &hdr); |
1754 | status = encode_open_downgrade(&xdr, args, &hdr); | ||
1755 | if (status != 0) | ||
1756 | goto out; | ||
1757 | status = encode_getfattr(&xdr, args->bitmask, &hdr); | ||
1758 | out: | ||
1759 | encode_nops(&hdr); | 1616 | encode_nops(&hdr); |
1760 | return status; | 1617 | return 0; |
1761 | } | 1618 | } |
1762 | 1619 | ||
1763 | /* | 1620 | /* |
@@ -1769,17 +1626,13 @@ static int nfs4_xdr_enc_lock(struct rpc_rqst *req, __be32 *p, struct nfs_lock_ar | |||
1769 | struct compound_hdr hdr = { | 1626 | struct compound_hdr hdr = { |
1770 | .nops = 0, | 1627 | .nops = 0, |
1771 | }; | 1628 | }; |
1772 | int status; | ||
1773 | 1629 | ||
1774 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1630 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
1775 | encode_compound_hdr(&xdr, &hdr); | 1631 | encode_compound_hdr(&xdr, &hdr); |
1776 | status = encode_putfh(&xdr, args->fh, &hdr); | 1632 | encode_putfh(&xdr, args->fh, &hdr); |
1777 | if(status) | 1633 | encode_lock(&xdr, args, &hdr); |
1778 | goto out; | ||
1779 | status = encode_lock(&xdr, args, &hdr); | ||
1780 | out: | ||
1781 | encode_nops(&hdr); | 1634 | encode_nops(&hdr); |
1782 | return status; | 1635 | return 0; |
1783 | } | 1636 | } |
1784 | 1637 | ||
1785 | /* | 1638 | /* |
@@ -1791,17 +1644,13 @@ static int nfs4_xdr_enc_lockt(struct rpc_rqst *req, __be32 *p, struct nfs_lockt_ | |||
1791 | struct compound_hdr hdr = { | 1644 | struct compound_hdr hdr = { |
1792 | .nops = 0, | 1645 | .nops = 0, |
1793 | }; | 1646 | }; |
1794 | int status; | ||
1795 | 1647 | ||
1796 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1648 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
1797 | encode_compound_hdr(&xdr, &hdr); | 1649 | encode_compound_hdr(&xdr, &hdr); |
1798 | status = encode_putfh(&xdr, args->fh, &hdr); | 1650 | encode_putfh(&xdr, args->fh, &hdr); |
1799 | if(status) | 1651 | encode_lockt(&xdr, args, &hdr); |
1800 | goto out; | ||
1801 | status = encode_lockt(&xdr, args, &hdr); | ||
1802 | out: | ||
1803 | encode_nops(&hdr); | 1652 | encode_nops(&hdr); |
1804 | return status; | 1653 | return 0; |
1805 | } | 1654 | } |
1806 | 1655 | ||
1807 | /* | 1656 | /* |
@@ -1813,17 +1662,13 @@ static int nfs4_xdr_enc_locku(struct rpc_rqst *req, __be32 *p, struct nfs_locku_ | |||
1813 | struct compound_hdr hdr = { | 1662 | struct compound_hdr hdr = { |
1814 | .nops = 0, | 1663 | .nops = 0, |
1815 | }; | 1664 | }; |
1816 | int status; | ||
1817 | 1665 | ||
1818 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1666 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
1819 | encode_compound_hdr(&xdr, &hdr); | 1667 | encode_compound_hdr(&xdr, &hdr); |
1820 | status = encode_putfh(&xdr, args->fh, &hdr); | 1668 | encode_putfh(&xdr, args->fh, &hdr); |
1821 | if(status) | 1669 | encode_locku(&xdr, args, &hdr); |
1822 | goto out; | ||
1823 | status = encode_locku(&xdr, args, &hdr); | ||
1824 | out: | ||
1825 | encode_nops(&hdr); | 1670 | encode_nops(&hdr); |
1826 | return status; | 1671 | return 0; |
1827 | } | 1672 | } |
1828 | 1673 | ||
1829 | /* | 1674 | /* |
@@ -1837,14 +1682,11 @@ static int nfs4_xdr_enc_readlink(struct rpc_rqst *req, __be32 *p, const struct n | |||
1837 | }; | 1682 | }; |
1838 | struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth; | 1683 | struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth; |
1839 | unsigned int replen; | 1684 | unsigned int replen; |
1840 | int status; | ||
1841 | 1685 | ||
1842 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1686 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
1843 | encode_compound_hdr(&xdr, &hdr); | 1687 | encode_compound_hdr(&xdr, &hdr); |
1844 | status = encode_putfh(&xdr, args->fh, &hdr); | 1688 | encode_putfh(&xdr, args->fh, &hdr); |
1845 | if(status) | 1689 | encode_readlink(&xdr, args, req, &hdr); |
1846 | goto out; | ||
1847 | status = encode_readlink(&xdr, args, req, &hdr); | ||
1848 | 1690 | ||
1849 | /* set up reply kvec | 1691 | /* set up reply kvec |
1850 | * toplevel_status + taglen + rescount + OP_PUTFH + status | 1692 | * toplevel_status + taglen + rescount + OP_PUTFH + status |
@@ -1853,10 +1695,8 @@ static int nfs4_xdr_enc_readlink(struct rpc_rqst *req, __be32 *p, const struct n | |||
1853 | replen = (RPC_REPHDRSIZE + auth->au_rslack + NFS4_dec_readlink_sz) << 2; | 1695 | replen = (RPC_REPHDRSIZE + auth->au_rslack + NFS4_dec_readlink_sz) << 2; |
1854 | xdr_inline_pages(&req->rq_rcv_buf, replen, args->pages, | 1696 | xdr_inline_pages(&req->rq_rcv_buf, replen, args->pages, |
1855 | args->pgbase, args->pglen); | 1697 | args->pgbase, args->pglen); |
1856 | |||
1857 | out: | ||
1858 | encode_nops(&hdr); | 1698 | encode_nops(&hdr); |
1859 | return status; | 1699 | return 0; |
1860 | } | 1700 | } |
1861 | 1701 | ||
1862 | /* | 1702 | /* |
@@ -1870,14 +1710,11 @@ static int nfs4_xdr_enc_readdir(struct rpc_rqst *req, __be32 *p, const struct nf | |||
1870 | }; | 1710 | }; |
1871 | struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth; | 1711 | struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth; |
1872 | int replen; | 1712 | int replen; |
1873 | int status; | ||
1874 | 1713 | ||
1875 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1714 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
1876 | encode_compound_hdr(&xdr, &hdr); | 1715 | encode_compound_hdr(&xdr, &hdr); |
1877 | status = encode_putfh(&xdr, args->fh, &hdr); | 1716 | encode_putfh(&xdr, args->fh, &hdr); |
1878 | if(status) | 1717 | encode_readdir(&xdr, args, req, &hdr); |
1879 | goto out; | ||
1880 | status = encode_readdir(&xdr, args, req, &hdr); | ||
1881 | 1718 | ||
1882 | /* set up reply kvec | 1719 | /* set up reply kvec |
1883 | * toplevel_status + taglen + rescount + OP_PUTFH + status | 1720 | * toplevel_status + taglen + rescount + OP_PUTFH + status |
@@ -1889,10 +1726,8 @@ static int nfs4_xdr_enc_readdir(struct rpc_rqst *req, __be32 *p, const struct nf | |||
1889 | dprintk("%s: inlined page args = (%u, %p, %u, %u)\n", | 1726 | dprintk("%s: inlined page args = (%u, %p, %u, %u)\n", |
1890 | __func__, replen, args->pages, | 1727 | __func__, replen, args->pages, |
1891 | args->pgbase, args->count); | 1728 | args->pgbase, args->count); |
1892 | |||
1893 | out: | ||
1894 | encode_nops(&hdr); | 1729 | encode_nops(&hdr); |
1895 | return status; | 1730 | return 0; |
1896 | } | 1731 | } |
1897 | 1732 | ||
1898 | /* | 1733 | /* |
@@ -1905,16 +1740,12 @@ static int nfs4_xdr_enc_read(struct rpc_rqst *req, __be32 *p, struct nfs_readarg | |||
1905 | struct compound_hdr hdr = { | 1740 | struct compound_hdr hdr = { |
1906 | .nops = 0, | 1741 | .nops = 0, |
1907 | }; | 1742 | }; |
1908 | int replen, status; | 1743 | int replen; |
1909 | 1744 | ||
1910 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1745 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
1911 | encode_compound_hdr(&xdr, &hdr); | 1746 | encode_compound_hdr(&xdr, &hdr); |
1912 | status = encode_putfh(&xdr, args->fh, &hdr); | 1747 | encode_putfh(&xdr, args->fh, &hdr); |
1913 | if (status) | 1748 | encode_read(&xdr, args, &hdr); |
1914 | goto out; | ||
1915 | status = encode_read(&xdr, args, &hdr); | ||
1916 | if (status) | ||
1917 | goto out; | ||
1918 | 1749 | ||
1919 | /* set up reply kvec | 1750 | /* set up reply kvec |
1920 | * toplevel status + taglen=0 + rescount + OP_PUTFH + status | 1751 | * toplevel status + taglen=0 + rescount + OP_PUTFH + status |
@@ -1924,9 +1755,8 @@ static int nfs4_xdr_enc_read(struct rpc_rqst *req, __be32 *p, struct nfs_readarg | |||
1924 | xdr_inline_pages(&req->rq_rcv_buf, replen, | 1755 | xdr_inline_pages(&req->rq_rcv_buf, replen, |
1925 | args->pages, args->pgbase, args->count); | 1756 | args->pages, args->pgbase, args->count); |
1926 | req->rq_rcv_buf.flags |= XDRBUF_READ; | 1757 | req->rq_rcv_buf.flags |= XDRBUF_READ; |
1927 | out: | ||
1928 | encode_nops(&hdr); | 1758 | encode_nops(&hdr); |
1929 | return status; | 1759 | return 0; |
1930 | } | 1760 | } |
1931 | 1761 | ||
1932 | /* | 1762 | /* |
@@ -1938,20 +1768,14 @@ static int nfs4_xdr_enc_setattr(struct rpc_rqst *req, __be32 *p, struct nfs_seta | |||
1938 | struct compound_hdr hdr = { | 1768 | struct compound_hdr hdr = { |
1939 | .nops = 0, | 1769 | .nops = 0, |
1940 | }; | 1770 | }; |
1941 | int status; | ||
1942 | 1771 | ||
1943 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1772 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
1944 | encode_compound_hdr(&xdr, &hdr); | 1773 | encode_compound_hdr(&xdr, &hdr); |
1945 | status = encode_putfh(&xdr, args->fh, &hdr); | 1774 | encode_putfh(&xdr, args->fh, &hdr); |
1946 | if(status) | 1775 | encode_setattr(&xdr, args, args->server, &hdr); |
1947 | goto out; | 1776 | encode_getfattr(&xdr, args->bitmask, &hdr); |
1948 | status = encode_setattr(&xdr, args, args->server, &hdr); | ||
1949 | if(status) | ||
1950 | goto out; | ||
1951 | status = encode_getfattr(&xdr, args->bitmask, &hdr); | ||
1952 | out: | ||
1953 | encode_nops(&hdr); | 1777 | encode_nops(&hdr); |
1954 | return status; | 1778 | return 0; |
1955 | } | 1779 | } |
1956 | 1780 | ||
1957 | /* | 1781 | /* |
@@ -1966,21 +1790,19 @@ nfs4_xdr_enc_getacl(struct rpc_rqst *req, __be32 *p, | |||
1966 | struct compound_hdr hdr = { | 1790 | struct compound_hdr hdr = { |
1967 | .nops = 0, | 1791 | .nops = 0, |
1968 | }; | 1792 | }; |
1969 | int replen, status; | 1793 | int replen; |
1970 | 1794 | ||
1971 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1795 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
1972 | encode_compound_hdr(&xdr, &hdr); | 1796 | encode_compound_hdr(&xdr, &hdr); |
1973 | status = encode_putfh(&xdr, args->fh, &hdr); | 1797 | encode_putfh(&xdr, args->fh, &hdr); |
1974 | if (status) | 1798 | encode_getattr_two(&xdr, FATTR4_WORD0_ACL, 0, &hdr); |
1975 | goto out; | 1799 | |
1976 | status = encode_getattr_two(&xdr, FATTR4_WORD0_ACL, 0, &hdr); | ||
1977 | /* set up reply buffer: */ | 1800 | /* set up reply buffer: */ |
1978 | replen = (RPC_REPHDRSIZE + auth->au_rslack + NFS4_dec_getacl_sz) << 2; | 1801 | replen = (RPC_REPHDRSIZE + auth->au_rslack + NFS4_dec_getacl_sz) << 2; |
1979 | xdr_inline_pages(&req->rq_rcv_buf, replen, | 1802 | xdr_inline_pages(&req->rq_rcv_buf, replen, |
1980 | args->acl_pages, args->acl_pgbase, args->acl_len); | 1803 | args->acl_pages, args->acl_pgbase, args->acl_len); |
1981 | out: | ||
1982 | encode_nops(&hdr); | 1804 | encode_nops(&hdr); |
1983 | return status; | 1805 | return 0; |
1984 | } | 1806 | } |
1985 | 1807 | ||
1986 | /* | 1808 | /* |
@@ -1992,21 +1814,15 @@ static int nfs4_xdr_enc_write(struct rpc_rqst *req, __be32 *p, struct nfs_writea | |||
1992 | struct compound_hdr hdr = { | 1814 | struct compound_hdr hdr = { |
1993 | .nops = 0, | 1815 | .nops = 0, |
1994 | }; | 1816 | }; |
1995 | int status; | ||
1996 | 1817 | ||
1997 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1818 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
1998 | encode_compound_hdr(&xdr, &hdr); | 1819 | encode_compound_hdr(&xdr, &hdr); |
1999 | status = encode_putfh(&xdr, args->fh, &hdr); | 1820 | encode_putfh(&xdr, args->fh, &hdr); |
2000 | if (status) | 1821 | encode_write(&xdr, args, &hdr); |
2001 | goto out; | ||
2002 | status = encode_write(&xdr, args, &hdr); | ||
2003 | if (status) | ||
2004 | goto out; | ||
2005 | req->rq_snd_buf.flags |= XDRBUF_WRITE; | 1822 | req->rq_snd_buf.flags |= XDRBUF_WRITE; |
2006 | status = encode_getfattr(&xdr, args->bitmask, &hdr); | 1823 | encode_getfattr(&xdr, args->bitmask, &hdr); |
2007 | out: | ||
2008 | encode_nops(&hdr); | 1824 | encode_nops(&hdr); |
2009 | return status; | 1825 | return 0; |
2010 | } | 1826 | } |
2011 | 1827 | ||
2012 | /* | 1828 | /* |
@@ -2018,20 +1834,14 @@ static int nfs4_xdr_enc_commit(struct rpc_rqst *req, __be32 *p, struct nfs_write | |||
2018 | struct compound_hdr hdr = { | 1834 | struct compound_hdr hdr = { |
2019 | .nops = 0, | 1835 | .nops = 0, |
2020 | }; | 1836 | }; |
2021 | int status; | ||
2022 | 1837 | ||
2023 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1838 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
2024 | encode_compound_hdr(&xdr, &hdr); | 1839 | encode_compound_hdr(&xdr, &hdr); |
2025 | status = encode_putfh(&xdr, args->fh, &hdr); | 1840 | encode_putfh(&xdr, args->fh, &hdr); |
2026 | if (status) | 1841 | encode_commit(&xdr, args, &hdr); |
2027 | goto out; | 1842 | encode_getfattr(&xdr, args->bitmask, &hdr); |
2028 | status = encode_commit(&xdr, args, &hdr); | ||
2029 | if (status) | ||
2030 | goto out; | ||
2031 | status = encode_getfattr(&xdr, args->bitmask, &hdr); | ||
2032 | out: | ||
2033 | encode_nops(&hdr); | 1843 | encode_nops(&hdr); |
2034 | return status; | 1844 | return 0; |
2035 | } | 1845 | } |
2036 | 1846 | ||
2037 | /* | 1847 | /* |
@@ -2043,15 +1853,13 @@ static int nfs4_xdr_enc_fsinfo(struct rpc_rqst *req, __be32 *p, struct nfs4_fsin | |||
2043 | struct compound_hdr hdr = { | 1853 | struct compound_hdr hdr = { |
2044 | .nops = 0, | 1854 | .nops = 0, |
2045 | }; | 1855 | }; |
2046 | int status; | ||
2047 | 1856 | ||
2048 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1857 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
2049 | encode_compound_hdr(&xdr, &hdr); | 1858 | encode_compound_hdr(&xdr, &hdr); |
2050 | status = encode_putfh(&xdr, args->fh, &hdr); | 1859 | encode_putfh(&xdr, args->fh, &hdr); |
2051 | if (!status) | 1860 | encode_fsinfo(&xdr, args->bitmask, &hdr); |
2052 | status = encode_fsinfo(&xdr, args->bitmask, &hdr); | ||
2053 | encode_nops(&hdr); | 1861 | encode_nops(&hdr); |
2054 | return status; | 1862 | return 0; |
2055 | } | 1863 | } |
2056 | 1864 | ||
2057 | /* | 1865 | /* |
@@ -2063,17 +1871,14 @@ static int nfs4_xdr_enc_pathconf(struct rpc_rqst *req, __be32 *p, const struct n | |||
2063 | struct compound_hdr hdr = { | 1871 | struct compound_hdr hdr = { |
2064 | .nops = 0, | 1872 | .nops = 0, |
2065 | }; | 1873 | }; |
2066 | int status; | ||
2067 | 1874 | ||
2068 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1875 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
2069 | encode_compound_hdr(&xdr, &hdr); | 1876 | encode_compound_hdr(&xdr, &hdr); |
2070 | status = encode_putfh(&xdr, args->fh, &hdr); | 1877 | encode_putfh(&xdr, args->fh, &hdr); |
2071 | if (!status) | 1878 | encode_getattr_one(&xdr, args->bitmask[0] & nfs4_pathconf_bitmap[0], |
2072 | status = encode_getattr_one(&xdr, | 1879 | &hdr); |
2073 | args->bitmask[0] & nfs4_pathconf_bitmap[0], | ||
2074 | &hdr); | ||
2075 | encode_nops(&hdr); | 1880 | encode_nops(&hdr); |
2076 | return status; | 1881 | return 0; |
2077 | } | 1882 | } |
2078 | 1883 | ||
2079 | /* | 1884 | /* |
@@ -2085,17 +1890,14 @@ static int nfs4_xdr_enc_statfs(struct rpc_rqst *req, __be32 *p, const struct nfs | |||
2085 | struct compound_hdr hdr = { | 1890 | struct compound_hdr hdr = { |
2086 | .nops = 0, | 1891 | .nops = 0, |
2087 | }; | 1892 | }; |
2088 | int status; | ||
2089 | 1893 | ||
2090 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1894 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
2091 | encode_compound_hdr(&xdr, &hdr); | 1895 | encode_compound_hdr(&xdr, &hdr); |
2092 | status = encode_putfh(&xdr, args->fh, &hdr); | 1896 | encode_putfh(&xdr, args->fh, &hdr); |
2093 | if (status == 0) | 1897 | encode_getattr_two(&xdr, args->bitmask[0] & nfs4_statfs_bitmap[0], |
2094 | status = encode_getattr_two(&xdr, | 1898 | args->bitmask[1] & nfs4_statfs_bitmap[1], &hdr); |
2095 | args->bitmask[0] & nfs4_statfs_bitmap[0], | ||
2096 | args->bitmask[1] & nfs4_statfs_bitmap[1], &hdr); | ||
2097 | encode_nops(&hdr); | 1899 | encode_nops(&hdr); |
2098 | return status; | 1900 | return 0; |
2099 | } | 1901 | } |
2100 | 1902 | ||
2101 | /* | 1903 | /* |
@@ -2107,18 +1909,16 @@ static int nfs4_xdr_enc_server_caps(struct rpc_rqst *req, __be32 *p, const struc | |||
2107 | struct compound_hdr hdr = { | 1909 | struct compound_hdr hdr = { |
2108 | .nops = 0, | 1910 | .nops = 0, |
2109 | }; | 1911 | }; |
2110 | int status; | ||
2111 | 1912 | ||
2112 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1913 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
2113 | encode_compound_hdr(&xdr, &hdr); | 1914 | encode_compound_hdr(&xdr, &hdr); |
2114 | status = encode_putfh(&xdr, fhandle, &hdr); | 1915 | encode_putfh(&xdr, fhandle, &hdr); |
2115 | if (status == 0) | 1916 | encode_getattr_one(&xdr, FATTR4_WORD0_SUPPORTED_ATTRS| |
2116 | status = encode_getattr_one(&xdr, FATTR4_WORD0_SUPPORTED_ATTRS| | 1917 | FATTR4_WORD0_LINK_SUPPORT| |
2117 | FATTR4_WORD0_LINK_SUPPORT| | 1918 | FATTR4_WORD0_SYMLINK_SUPPORT| |
2118 | FATTR4_WORD0_SYMLINK_SUPPORT| | 1919 | FATTR4_WORD0_ACLSUPPORT, &hdr); |
2119 | FATTR4_WORD0_ACLSUPPORT, &hdr); | ||
2120 | encode_nops(&hdr); | 1920 | encode_nops(&hdr); |
2121 | return status; | 1921 | return 0; |
2122 | } | 1922 | } |
2123 | 1923 | ||
2124 | /* | 1924 | /* |
@@ -2130,13 +1930,12 @@ static int nfs4_xdr_enc_renew(struct rpc_rqst *req, __be32 *p, struct nfs_client | |||
2130 | struct compound_hdr hdr = { | 1930 | struct compound_hdr hdr = { |
2131 | .nops = 0, | 1931 | .nops = 0, |
2132 | }; | 1932 | }; |
2133 | int status; | ||
2134 | 1933 | ||
2135 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1934 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
2136 | encode_compound_hdr(&xdr, &hdr); | 1935 | encode_compound_hdr(&xdr, &hdr); |
2137 | status = encode_renew(&xdr, clp, &hdr); | 1936 | encode_renew(&xdr, clp, &hdr); |
2138 | encode_nops(&hdr); | 1937 | encode_nops(&hdr); |
2139 | return status; | 1938 | return 0; |
2140 | } | 1939 | } |
2141 | 1940 | ||
2142 | /* | 1941 | /* |
@@ -2148,13 +1947,12 @@ static int nfs4_xdr_enc_setclientid(struct rpc_rqst *req, __be32 *p, struct nfs4 | |||
2148 | struct compound_hdr hdr = { | 1947 | struct compound_hdr hdr = { |
2149 | .nops = 0, | 1948 | .nops = 0, |
2150 | }; | 1949 | }; |
2151 | int status; | ||
2152 | 1950 | ||
2153 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1951 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
2154 | encode_compound_hdr(&xdr, &hdr); | 1952 | encode_compound_hdr(&xdr, &hdr); |
2155 | status = encode_setclientid(&xdr, sc, &hdr); | 1953 | encode_setclientid(&xdr, sc, &hdr); |
2156 | encode_nops(&hdr); | 1954 | encode_nops(&hdr); |
2157 | return status; | 1955 | return 0; |
2158 | } | 1956 | } |
2159 | 1957 | ||
2160 | /* | 1958 | /* |
@@ -2167,17 +1965,14 @@ static int nfs4_xdr_enc_setclientid_confirm(struct rpc_rqst *req, __be32 *p, str | |||
2167 | .nops = 0, | 1965 | .nops = 0, |
2168 | }; | 1966 | }; |
2169 | const u32 lease_bitmap[2] = { FATTR4_WORD0_LEASE_TIME, 0 }; | 1967 | const u32 lease_bitmap[2] = { FATTR4_WORD0_LEASE_TIME, 0 }; |
2170 | int status; | ||
2171 | 1968 | ||
2172 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1969 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
2173 | encode_compound_hdr(&xdr, &hdr); | 1970 | encode_compound_hdr(&xdr, &hdr); |
2174 | status = encode_setclientid_confirm(&xdr, clp, &hdr); | 1971 | encode_setclientid_confirm(&xdr, clp, &hdr); |
2175 | if (!status) | 1972 | encode_putrootfh(&xdr, &hdr); |
2176 | status = encode_putrootfh(&xdr, &hdr); | 1973 | encode_fsinfo(&xdr, lease_bitmap, &hdr); |
2177 | if (!status) | ||
2178 | status = encode_fsinfo(&xdr, lease_bitmap, &hdr); | ||
2179 | encode_nops(&hdr); | 1974 | encode_nops(&hdr); |
2180 | return status; | 1975 | return 0; |
2181 | } | 1976 | } |
2182 | 1977 | ||
2183 | /* | 1978 | /* |
@@ -2189,20 +1984,14 @@ static int nfs4_xdr_enc_delegreturn(struct rpc_rqst *req, __be32 *p, const struc | |||
2189 | struct compound_hdr hdr = { | 1984 | struct compound_hdr hdr = { |
2190 | .nops = 0, | 1985 | .nops = 0, |
2191 | }; | 1986 | }; |
2192 | int status; | ||
2193 | 1987 | ||
2194 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 1988 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
2195 | encode_compound_hdr(&xdr, &hdr); | 1989 | encode_compound_hdr(&xdr, &hdr); |
2196 | status = encode_putfh(&xdr, args->fhandle, &hdr); | 1990 | encode_putfh(&xdr, args->fhandle, &hdr); |
2197 | if (status != 0) | 1991 | encode_delegreturn(&xdr, args->stateid, &hdr); |
2198 | goto out; | 1992 | encode_getfattr(&xdr, args->bitmask, &hdr); |
2199 | status = encode_delegreturn(&xdr, args->stateid, &hdr); | ||
2200 | if (status != 0) | ||
2201 | goto out; | ||
2202 | status = encode_getfattr(&xdr, args->bitmask, &hdr); | ||
2203 | out: | ||
2204 | encode_nops(&hdr); | 1993 | encode_nops(&hdr); |
2205 | return status; | 1994 | return 0; |
2206 | } | 1995 | } |
2207 | 1996 | ||
2208 | /* | 1997 | /* |
@@ -2216,16 +2005,13 @@ static int nfs4_xdr_enc_fs_locations(struct rpc_rqst *req, __be32 *p, struct nfs | |||
2216 | }; | 2005 | }; |
2217 | struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth; | 2006 | struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth; |
2218 | int replen; | 2007 | int replen; |
2219 | int status; | ||
2220 | 2008 | ||
2221 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 2009 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
2222 | encode_compound_hdr(&xdr, &hdr); | 2010 | encode_compound_hdr(&xdr, &hdr); |
2223 | if ((status = encode_putfh(&xdr, args->dir_fh, &hdr)) != 0) | 2011 | encode_putfh(&xdr, args->dir_fh, &hdr); |
2224 | goto out; | 2012 | encode_lookup(&xdr, args->name, &hdr); |
2225 | if ((status = encode_lookup(&xdr, args->name, &hdr)) != 0) | 2013 | encode_fs_locations(&xdr, args->bitmask, &hdr); |
2226 | goto out; | 2014 | |
2227 | if ((status = encode_fs_locations(&xdr, args->bitmask, &hdr)) != 0) | ||
2228 | goto out; | ||
2229 | /* set up reply | 2015 | /* set up reply |
2230 | * toplevel_status + OP_PUTFH + status | 2016 | * toplevel_status + OP_PUTFH + status |
2231 | * + OP_LOOKUP + status + OP_GETATTR + status = 7 | 2017 | * + OP_LOOKUP + status + OP_GETATTR + status = 7 |
@@ -2233,9 +2019,8 @@ static int nfs4_xdr_enc_fs_locations(struct rpc_rqst *req, __be32 *p, struct nfs | |||
2233 | replen = (RPC_REPHDRSIZE + auth->au_rslack + 7) << 2; | 2019 | replen = (RPC_REPHDRSIZE + auth->au_rslack + 7) << 2; |
2234 | xdr_inline_pages(&req->rq_rcv_buf, replen, &args->page, | 2020 | xdr_inline_pages(&req->rq_rcv_buf, replen, &args->page, |
2235 | 0, PAGE_SIZE); | 2021 | 0, PAGE_SIZE); |
2236 | out: | ||
2237 | encode_nops(&hdr); | 2022 | encode_nops(&hdr); |
2238 | return status; | 2023 | return 0; |
2239 | } | 2024 | } |
2240 | 2025 | ||
2241 | /* | 2026 | /* |
@@ -4115,11 +3900,8 @@ nfs4_xdr_enc_setacl(struct rpc_rqst *req, __be32 *p, struct nfs_setaclargs *args | |||
4115 | 3900 | ||
4116 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); | 3901 | xdr_init_encode(&xdr, &req->rq_snd_buf, p); |
4117 | encode_compound_hdr(&xdr, &hdr); | 3902 | encode_compound_hdr(&xdr, &hdr); |
4118 | status = encode_putfh(&xdr, args->fh, &hdr); | 3903 | encode_putfh(&xdr, args->fh, &hdr); |
4119 | if (status) | ||
4120 | goto out; | ||
4121 | status = encode_setacl(&xdr, args, &hdr); | 3904 | status = encode_setacl(&xdr, args, &hdr); |
4122 | out: | ||
4123 | encode_nops(&hdr); | 3905 | encode_nops(&hdr); |
4124 | return status; | 3906 | return status; |
4125 | } | 3907 | } |