aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Adamson <andros@netapp.com>2008-12-23 16:06:17 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-12-23 16:06:17 -0500
commitd017931cff77f2a1603c9c76e96477743abc9f41 (patch)
treeda9c7f8d95d244c40141bef3d73d62ffc142af4d
parent49c2559e29884fbb13fd273a108b213decd1d8a5 (diff)
NFS: increment number of operations in each encode routine
Signed-off-by: Andy Adamson<andros@netapp.com> Signed-off-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/nfs4xdr.c417
1 files changed, 247 insertions, 170 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 273d0010060c..8f6c061bb6c4 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -541,6 +541,7 @@ static struct {
541struct compound_hdr { 541struct compound_hdr {
542 int32_t status; 542 int32_t status;
543 uint32_t nops; 543 uint32_t nops;
544 __be32 * nops_p;
544 uint32_t taglen; 545 uint32_t taglen;
545 char * tag; 546 char * tag;
546}; 547};
@@ -578,7 +579,7 @@ static void encode_string(struct xdr_stream *xdr, unsigned int len, const char *
578 xdr_encode_opaque(p, str, len); 579 xdr_encode_opaque(p, str, len);
579} 580}
580 581
581static int encode_compound_hdr(struct xdr_stream *xdr, struct compound_hdr *hdr) 582static void encode_compound_hdr(struct xdr_stream *xdr, struct compound_hdr *hdr)
582{ 583{
583 __be32 *p; 584 __be32 *p;
584 585
@@ -588,8 +589,13 @@ static int encode_compound_hdr(struct xdr_stream *xdr, struct compound_hdr *hdr)
588 WRITE32(hdr->taglen); 589 WRITE32(hdr->taglen);
589 WRITEMEM(hdr->tag, hdr->taglen); 590 WRITEMEM(hdr->tag, hdr->taglen);
590 WRITE32(NFS4_MINOR_VERSION); 591 WRITE32(NFS4_MINOR_VERSION);
592 hdr->nops_p = p;
591 WRITE32(hdr->nops); 593 WRITE32(hdr->nops);
592 return 0; 594}
595
596static void encode_nops(struct compound_hdr *hdr)
597{
598 *hdr->nops_p = htonl(hdr->nops);
593} 599}
594 600
595static void encode_nfs4_verifier(struct xdr_stream *xdr, const nfs4_verifier *verf) 601static void encode_nfs4_verifier(struct xdr_stream *xdr, const nfs4_verifier *verf)
@@ -728,18 +734,19 @@ static int encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const s
728 return status; 734 return status;
729} 735}
730 736
731static int encode_access(struct xdr_stream *xdr, u32 access) 737static int encode_access(struct xdr_stream *xdr, u32 access, struct compound_hdr *hdr)
732{ 738{
733 __be32 *p; 739 __be32 *p;
734 740
735 RESERVE_SPACE(8); 741 RESERVE_SPACE(8);
736 WRITE32(OP_ACCESS); 742 WRITE32(OP_ACCESS);
737 WRITE32(access); 743 WRITE32(access);
744 hdr->nops++;
738 745
739 return 0; 746 return 0;
740} 747}
741 748
742static int encode_close(struct xdr_stream *xdr, const struct nfs_closeargs *arg) 749static int encode_close(struct xdr_stream *xdr, const struct nfs_closeargs *arg, struct compound_hdr *hdr)
743{ 750{
744 __be32 *p; 751 __be32 *p;
745 752
@@ -747,11 +754,12 @@ static int encode_close(struct xdr_stream *xdr, const struct nfs_closeargs *arg)
747 WRITE32(OP_CLOSE); 754 WRITE32(OP_CLOSE);
748 WRITE32(arg->seqid->sequence->counter); 755 WRITE32(arg->seqid->sequence->counter);
749 WRITEMEM(arg->stateid->data, NFS4_STATEID_SIZE); 756 WRITEMEM(arg->stateid->data, NFS4_STATEID_SIZE);
757 hdr->nops++;
750 758
751 return 0; 759 return 0;
752} 760}
753 761
754static int encode_commit(struct xdr_stream *xdr, const struct nfs_writeargs *args) 762static int encode_commit(struct xdr_stream *xdr, const struct nfs_writeargs *args, struct compound_hdr *hdr)
755{ 763{
756 __be32 *p; 764 __be32 *p;
757 765
@@ -759,11 +767,12 @@ static int encode_commit(struct xdr_stream *xdr, const struct nfs_writeargs *arg
759 WRITE32(OP_COMMIT); 767 WRITE32(OP_COMMIT);
760 WRITE64(args->offset); 768 WRITE64(args->offset);
761 WRITE32(args->count); 769 WRITE32(args->count);
770 hdr->nops++;
762 771
763 return 0; 772 return 0;
764} 773}
765 774
766static int encode_create(struct xdr_stream *xdr, const struct nfs4_create_arg *create) 775static int encode_create(struct xdr_stream *xdr, const struct nfs4_create_arg *create, struct compound_hdr *hdr)
767{ 776{
768 __be32 *p; 777 __be32 *p;
769 778
@@ -791,11 +800,12 @@ static int encode_create(struct xdr_stream *xdr, const struct nfs4_create_arg *c
791 RESERVE_SPACE(4 + create->name->len); 800 RESERVE_SPACE(4 + create->name->len);
792 WRITE32(create->name->len); 801 WRITE32(create->name->len);
793 WRITEMEM(create->name->name, create->name->len); 802 WRITEMEM(create->name->name, create->name->len);
803 hdr->nops++;
794 804
795 return encode_attrs(xdr, create->attrs, create->server); 805 return encode_attrs(xdr, create->attrs, create->server);
796} 806}
797 807
798static int encode_getattr_one(struct xdr_stream *xdr, uint32_t bitmap) 808static int encode_getattr_one(struct xdr_stream *xdr, uint32_t bitmap, struct compound_hdr *hdr)
799{ 809{
800 __be32 *p; 810 __be32 *p;
801 811
@@ -803,10 +813,11 @@ static int encode_getattr_one(struct xdr_stream *xdr, uint32_t bitmap)
803 WRITE32(OP_GETATTR); 813 WRITE32(OP_GETATTR);
804 WRITE32(1); 814 WRITE32(1);
805 WRITE32(bitmap); 815 WRITE32(bitmap);
816 hdr->nops++;
806 return 0; 817 return 0;
807} 818}
808 819
809static int encode_getattr_two(struct xdr_stream *xdr, uint32_t bm0, uint32_t bm1) 820static int encode_getattr_two(struct xdr_stream *xdr, uint32_t bm0, uint32_t bm1, struct compound_hdr *hdr)
810{ 821{
811 __be32 *p; 822 __be32 *p;
812 823
@@ -815,40 +826,43 @@ static int encode_getattr_two(struct xdr_stream *xdr, uint32_t bm0, uint32_t bm1
815 WRITE32(2); 826 WRITE32(2);
816 WRITE32(bm0); 827 WRITE32(bm0);
817 WRITE32(bm1); 828 WRITE32(bm1);
829 hdr->nops++;
818 return 0; 830 return 0;
819} 831}
820 832
821static int encode_getfattr(struct xdr_stream *xdr, const u32* bitmask) 833static int encode_getfattr(struct xdr_stream *xdr, const u32* bitmask, struct compound_hdr *hdr)
822{ 834{
823 return encode_getattr_two(xdr, 835 return encode_getattr_two(xdr,
824 bitmask[0] & nfs4_fattr_bitmap[0], 836 bitmask[0] & nfs4_fattr_bitmap[0],
825 bitmask[1] & nfs4_fattr_bitmap[1]); 837 bitmask[1] & nfs4_fattr_bitmap[1], hdr);
826} 838}
827 839
828static int encode_fsinfo(struct xdr_stream *xdr, const u32* bitmask) 840static int encode_fsinfo(struct xdr_stream *xdr, const u32* bitmask, struct compound_hdr *hdr)
829{ 841{
830 return encode_getattr_two(xdr, bitmask[0] & nfs4_fsinfo_bitmap[0], 842 return encode_getattr_two(xdr, bitmask[0] & nfs4_fsinfo_bitmap[0],
831 bitmask[1] & nfs4_fsinfo_bitmap[1]); 843 bitmask[1] & nfs4_fsinfo_bitmap[1], hdr);
832} 844}
833 845
834static int encode_fs_locations(struct xdr_stream *xdr, const u32* bitmask) 846static int encode_fs_locations(struct xdr_stream *xdr, const u32* bitmask, struct compound_hdr *hdr)
835{ 847{
836 return encode_getattr_two(xdr, 848 return encode_getattr_two(xdr,
837 bitmask[0] & nfs4_fs_locations_bitmap[0], 849 bitmask[0] & nfs4_fs_locations_bitmap[0],
838 bitmask[1] & nfs4_fs_locations_bitmap[1]); 850 bitmask[1] & nfs4_fs_locations_bitmap[1],
851 hdr);
839} 852}
840 853
841static int encode_getfh(struct xdr_stream *xdr) 854static int encode_getfh(struct xdr_stream *xdr, struct compound_hdr *hdr)
842{ 855{
843 __be32 *p; 856 __be32 *p;
844 857
845 RESERVE_SPACE(4); 858 RESERVE_SPACE(4);
846 WRITE32(OP_GETFH); 859 WRITE32(OP_GETFH);
860 hdr->nops++;
847 861
848 return 0; 862 return 0;
849} 863}
850 864
851static int encode_link(struct xdr_stream *xdr, const struct qstr *name) 865static int encode_link(struct xdr_stream *xdr, const struct qstr *name, struct compound_hdr *hdr)
852{ 866{
853 __be32 *p; 867 __be32 *p;
854 868
@@ -856,6 +870,7 @@ static int encode_link(struct xdr_stream *xdr, const struct qstr *name)
856 WRITE32(OP_LINK); 870 WRITE32(OP_LINK);
857 WRITE32(name->len); 871 WRITE32(name->len);
858 WRITEMEM(name->name, name->len); 872 WRITEMEM(name->name, name->len);
873 hdr->nops++;
859 874
860 return 0; 875 return 0;
861} 876}
@@ -878,7 +893,7 @@ static inline uint64_t nfs4_lock_length(struct file_lock *fl)
878 * opcode,type,reclaim,offset,length,new_lock_owner = 32 893 * opcode,type,reclaim,offset,length,new_lock_owner = 32
879 * open_seqid,open_stateid,lock_seqid,lock_owner.clientid, lock_owner.id = 40 894 * open_seqid,open_stateid,lock_seqid,lock_owner.clientid, lock_owner.id = 40
880 */ 895 */
881static int encode_lock(struct xdr_stream *xdr, const struct nfs_lock_args *args) 896static int encode_lock(struct xdr_stream *xdr, const struct nfs_lock_args *args, struct compound_hdr *hdr)
882{ 897{
883 __be32 *p; 898 __be32 *p;
884 899
@@ -904,11 +919,12 @@ static int encode_lock(struct xdr_stream *xdr, const struct nfs_lock_args *args)
904 WRITEMEM(args->lock_stateid->data, NFS4_STATEID_SIZE); 919 WRITEMEM(args->lock_stateid->data, NFS4_STATEID_SIZE);
905 WRITE32(args->lock_seqid->sequence->counter); 920 WRITE32(args->lock_seqid->sequence->counter);
906 } 921 }
922 hdr->nops++;
907 923
908 return 0; 924 return 0;
909} 925}
910 926
911static int encode_lockt(struct xdr_stream *xdr, const struct nfs_lockt_args *args) 927static int encode_lockt(struct xdr_stream *xdr, const struct nfs_lockt_args *args, struct compound_hdr *hdr)
912{ 928{
913 __be32 *p; 929 __be32 *p;
914 930
@@ -921,11 +937,12 @@ static int encode_lockt(struct xdr_stream *xdr, const struct nfs_lockt_args *arg
921 WRITE32(16); 937 WRITE32(16);
922 WRITEMEM("lock id:", 8); 938 WRITEMEM("lock id:", 8);
923 WRITE64(args->lock_owner.id); 939 WRITE64(args->lock_owner.id);
940 hdr->nops++;
924 941
925 return 0; 942 return 0;
926} 943}
927 944
928static int encode_locku(struct xdr_stream *xdr, const struct nfs_locku_args *args) 945static int encode_locku(struct xdr_stream *xdr, const struct nfs_locku_args *args, struct compound_hdr *hdr)
929{ 946{
930 __be32 *p; 947 __be32 *p;
931 948
@@ -936,11 +953,12 @@ static int encode_locku(struct xdr_stream *xdr, const struct nfs_locku_args *arg
936 WRITEMEM(args->stateid->data, NFS4_STATEID_SIZE); 953 WRITEMEM(args->stateid->data, NFS4_STATEID_SIZE);
937 WRITE64(args->fl->fl_start); 954 WRITE64(args->fl->fl_start);
938 WRITE64(nfs4_lock_length(args->fl)); 955 WRITE64(nfs4_lock_length(args->fl));
956 hdr->nops++;
939 957
940 return 0; 958 return 0;
941} 959}
942 960
943static int encode_lookup(struct xdr_stream *xdr, const struct qstr *name) 961static int encode_lookup(struct xdr_stream *xdr, const struct qstr *name, struct compound_hdr *hdr)
944{ 962{
945 int len = name->len; 963 int len = name->len;
946 __be32 *p; 964 __be32 *p;
@@ -949,6 +967,7 @@ static int encode_lookup(struct xdr_stream *xdr, const struct qstr *name)
949 WRITE32(OP_LOOKUP); 967 WRITE32(OP_LOOKUP);
950 WRITE32(len); 968 WRITE32(len);
951 WRITEMEM(name->name, len); 969 WRITEMEM(name->name, len);
970 hdr->nops++;
952 971
953 return 0; 972 return 0;
954} 973}
@@ -1072,7 +1091,7 @@ static inline void encode_claim_delegate_cur(struct xdr_stream *xdr, const struc
1072 encode_string(xdr, name->len, name->name); 1091 encode_string(xdr, name->len, name->name);
1073} 1092}
1074 1093
1075static int encode_open(struct xdr_stream *xdr, const struct nfs_openargs *arg) 1094static int encode_open(struct xdr_stream *xdr, const struct nfs_openargs *arg, struct compound_hdr *hdr)
1076{ 1095{
1077 encode_openhdr(xdr, arg); 1096 encode_openhdr(xdr, arg);
1078 encode_opentype(xdr, arg); 1097 encode_opentype(xdr, arg);
@@ -1089,10 +1108,11 @@ static int encode_open(struct xdr_stream *xdr, const struct nfs_openargs *arg)
1089 default: 1108 default:
1090 BUG(); 1109 BUG();
1091 } 1110 }
1111 hdr->nops++;
1092 return 0; 1112 return 0;
1093} 1113}
1094 1114
1095static int encode_open_confirm(struct xdr_stream *xdr, const struct nfs_open_confirmargs *arg) 1115static int encode_open_confirm(struct xdr_stream *xdr, const struct nfs_open_confirmargs *arg, struct compound_hdr *hdr)
1096{ 1116{
1097 __be32 *p; 1117 __be32 *p;
1098 1118
@@ -1100,11 +1120,12 @@ static int encode_open_confirm(struct xdr_stream *xdr, const struct nfs_open_con
1100 WRITE32(OP_OPEN_CONFIRM); 1120 WRITE32(OP_OPEN_CONFIRM);
1101 WRITEMEM(arg->stateid->data, NFS4_STATEID_SIZE); 1121 WRITEMEM(arg->stateid->data, NFS4_STATEID_SIZE);
1102 WRITE32(arg->seqid->sequence->counter); 1122 WRITE32(arg->seqid->sequence->counter);
1123 hdr->nops++;
1103 1124
1104 return 0; 1125 return 0;
1105} 1126}
1106 1127
1107static int encode_open_downgrade(struct xdr_stream *xdr, const struct nfs_closeargs *arg) 1128static int encode_open_downgrade(struct xdr_stream *xdr, const struct nfs_closeargs *arg, struct compound_hdr *hdr)
1108{ 1129{
1109 __be32 *p; 1130 __be32 *p;
1110 1131
@@ -1113,11 +1134,12 @@ static int encode_open_downgrade(struct xdr_stream *xdr, const struct nfs_closea
1113 WRITEMEM(arg->stateid->data, NFS4_STATEID_SIZE); 1134 WRITEMEM(arg->stateid->data, NFS4_STATEID_SIZE);
1114 WRITE32(arg->seqid->sequence->counter); 1135 WRITE32(arg->seqid->sequence->counter);
1115 encode_share_access(xdr, arg->fmode); 1136 encode_share_access(xdr, arg->fmode);
1137 hdr->nops++;
1116 return 0; 1138 return 0;
1117} 1139}
1118 1140
1119static int 1141static int
1120encode_putfh(struct xdr_stream *xdr, const struct nfs_fh *fh) 1142encode_putfh(struct xdr_stream *xdr, const struct nfs_fh *fh, struct compound_hdr *hdr)
1121{ 1143{
1122 int len = fh->size; 1144 int len = fh->size;
1123 __be32 *p; 1145 __be32 *p;
@@ -1126,16 +1148,18 @@ encode_putfh(struct xdr_stream *xdr, const struct nfs_fh *fh)
1126 WRITE32(OP_PUTFH); 1148 WRITE32(OP_PUTFH);
1127 WRITE32(len); 1149 WRITE32(len);
1128 WRITEMEM(fh->data, len); 1150 WRITEMEM(fh->data, len);
1151 hdr->nops++;
1129 1152
1130 return 0; 1153 return 0;
1131} 1154}
1132 1155
1133static int encode_putrootfh(struct xdr_stream *xdr) 1156static int encode_putrootfh(struct xdr_stream *xdr, struct compound_hdr *hdr)
1134{ 1157{
1135 __be32 *p; 1158 __be32 *p;
1136 1159
1137 RESERVE_SPACE(4); 1160 RESERVE_SPACE(4);
1138 WRITE32(OP_PUTROOTFH); 1161 WRITE32(OP_PUTROOTFH);
1162 hdr->nops++;
1139 1163
1140 return 0; 1164 return 0;
1141} 1165}
@@ -1153,7 +1177,7 @@ static void encode_stateid(struct xdr_stream *xdr, const struct nfs_open_context
1153 WRITEMEM(zero_stateid.data, NFS4_STATEID_SIZE); 1177 WRITEMEM(zero_stateid.data, NFS4_STATEID_SIZE);
1154} 1178}
1155 1179
1156static int encode_read(struct xdr_stream *xdr, const struct nfs_readargs *args) 1180static int encode_read(struct xdr_stream *xdr, const struct nfs_readargs *args, struct compound_hdr *hdr)
1157{ 1181{
1158 __be32 *p; 1182 __be32 *p;
1159 1183
@@ -1165,11 +1189,12 @@ static int encode_read(struct xdr_stream *xdr, const struct nfs_readargs *args)
1165 RESERVE_SPACE(12); 1189 RESERVE_SPACE(12);
1166 WRITE64(args->offset); 1190 WRITE64(args->offset);
1167 WRITE32(args->count); 1191 WRITE32(args->count);
1192 hdr->nops++;
1168 1193
1169 return 0; 1194 return 0;
1170} 1195}
1171 1196
1172static int encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg *readdir, struct rpc_rqst *req) 1197static int encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg *readdir, struct rpc_rqst *req, struct compound_hdr *hdr)
1173{ 1198{
1174 uint32_t attrs[2] = { 1199 uint32_t attrs[2] = {
1175 FATTR4_WORD0_RDATTR_ERROR|FATTR4_WORD0_FILEID, 1200 FATTR4_WORD0_RDATTR_ERROR|FATTR4_WORD0_FILEID,
@@ -1191,6 +1216,7 @@ static int encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg
1191 attrs[1] &= ~FATTR4_WORD1_MOUNTED_ON_FILEID; 1216 attrs[1] &= ~FATTR4_WORD1_MOUNTED_ON_FILEID;
1192 WRITE32(attrs[0] & readdir->bitmask[0]); 1217 WRITE32(attrs[0] & readdir->bitmask[0]);
1193 WRITE32(attrs[1] & readdir->bitmask[1]); 1218 WRITE32(attrs[1] & readdir->bitmask[1]);
1219 hdr->nops++;
1194 dprintk("%s: cookie = %Lu, verifier = %08x:%08x, bitmap = %08x:%08x\n", 1220 dprintk("%s: cookie = %Lu, verifier = %08x:%08x, bitmap = %08x:%08x\n",
1195 __func__, 1221 __func__,
1196 (unsigned long long)readdir->cookie, 1222 (unsigned long long)readdir->cookie,
@@ -1202,17 +1228,18 @@ static int encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg
1202 return 0; 1228 return 0;
1203} 1229}
1204 1230
1205static int encode_readlink(struct xdr_stream *xdr, const struct nfs4_readlink *readlink, struct rpc_rqst *req) 1231static int encode_readlink(struct xdr_stream *xdr, const struct nfs4_readlink *readlink, struct rpc_rqst *req, struct compound_hdr *hdr)
1206{ 1232{
1207 __be32 *p; 1233 __be32 *p;
1208 1234
1209 RESERVE_SPACE(4); 1235 RESERVE_SPACE(4);
1210 WRITE32(OP_READLINK); 1236 WRITE32(OP_READLINK);
1237 hdr->nops++;
1211 1238
1212 return 0; 1239 return 0;
1213} 1240}
1214 1241
1215static int encode_remove(struct xdr_stream *xdr, const struct qstr *name) 1242static int encode_remove(struct xdr_stream *xdr, const struct qstr *name, struct compound_hdr *hdr)
1216{ 1243{
1217 __be32 *p; 1244 __be32 *p;
1218 1245
@@ -1220,11 +1247,12 @@ static int encode_remove(struct xdr_stream *xdr, const struct qstr *name)
1220 WRITE32(OP_REMOVE); 1247 WRITE32(OP_REMOVE);
1221 WRITE32(name->len); 1248 WRITE32(name->len);
1222 WRITEMEM(name->name, name->len); 1249 WRITEMEM(name->name, name->len);
1250 hdr->nops++;
1223 1251
1224 return 0; 1252 return 0;
1225} 1253}
1226 1254
1227static int encode_rename(struct xdr_stream *xdr, const struct qstr *oldname, const struct qstr *newname) 1255static int encode_rename(struct xdr_stream *xdr, const struct qstr *oldname, const struct qstr *newname, struct compound_hdr *hdr)
1228{ 1256{
1229 __be32 *p; 1257 __be32 *p;
1230 1258
@@ -1236,34 +1264,37 @@ static int encode_rename(struct xdr_stream *xdr, const struct qstr *oldname, con
1236 RESERVE_SPACE(4 + newname->len); 1264 RESERVE_SPACE(4 + newname->len);
1237 WRITE32(newname->len); 1265 WRITE32(newname->len);
1238 WRITEMEM(newname->name, newname->len); 1266 WRITEMEM(newname->name, newname->len);
1267 hdr->nops++;
1239 1268
1240 return 0; 1269 return 0;
1241} 1270}
1242 1271
1243static int encode_renew(struct xdr_stream *xdr, const struct nfs_client *client_stateid) 1272static int encode_renew(struct xdr_stream *xdr, const struct nfs_client *client_stateid, struct compound_hdr *hdr)
1244{ 1273{
1245 __be32 *p; 1274 __be32 *p;
1246 1275
1247 RESERVE_SPACE(12); 1276 RESERVE_SPACE(12);
1248 WRITE32(OP_RENEW); 1277 WRITE32(OP_RENEW);
1249 WRITE64(client_stateid->cl_clientid); 1278 WRITE64(client_stateid->cl_clientid);
1279 hdr->nops++;
1250 1280
1251 return 0; 1281 return 0;
1252} 1282}
1253 1283
1254static int 1284static int
1255encode_restorefh(struct xdr_stream *xdr) 1285encode_restorefh(struct xdr_stream *xdr, struct compound_hdr *hdr)
1256{ 1286{
1257 __be32 *p; 1287 __be32 *p;
1258 1288
1259 RESERVE_SPACE(4); 1289 RESERVE_SPACE(4);
1260 WRITE32(OP_RESTOREFH); 1290 WRITE32(OP_RESTOREFH);
1291 hdr->nops++;
1261 1292
1262 return 0; 1293 return 0;
1263} 1294}
1264 1295
1265static int 1296static int
1266encode_setacl(struct xdr_stream *xdr, struct nfs_setaclargs *arg) 1297encode_setacl(struct xdr_stream *xdr, struct nfs_setaclargs *arg, struct compound_hdr *hdr)
1267{ 1298{
1268 __be32 *p; 1299 __be32 *p;
1269 1300
@@ -1278,21 +1309,23 @@ encode_setacl(struct xdr_stream *xdr, struct nfs_setaclargs *arg)
1278 RESERVE_SPACE(4); 1309 RESERVE_SPACE(4);
1279 WRITE32(arg->acl_len); 1310 WRITE32(arg->acl_len);
1280 xdr_write_pages(xdr, arg->acl_pages, arg->acl_pgbase, arg->acl_len); 1311 xdr_write_pages(xdr, arg->acl_pages, arg->acl_pgbase, arg->acl_len);
1312 hdr->nops++;
1281 return 0; 1313 return 0;
1282} 1314}
1283 1315
1284static int 1316static int
1285encode_savefh(struct xdr_stream *xdr) 1317encode_savefh(struct xdr_stream *xdr, struct compound_hdr *hdr)
1286{ 1318{
1287 __be32 *p; 1319 __be32 *p;
1288 1320
1289 RESERVE_SPACE(4); 1321 RESERVE_SPACE(4);
1290 WRITE32(OP_SAVEFH); 1322 WRITE32(OP_SAVEFH);
1323 hdr->nops++;
1291 1324
1292 return 0; 1325 return 0;
1293} 1326}
1294 1327
1295static int encode_setattr(struct xdr_stream *xdr, const struct nfs_setattrargs *arg, const struct nfs_server *server) 1328static int encode_setattr(struct xdr_stream *xdr, const struct nfs_setattrargs *arg, const struct nfs_server *server, struct compound_hdr *hdr)
1296{ 1329{
1297 int status; 1330 int status;
1298 __be32 *p; 1331 __be32 *p;
@@ -1300,6 +1333,7 @@ static int encode_setattr(struct xdr_stream *xdr, const struct nfs_setattrargs *
1300 RESERVE_SPACE(4+NFS4_STATEID_SIZE); 1333 RESERVE_SPACE(4+NFS4_STATEID_SIZE);
1301 WRITE32(OP_SETATTR); 1334 WRITE32(OP_SETATTR);
1302 WRITEMEM(arg->stateid.data, NFS4_STATEID_SIZE); 1335 WRITEMEM(arg->stateid.data, NFS4_STATEID_SIZE);
1336 hdr->nops++;
1303 1337
1304 if ((status = encode_attrs(xdr, arg->iap, server))) 1338 if ((status = encode_attrs(xdr, arg->iap, server)))
1305 return status; 1339 return status;
@@ -1307,7 +1341,7 @@ static int encode_setattr(struct xdr_stream *xdr, const struct nfs_setattrargs *
1307 return 0; 1341 return 0;
1308} 1342}
1309 1343
1310static int encode_setclientid(struct xdr_stream *xdr, const struct nfs4_setclientid *setclientid) 1344static int encode_setclientid(struct xdr_stream *xdr, const struct nfs4_setclientid *setclientid, struct compound_hdr *hdr)
1311{ 1345{
1312 __be32 *p; 1346 __be32 *p;
1313 1347
@@ -1322,11 +1356,12 @@ static int encode_setclientid(struct xdr_stream *xdr, const struct nfs4_setclien
1322 encode_string(xdr, setclientid->sc_uaddr_len, setclientid->sc_uaddr); 1356 encode_string(xdr, setclientid->sc_uaddr_len, setclientid->sc_uaddr);
1323 RESERVE_SPACE(4); 1357 RESERVE_SPACE(4);
1324 WRITE32(setclientid->sc_cb_ident); 1358 WRITE32(setclientid->sc_cb_ident);
1359 hdr->nops++;
1325 1360
1326 return 0; 1361 return 0;
1327} 1362}
1328 1363
1329static int encode_setclientid_confirm(struct xdr_stream *xdr, const struct nfs_client *client_state) 1364static int encode_setclientid_confirm(struct xdr_stream *xdr, const struct nfs_client *client_state, struct compound_hdr *hdr)
1330{ 1365{
1331 __be32 *p; 1366 __be32 *p;
1332 1367
@@ -1334,11 +1369,12 @@ static int encode_setclientid_confirm(struct xdr_stream *xdr, const struct nfs_c
1334 WRITE32(OP_SETCLIENTID_CONFIRM); 1369 WRITE32(OP_SETCLIENTID_CONFIRM);
1335 WRITE64(client_state->cl_clientid); 1370 WRITE64(client_state->cl_clientid);
1336 WRITEMEM(client_state->cl_confirm.data, NFS4_VERIFIER_SIZE); 1371 WRITEMEM(client_state->cl_confirm.data, NFS4_VERIFIER_SIZE);
1372 hdr->nops++;
1337 1373
1338 return 0; 1374 return 0;
1339} 1375}
1340 1376
1341static int encode_write(struct xdr_stream *xdr, const struct nfs_writeargs *args) 1377static int encode_write(struct xdr_stream *xdr, const struct nfs_writeargs *args, struct compound_hdr *hdr)
1342{ 1378{
1343 __be32 *p; 1379 __be32 *p;
1344 1380
@@ -1353,11 +1389,12 @@ static int encode_write(struct xdr_stream *xdr, const struct nfs_writeargs *args
1353 WRITE32(args->count); 1389 WRITE32(args->count);
1354 1390
1355 xdr_write_pages(xdr, args->pages, args->pgbase, args->count); 1391 xdr_write_pages(xdr, args->pages, args->pgbase, args->count);
1392 hdr->nops++;
1356 1393
1357 return 0; 1394 return 0;
1358} 1395}
1359 1396
1360static int encode_delegreturn(struct xdr_stream *xdr, const nfs4_stateid *stateid) 1397static int encode_delegreturn(struct xdr_stream *xdr, const nfs4_stateid *stateid, struct compound_hdr *hdr)
1361{ 1398{
1362 __be32 *p; 1399 __be32 *p;
1363 1400
@@ -1365,6 +1402,7 @@ static int encode_delegreturn(struct xdr_stream *xdr, const nfs4_stateid *statei
1365 1402
1366 WRITE32(OP_DELEGRETURN); 1403 WRITE32(OP_DELEGRETURN);
1367 WRITEMEM(stateid->data, NFS4_STATEID_SIZE); 1404 WRITEMEM(stateid->data, NFS4_STATEID_SIZE);
1405 hdr->nops++;
1368 return 0; 1406 return 0;
1369 1407
1370} 1408}
@@ -1379,20 +1417,21 @@ static int nfs4_xdr_enc_access(struct rpc_rqst *req, __be32 *p, const struct nfs
1379{ 1417{
1380 struct xdr_stream xdr; 1418 struct xdr_stream xdr;
1381 struct compound_hdr hdr = { 1419 struct compound_hdr hdr = {
1382 .nops = 3, 1420 .nops = 0,
1383 }; 1421 };
1384 int status; 1422 int status;
1385 1423
1386 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 1424 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1387 encode_compound_hdr(&xdr, &hdr); 1425 encode_compound_hdr(&xdr, &hdr);
1388 status = encode_putfh(&xdr, args->fh); 1426 status = encode_putfh(&xdr, args->fh, &hdr);
1389 if (status != 0) 1427 if (status != 0)
1390 goto out; 1428 goto out;
1391 status = encode_access(&xdr, args->access); 1429 status = encode_access(&xdr, args->access, &hdr);
1392 if (status != 0) 1430 if (status != 0)
1393 goto out; 1431 goto out;
1394 status = encode_getfattr(&xdr, args->bitmask); 1432 status = encode_getfattr(&xdr, args->bitmask, &hdr);
1395out: 1433out:
1434 encode_nops(&hdr);
1396 return status; 1435 return status;
1397} 1436}
1398 1437
@@ -1403,20 +1442,21 @@ static int nfs4_xdr_enc_lookup(struct rpc_rqst *req, __be32 *p, const struct nfs
1403{ 1442{
1404 struct xdr_stream xdr; 1443 struct xdr_stream xdr;
1405 struct compound_hdr hdr = { 1444 struct compound_hdr hdr = {
1406 .nops = 4, 1445 .nops = 0,
1407 }; 1446 };
1408 int status; 1447 int status;
1409 1448
1410 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 1449 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1411 encode_compound_hdr(&xdr, &hdr); 1450 encode_compound_hdr(&xdr, &hdr);
1412 if ((status = encode_putfh(&xdr, args->dir_fh)) != 0) 1451 if ((status = encode_putfh(&xdr, args->dir_fh, &hdr)) != 0)
1413 goto out; 1452 goto out;
1414 if ((status = encode_lookup(&xdr, args->name)) != 0) 1453 if ((status = encode_lookup(&xdr, args->name, &hdr)) != 0)
1415 goto out; 1454 goto out;
1416 if ((status = encode_getfh(&xdr)) != 0) 1455 if ((status = encode_getfh(&xdr, &hdr)) != 0)
1417 goto out; 1456 goto out;
1418 status = encode_getfattr(&xdr, args->bitmask); 1457 status = encode_getfattr(&xdr, args->bitmask, &hdr);
1419out: 1458out:
1459 encode_nops(&hdr);
1420 return status; 1460 return status;
1421} 1461}
1422 1462
@@ -1427,17 +1467,18 @@ static int nfs4_xdr_enc_lookup_root(struct rpc_rqst *req, __be32 *p, const struc
1427{ 1467{
1428 struct xdr_stream xdr; 1468 struct xdr_stream xdr;
1429 struct compound_hdr hdr = { 1469 struct compound_hdr hdr = {
1430 .nops = 3, 1470 .nops = 0,
1431 }; 1471 };
1432 int status; 1472 int status;
1433 1473
1434 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 1474 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1435 encode_compound_hdr(&xdr, &hdr); 1475 encode_compound_hdr(&xdr, &hdr);
1436 if ((status = encode_putrootfh(&xdr)) != 0) 1476 if ((status = encode_putrootfh(&xdr, &hdr)) != 0)
1437 goto out; 1477 goto out;
1438 if ((status = encode_getfh(&xdr)) == 0) 1478 if ((status = encode_getfh(&xdr, &hdr)) == 0)
1439 status = encode_getfattr(&xdr, args->bitmask); 1479 status = encode_getfattr(&xdr, args->bitmask, &hdr);
1440out: 1480out:
1481 encode_nops(&hdr);
1441 return status; 1482 return status;
1442} 1483}
1443 1484
@@ -1448,18 +1489,19 @@ static int nfs4_xdr_enc_remove(struct rpc_rqst *req, __be32 *p, const struct nfs
1448{ 1489{
1449 struct xdr_stream xdr; 1490 struct xdr_stream xdr;
1450 struct compound_hdr hdr = { 1491 struct compound_hdr hdr = {
1451 .nops = 3, 1492 .nops = 0,
1452 }; 1493 };
1453 int status; 1494 int status;
1454 1495
1455 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 1496 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1456 encode_compound_hdr(&xdr, &hdr); 1497 encode_compound_hdr(&xdr, &hdr);
1457 if ((status = encode_putfh(&xdr, args->fh)) != 0) 1498 if ((status = encode_putfh(&xdr, args->fh, &hdr)) != 0)
1458 goto out; 1499 goto out;
1459 if ((status = encode_remove(&xdr, &args->name)) != 0) 1500 if ((status = encode_remove(&xdr, &args->name, &hdr)) != 0)
1460 goto out; 1501 goto out;
1461 status = encode_getfattr(&xdr, args->bitmask); 1502 status = encode_getfattr(&xdr, args->bitmask, &hdr);
1462out: 1503out:
1504 encode_nops(&hdr);
1463 return status; 1505 return status;
1464} 1506}
1465 1507
@@ -1470,26 +1512,28 @@ static int nfs4_xdr_enc_rename(struct rpc_rqst *req, __be32 *p, const struct nfs
1470{ 1512{
1471 struct xdr_stream xdr; 1513 struct xdr_stream xdr;
1472 struct compound_hdr hdr = { 1514 struct compound_hdr hdr = {
1473 .nops = 7, 1515 .nops = 0,
1474 }; 1516 };
1475 int status; 1517 int status;
1476 1518
1477 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 1519 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1478 encode_compound_hdr(&xdr, &hdr); 1520 encode_compound_hdr(&xdr, &hdr);
1479 if ((status = encode_putfh(&xdr, args->old_dir)) != 0) 1521 if ((status = encode_putfh(&xdr, args->old_dir, &hdr)) != 0)
1480 goto out; 1522 goto out;
1481 if ((status = encode_savefh(&xdr)) != 0) 1523 if ((status = encode_savefh(&xdr, &hdr)) != 0)
1482 goto out; 1524 goto out;
1483 if ((status = encode_putfh(&xdr, args->new_dir)) != 0) 1525 if ((status = encode_putfh(&xdr, args->new_dir, &hdr)) != 0)
1484 goto out; 1526 goto out;
1485 if ((status = encode_rename(&xdr, args->old_name, args->new_name)) != 0) 1527 if ((status = encode_rename(&xdr, args->old_name, args->new_name,
1528 &hdr)) != 0)
1486 goto out; 1529 goto out;
1487 if ((status = encode_getfattr(&xdr, args->bitmask)) != 0) 1530 if ((status = encode_getfattr(&xdr, args->bitmask, &hdr)) != 0)
1488 goto out; 1531 goto out;
1489 if ((status = encode_restorefh(&xdr)) != 0) 1532 if ((status = encode_restorefh(&xdr, &hdr)) != 0)
1490 goto out; 1533 goto out;
1491 status = encode_getfattr(&xdr, args->bitmask); 1534 status = encode_getfattr(&xdr, args->bitmask, &hdr);
1492out: 1535out:
1536 encode_nops(&hdr);
1493 return status; 1537 return status;
1494} 1538}
1495 1539
@@ -1500,26 +1544,27 @@ static int nfs4_xdr_enc_link(struct rpc_rqst *req, __be32 *p, const struct nfs4_
1500{ 1544{
1501 struct xdr_stream xdr; 1545 struct xdr_stream xdr;
1502 struct compound_hdr hdr = { 1546 struct compound_hdr hdr = {
1503 .nops = 7, 1547 .nops = 0,
1504 }; 1548 };
1505 int status; 1549 int status;
1506 1550
1507 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 1551 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1508 encode_compound_hdr(&xdr, &hdr); 1552 encode_compound_hdr(&xdr, &hdr);
1509 if ((status = encode_putfh(&xdr, args->fh)) != 0) 1553 if ((status = encode_putfh(&xdr, args->fh, &hdr)) != 0)
1510 goto out; 1554 goto out;
1511 if ((status = encode_savefh(&xdr)) != 0) 1555 if ((status = encode_savefh(&xdr, &hdr)) != 0)
1512 goto out; 1556 goto out;
1513 if ((status = encode_putfh(&xdr, args->dir_fh)) != 0) 1557 if ((status = encode_putfh(&xdr, args->dir_fh, &hdr)) != 0)
1514 goto out; 1558 goto out;
1515 if ((status = encode_link(&xdr, args->name)) != 0) 1559 if ((status = encode_link(&xdr, args->name, &hdr)) != 0)
1516 goto out; 1560 goto out;
1517 if ((status = encode_getfattr(&xdr, args->bitmask)) != 0) 1561 if ((status = encode_getfattr(&xdr, args->bitmask, &hdr)) != 0)
1518 goto out; 1562 goto out;
1519 if ((status = encode_restorefh(&xdr)) != 0) 1563 if ((status = encode_restorefh(&xdr, &hdr)) != 0)
1520 goto out; 1564 goto out;
1521 status = encode_getfattr(&xdr, args->bitmask); 1565 status = encode_getfattr(&xdr, args->bitmask, &hdr);
1522out: 1566out:
1567 encode_nops(&hdr);
1523 return status; 1568 return status;
1524} 1569}
1525 1570
@@ -1530,26 +1575,27 @@ static int nfs4_xdr_enc_create(struct rpc_rqst *req, __be32 *p, const struct nfs
1530{ 1575{
1531 struct xdr_stream xdr; 1576 struct xdr_stream xdr;
1532 struct compound_hdr hdr = { 1577 struct compound_hdr hdr = {
1533 .nops = 7, 1578 .nops = 0,
1534 }; 1579 };
1535 int status; 1580 int status;
1536 1581
1537 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 1582 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1538 encode_compound_hdr(&xdr, &hdr); 1583 encode_compound_hdr(&xdr, &hdr);
1539 if ((status = encode_putfh(&xdr, args->dir_fh)) != 0) 1584 if ((status = encode_putfh(&xdr, args->dir_fh, &hdr)) != 0)
1540 goto out; 1585 goto out;
1541 if ((status = encode_savefh(&xdr)) != 0) 1586 if ((status = encode_savefh(&xdr, &hdr)) != 0)
1542 goto out; 1587 goto out;
1543 if ((status = encode_create(&xdr, args)) != 0) 1588 if ((status = encode_create(&xdr, args, &hdr)) != 0)
1544 goto out; 1589 goto out;
1545 if ((status = encode_getfh(&xdr)) != 0) 1590 if ((status = encode_getfh(&xdr, &hdr)) != 0)
1546 goto out; 1591 goto out;
1547 if ((status = encode_getfattr(&xdr, args->bitmask)) != 0) 1592 if ((status = encode_getfattr(&xdr, args->bitmask, &hdr)) != 0)
1548 goto out; 1593 goto out;
1549 if ((status = encode_restorefh(&xdr)) != 0) 1594 if ((status = encode_restorefh(&xdr, &hdr)) != 0)
1550 goto out; 1595 goto out;
1551 status = encode_getfattr(&xdr, args->bitmask); 1596 status = encode_getfattr(&xdr, args->bitmask, &hdr);
1552out: 1597out:
1598 encode_nops(&hdr);
1553 return status; 1599 return status;
1554} 1600}
1555 1601
@@ -1568,14 +1614,15 @@ static int nfs4_xdr_enc_getattr(struct rpc_rqst *req, __be32 *p, const struct nf
1568{ 1614{
1569 struct xdr_stream xdr; 1615 struct xdr_stream xdr;
1570 struct compound_hdr hdr = { 1616 struct compound_hdr hdr = {
1571 .nops = 2, 1617 .nops = 0,
1572 }; 1618 };
1573 int status; 1619 int status;
1574 1620
1575 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 1621 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1576 encode_compound_hdr(&xdr, &hdr); 1622 encode_compound_hdr(&xdr, &hdr);
1577 if ((status = encode_putfh(&xdr, args->fh)) == 0) 1623 if ((status = encode_putfh(&xdr, args->fh, &hdr)) == 0)
1578 status = encode_getfattr(&xdr, args->bitmask); 1624 status = encode_getfattr(&xdr, args->bitmask, &hdr);
1625 encode_nops(&hdr);
1579 return status; 1626 return status;
1580} 1627}
1581 1628
@@ -1586,20 +1633,21 @@ static int nfs4_xdr_enc_close(struct rpc_rqst *req, __be32 *p, struct nfs_closea
1586{ 1633{
1587 struct xdr_stream xdr; 1634 struct xdr_stream xdr;
1588 struct compound_hdr hdr = { 1635 struct compound_hdr hdr = {
1589 .nops = 3, 1636 .nops = 0,
1590 }; 1637 };
1591 int status; 1638 int status;
1592 1639
1593 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 1640 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1594 encode_compound_hdr(&xdr, &hdr); 1641 encode_compound_hdr(&xdr, &hdr);
1595 status = encode_putfh(&xdr, args->fh); 1642 status = encode_putfh(&xdr, args->fh, &hdr);
1596 if(status) 1643 if(status)
1597 goto out; 1644 goto out;
1598 status = encode_close(&xdr, args); 1645 status = encode_close(&xdr, args, &hdr);
1599 if (status != 0) 1646 if (status != 0)
1600 goto out; 1647 goto out;
1601 status = encode_getfattr(&xdr, args->bitmask); 1648 status = encode_getfattr(&xdr, args->bitmask, &hdr);
1602out: 1649out:
1650 encode_nops(&hdr);
1603 return status; 1651 return status;
1604} 1652}
1605 1653
@@ -1610,32 +1658,33 @@ static int nfs4_xdr_enc_open(struct rpc_rqst *req, __be32 *p, struct nfs_openarg
1610{ 1658{
1611 struct xdr_stream xdr; 1659 struct xdr_stream xdr;
1612 struct compound_hdr hdr = { 1660 struct compound_hdr hdr = {
1613 .nops = 7, 1661 .nops = 0,
1614 }; 1662 };
1615 int status; 1663 int status;
1616 1664
1617 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 1665 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1618 encode_compound_hdr(&xdr, &hdr); 1666 encode_compound_hdr(&xdr, &hdr);
1619 status = encode_putfh(&xdr, args->fh); 1667 status = encode_putfh(&xdr, args->fh, &hdr);
1620 if (status) 1668 if (status)
1621 goto out; 1669 goto out;
1622 status = encode_savefh(&xdr); 1670 status = encode_savefh(&xdr, &hdr);
1623 if (status) 1671 if (status)
1624 goto out; 1672 goto out;
1625 status = encode_open(&xdr, args); 1673 status = encode_open(&xdr, args, &hdr);
1626 if (status) 1674 if (status)
1627 goto out; 1675 goto out;
1628 status = encode_getfh(&xdr); 1676 status = encode_getfh(&xdr, &hdr);
1629 if (status) 1677 if (status)
1630 goto out; 1678 goto out;
1631 status = encode_getfattr(&xdr, args->bitmask); 1679 status = encode_getfattr(&xdr, args->bitmask, &hdr);
1632 if (status) 1680 if (status)
1633 goto out; 1681 goto out;
1634 status = encode_restorefh(&xdr); 1682 status = encode_restorefh(&xdr, &hdr);
1635 if (status) 1683 if (status)
1636 goto out; 1684 goto out;
1637 status = encode_getfattr(&xdr, args->bitmask); 1685 status = encode_getfattr(&xdr, args->bitmask, &hdr);
1638out: 1686out:
1687 encode_nops(&hdr);
1639 return status; 1688 return status;
1640} 1689}
1641 1690
@@ -1646,17 +1695,18 @@ static int nfs4_xdr_enc_open_confirm(struct rpc_rqst *req, __be32 *p, struct nfs
1646{ 1695{
1647 struct xdr_stream xdr; 1696 struct xdr_stream xdr;
1648 struct compound_hdr hdr = { 1697 struct compound_hdr hdr = {
1649 .nops = 2, 1698 .nops = 0,
1650 }; 1699 };
1651 int status; 1700 int status;
1652 1701
1653 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 1702 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1654 encode_compound_hdr(&xdr, &hdr); 1703 encode_compound_hdr(&xdr, &hdr);
1655 status = encode_putfh(&xdr, args->fh); 1704 status = encode_putfh(&xdr, args->fh, &hdr);
1656 if(status) 1705 if(status)
1657 goto out; 1706 goto out;
1658 status = encode_open_confirm(&xdr, args); 1707 status = encode_open_confirm(&xdr, args, &hdr);
1659out: 1708out:
1709 encode_nops(&hdr);
1660 return status; 1710 return status;
1661} 1711}
1662 1712
@@ -1667,20 +1717,21 @@ static int nfs4_xdr_enc_open_noattr(struct rpc_rqst *req, __be32 *p, struct nfs_
1667{ 1717{
1668 struct xdr_stream xdr; 1718 struct xdr_stream xdr;
1669 struct compound_hdr hdr = { 1719 struct compound_hdr hdr = {
1670 .nops = 3, 1720 .nops = 0,
1671 }; 1721 };
1672 int status; 1722 int status;
1673 1723
1674 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 1724 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1675 encode_compound_hdr(&xdr, &hdr); 1725 encode_compound_hdr(&xdr, &hdr);
1676 status = encode_putfh(&xdr, args->fh); 1726 status = encode_putfh(&xdr, args->fh, &hdr);
1677 if (status) 1727 if (status)
1678 goto out; 1728 goto out;
1679 status = encode_open(&xdr, args); 1729 status = encode_open(&xdr, args, &hdr);
1680 if (status) 1730 if (status)
1681 goto out; 1731 goto out;
1682 status = encode_getfattr(&xdr, args->bitmask); 1732 status = encode_getfattr(&xdr, args->bitmask, &hdr);
1683out: 1733out:
1734 encode_nops(&hdr);
1684 return status; 1735 return status;
1685} 1736}
1686 1737
@@ -1691,20 +1742,21 @@ static int nfs4_xdr_enc_open_downgrade(struct rpc_rqst *req, __be32 *p, struct n
1691{ 1742{
1692 struct xdr_stream xdr; 1743 struct xdr_stream xdr;
1693 struct compound_hdr hdr = { 1744 struct compound_hdr hdr = {
1694 .nops = 3, 1745 .nops = 0,
1695 }; 1746 };
1696 int status; 1747 int status;
1697 1748
1698 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 1749 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1699 encode_compound_hdr(&xdr, &hdr); 1750 encode_compound_hdr(&xdr, &hdr);
1700 status = encode_putfh(&xdr, args->fh); 1751 status = encode_putfh(&xdr, args->fh, &hdr);
1701 if (status) 1752 if (status)
1702 goto out; 1753 goto out;
1703 status = encode_open_downgrade(&xdr, args); 1754 status = encode_open_downgrade(&xdr, args, &hdr);
1704 if (status != 0) 1755 if (status != 0)
1705 goto out; 1756 goto out;
1706 status = encode_getfattr(&xdr, args->bitmask); 1757 status = encode_getfattr(&xdr, args->bitmask, &hdr);
1707out: 1758out:
1759 encode_nops(&hdr);
1708 return status; 1760 return status;
1709} 1761}
1710 1762
@@ -1715,17 +1767,18 @@ static int nfs4_xdr_enc_lock(struct rpc_rqst *req, __be32 *p, struct nfs_lock_ar
1715{ 1767{
1716 struct xdr_stream xdr; 1768 struct xdr_stream xdr;
1717 struct compound_hdr hdr = { 1769 struct compound_hdr hdr = {
1718 .nops = 2, 1770 .nops = 0,
1719 }; 1771 };
1720 int status; 1772 int status;
1721 1773
1722 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 1774 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1723 encode_compound_hdr(&xdr, &hdr); 1775 encode_compound_hdr(&xdr, &hdr);
1724 status = encode_putfh(&xdr, args->fh); 1776 status = encode_putfh(&xdr, args->fh, &hdr);
1725 if(status) 1777 if(status)
1726 goto out; 1778 goto out;
1727 status = encode_lock(&xdr, args); 1779 status = encode_lock(&xdr, args, &hdr);
1728out: 1780out:
1781 encode_nops(&hdr);
1729 return status; 1782 return status;
1730} 1783}
1731 1784
@@ -1736,17 +1789,18 @@ static int nfs4_xdr_enc_lockt(struct rpc_rqst *req, __be32 *p, struct nfs_lockt_
1736{ 1789{
1737 struct xdr_stream xdr; 1790 struct xdr_stream xdr;
1738 struct compound_hdr hdr = { 1791 struct compound_hdr hdr = {
1739 .nops = 2, 1792 .nops = 0,
1740 }; 1793 };
1741 int status; 1794 int status;
1742 1795
1743 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 1796 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1744 encode_compound_hdr(&xdr, &hdr); 1797 encode_compound_hdr(&xdr, &hdr);
1745 status = encode_putfh(&xdr, args->fh); 1798 status = encode_putfh(&xdr, args->fh, &hdr);
1746 if(status) 1799 if(status)
1747 goto out; 1800 goto out;
1748 status = encode_lockt(&xdr, args); 1801 status = encode_lockt(&xdr, args, &hdr);
1749out: 1802out:
1803 encode_nops(&hdr);
1750 return status; 1804 return status;
1751} 1805}
1752 1806
@@ -1757,17 +1811,18 @@ static int nfs4_xdr_enc_locku(struct rpc_rqst *req, __be32 *p, struct nfs_locku_
1757{ 1811{
1758 struct xdr_stream xdr; 1812 struct xdr_stream xdr;
1759 struct compound_hdr hdr = { 1813 struct compound_hdr hdr = {
1760 .nops = 2, 1814 .nops = 0,
1761 }; 1815 };
1762 int status; 1816 int status;
1763 1817
1764 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 1818 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1765 encode_compound_hdr(&xdr, &hdr); 1819 encode_compound_hdr(&xdr, &hdr);
1766 status = encode_putfh(&xdr, args->fh); 1820 status = encode_putfh(&xdr, args->fh, &hdr);
1767 if(status) 1821 if(status)
1768 goto out; 1822 goto out;
1769 status = encode_locku(&xdr, args); 1823 status = encode_locku(&xdr, args, &hdr);
1770out: 1824out:
1825 encode_nops(&hdr);
1771 return status; 1826 return status;
1772} 1827}
1773 1828
@@ -1778,7 +1833,7 @@ static int nfs4_xdr_enc_readlink(struct rpc_rqst *req, __be32 *p, const struct n
1778{ 1833{
1779 struct xdr_stream xdr; 1834 struct xdr_stream xdr;
1780 struct compound_hdr hdr = { 1835 struct compound_hdr hdr = {
1781 .nops = 2, 1836 .nops = 0,
1782 }; 1837 };
1783 struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth; 1838 struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth;
1784 unsigned int replen; 1839 unsigned int replen;
@@ -1786,10 +1841,10 @@ static int nfs4_xdr_enc_readlink(struct rpc_rqst *req, __be32 *p, const struct n
1786 1841
1787 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 1842 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1788 encode_compound_hdr(&xdr, &hdr); 1843 encode_compound_hdr(&xdr, &hdr);
1789 status = encode_putfh(&xdr, args->fh); 1844 status = encode_putfh(&xdr, args->fh, &hdr);
1790 if(status) 1845 if(status)
1791 goto out; 1846 goto out;
1792 status = encode_readlink(&xdr, args, req); 1847 status = encode_readlink(&xdr, args, req, &hdr);
1793 1848
1794 /* set up reply kvec 1849 /* set up reply kvec
1795 * toplevel_status + taglen + rescount + OP_PUTFH + status 1850 * toplevel_status + taglen + rescount + OP_PUTFH + status
@@ -1800,6 +1855,7 @@ static int nfs4_xdr_enc_readlink(struct rpc_rqst *req, __be32 *p, const struct n
1800 args->pgbase, args->pglen); 1855 args->pgbase, args->pglen);
1801 1856
1802out: 1857out:
1858 encode_nops(&hdr);
1803 return status; 1859 return status;
1804} 1860}
1805 1861
@@ -1810,7 +1866,7 @@ static int nfs4_xdr_enc_readdir(struct rpc_rqst *req, __be32 *p, const struct nf
1810{ 1866{
1811 struct xdr_stream xdr; 1867 struct xdr_stream xdr;
1812 struct compound_hdr hdr = { 1868 struct compound_hdr hdr = {
1813 .nops = 2, 1869 .nops = 0,
1814 }; 1870 };
1815 struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth; 1871 struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth;
1816 int replen; 1872 int replen;
@@ -1818,10 +1874,10 @@ static int nfs4_xdr_enc_readdir(struct rpc_rqst *req, __be32 *p, const struct nf
1818 1874
1819 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 1875 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1820 encode_compound_hdr(&xdr, &hdr); 1876 encode_compound_hdr(&xdr, &hdr);
1821 status = encode_putfh(&xdr, args->fh); 1877 status = encode_putfh(&xdr, args->fh, &hdr);
1822 if(status) 1878 if(status)
1823 goto out; 1879 goto out;
1824 status = encode_readdir(&xdr, args, req); 1880 status = encode_readdir(&xdr, args, req, &hdr);
1825 1881
1826 /* set up reply kvec 1882 /* set up reply kvec
1827 * toplevel_status + taglen + rescount + OP_PUTFH + status 1883 * toplevel_status + taglen + rescount + OP_PUTFH + status
@@ -1835,6 +1891,7 @@ static int nfs4_xdr_enc_readdir(struct rpc_rqst *req, __be32 *p, const struct nf
1835 args->pgbase, args->count); 1891 args->pgbase, args->count);
1836 1892
1837out: 1893out:
1894 encode_nops(&hdr);
1838 return status; 1895 return status;
1839} 1896}
1840 1897
@@ -1846,16 +1903,16 @@ static int nfs4_xdr_enc_read(struct rpc_rqst *req, __be32 *p, struct nfs_readarg
1846 struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth; 1903 struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth;
1847 struct xdr_stream xdr; 1904 struct xdr_stream xdr;
1848 struct compound_hdr hdr = { 1905 struct compound_hdr hdr = {
1849 .nops = 2, 1906 .nops = 0,
1850 }; 1907 };
1851 int replen, status; 1908 int replen, status;
1852 1909
1853 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 1910 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1854 encode_compound_hdr(&xdr, &hdr); 1911 encode_compound_hdr(&xdr, &hdr);
1855 status = encode_putfh(&xdr, args->fh); 1912 status = encode_putfh(&xdr, args->fh, &hdr);
1856 if (status) 1913 if (status)
1857 goto out; 1914 goto out;
1858 status = encode_read(&xdr, args); 1915 status = encode_read(&xdr, args, &hdr);
1859 if (status) 1916 if (status)
1860 goto out; 1917 goto out;
1861 1918
@@ -1868,6 +1925,7 @@ static int nfs4_xdr_enc_read(struct rpc_rqst *req, __be32 *p, struct nfs_readarg
1868 args->pages, args->pgbase, args->count); 1925 args->pages, args->pgbase, args->count);
1869 req->rq_rcv_buf.flags |= XDRBUF_READ; 1926 req->rq_rcv_buf.flags |= XDRBUF_READ;
1870out: 1927out:
1928 encode_nops(&hdr);
1871 return status; 1929 return status;
1872} 1930}
1873 1931
@@ -1878,20 +1936,21 @@ static int nfs4_xdr_enc_setattr(struct rpc_rqst *req, __be32 *p, struct nfs_seta
1878{ 1936{
1879 struct xdr_stream xdr; 1937 struct xdr_stream xdr;
1880 struct compound_hdr hdr = { 1938 struct compound_hdr hdr = {
1881 .nops = 3, 1939 .nops = 0,
1882 }; 1940 };
1883 int status; 1941 int status;
1884 1942
1885 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 1943 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1886 encode_compound_hdr(&xdr, &hdr); 1944 encode_compound_hdr(&xdr, &hdr);
1887 status = encode_putfh(&xdr, args->fh); 1945 status = encode_putfh(&xdr, args->fh, &hdr);
1888 if(status) 1946 if(status)
1889 goto out; 1947 goto out;
1890 status = encode_setattr(&xdr, args, args->server); 1948 status = encode_setattr(&xdr, args, args->server, &hdr);
1891 if(status) 1949 if(status)
1892 goto out; 1950 goto out;
1893 status = encode_getfattr(&xdr, args->bitmask); 1951 status = encode_getfattr(&xdr, args->bitmask, &hdr);
1894out: 1952out:
1953 encode_nops(&hdr);
1895 return status; 1954 return status;
1896} 1955}
1897 1956
@@ -1905,21 +1964,22 @@ nfs4_xdr_enc_getacl(struct rpc_rqst *req, __be32 *p,
1905 struct xdr_stream xdr; 1964 struct xdr_stream xdr;
1906 struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth; 1965 struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth;
1907 struct compound_hdr hdr = { 1966 struct compound_hdr hdr = {
1908 .nops = 2, 1967 .nops = 0,
1909 }; 1968 };
1910 int replen, status; 1969 int replen, status;
1911 1970
1912 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 1971 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1913 encode_compound_hdr(&xdr, &hdr); 1972 encode_compound_hdr(&xdr, &hdr);
1914 status = encode_putfh(&xdr, args->fh); 1973 status = encode_putfh(&xdr, args->fh, &hdr);
1915 if (status) 1974 if (status)
1916 goto out; 1975 goto out;
1917 status = encode_getattr_two(&xdr, FATTR4_WORD0_ACL, 0); 1976 status = encode_getattr_two(&xdr, FATTR4_WORD0_ACL, 0, &hdr);
1918 /* set up reply buffer: */ 1977 /* set up reply buffer: */
1919 replen = (RPC_REPHDRSIZE + auth->au_rslack + NFS4_dec_getacl_sz) << 2; 1978 replen = (RPC_REPHDRSIZE + auth->au_rslack + NFS4_dec_getacl_sz) << 2;
1920 xdr_inline_pages(&req->rq_rcv_buf, replen, 1979 xdr_inline_pages(&req->rq_rcv_buf, replen,
1921 args->acl_pages, args->acl_pgbase, args->acl_len); 1980 args->acl_pages, args->acl_pgbase, args->acl_len);
1922out: 1981out:
1982 encode_nops(&hdr);
1923 return status; 1983 return status;
1924} 1984}
1925 1985
@@ -1930,21 +1990,22 @@ static int nfs4_xdr_enc_write(struct rpc_rqst *req, __be32 *p, struct nfs_writea
1930{ 1990{
1931 struct xdr_stream xdr; 1991 struct xdr_stream xdr;
1932 struct compound_hdr hdr = { 1992 struct compound_hdr hdr = {
1933 .nops = 3, 1993 .nops = 0,
1934 }; 1994 };
1935 int status; 1995 int status;
1936 1996
1937 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 1997 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1938 encode_compound_hdr(&xdr, &hdr); 1998 encode_compound_hdr(&xdr, &hdr);
1939 status = encode_putfh(&xdr, args->fh); 1999 status = encode_putfh(&xdr, args->fh, &hdr);
1940 if (status) 2000 if (status)
1941 goto out; 2001 goto out;
1942 status = encode_write(&xdr, args); 2002 status = encode_write(&xdr, args, &hdr);
1943 if (status) 2003 if (status)
1944 goto out; 2004 goto out;
1945 req->rq_snd_buf.flags |= XDRBUF_WRITE; 2005 req->rq_snd_buf.flags |= XDRBUF_WRITE;
1946 status = encode_getfattr(&xdr, args->bitmask); 2006 status = encode_getfattr(&xdr, args->bitmask, &hdr);
1947out: 2007out:
2008 encode_nops(&hdr);
1948 return status; 2009 return status;
1949} 2010}
1950 2011
@@ -1955,20 +2016,21 @@ static int nfs4_xdr_enc_commit(struct rpc_rqst *req, __be32 *p, struct nfs_write
1955{ 2016{
1956 struct xdr_stream xdr; 2017 struct xdr_stream xdr;
1957 struct compound_hdr hdr = { 2018 struct compound_hdr hdr = {
1958 .nops = 3, 2019 .nops = 0,
1959 }; 2020 };
1960 int status; 2021 int status;
1961 2022
1962 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 2023 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1963 encode_compound_hdr(&xdr, &hdr); 2024 encode_compound_hdr(&xdr, &hdr);
1964 status = encode_putfh(&xdr, args->fh); 2025 status = encode_putfh(&xdr, args->fh, &hdr);
1965 if (status) 2026 if (status)
1966 goto out; 2027 goto out;
1967 status = encode_commit(&xdr, args); 2028 status = encode_commit(&xdr, args, &hdr);
1968 if (status) 2029 if (status)
1969 goto out; 2030 goto out;
1970 status = encode_getfattr(&xdr, args->bitmask); 2031 status = encode_getfattr(&xdr, args->bitmask, &hdr);
1971out: 2032out:
2033 encode_nops(&hdr);
1972 return status; 2034 return status;
1973} 2035}
1974 2036
@@ -1979,15 +2041,16 @@ static int nfs4_xdr_enc_fsinfo(struct rpc_rqst *req, __be32 *p, struct nfs4_fsin
1979{ 2041{
1980 struct xdr_stream xdr; 2042 struct xdr_stream xdr;
1981 struct compound_hdr hdr = { 2043 struct compound_hdr hdr = {
1982 .nops = 2, 2044 .nops = 0,
1983 }; 2045 };
1984 int status; 2046 int status;
1985 2047
1986 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 2048 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
1987 encode_compound_hdr(&xdr, &hdr); 2049 encode_compound_hdr(&xdr, &hdr);
1988 status = encode_putfh(&xdr, args->fh); 2050 status = encode_putfh(&xdr, args->fh, &hdr);
1989 if (!status) 2051 if (!status)
1990 status = encode_fsinfo(&xdr, args->bitmask); 2052 status = encode_fsinfo(&xdr, args->bitmask, &hdr);
2053 encode_nops(&hdr);
1991 return status; 2054 return status;
1992} 2055}
1993 2056
@@ -1998,16 +2061,18 @@ static int nfs4_xdr_enc_pathconf(struct rpc_rqst *req, __be32 *p, const struct n
1998{ 2061{
1999 struct xdr_stream xdr; 2062 struct xdr_stream xdr;
2000 struct compound_hdr hdr = { 2063 struct compound_hdr hdr = {
2001 .nops = 2, 2064 .nops = 0,
2002 }; 2065 };
2003 int status; 2066 int status;
2004 2067
2005 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 2068 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
2006 encode_compound_hdr(&xdr, &hdr); 2069 encode_compound_hdr(&xdr, &hdr);
2007 status = encode_putfh(&xdr, args->fh); 2070 status = encode_putfh(&xdr, args->fh, &hdr);
2008 if (!status) 2071 if (!status)
2009 status = encode_getattr_one(&xdr, 2072 status = encode_getattr_one(&xdr,
2010 args->bitmask[0] & nfs4_pathconf_bitmap[0]); 2073 args->bitmask[0] & nfs4_pathconf_bitmap[0],
2074 &hdr);
2075 encode_nops(&hdr);
2011 return status; 2076 return status;
2012} 2077}
2013 2078
@@ -2018,17 +2083,18 @@ static int nfs4_xdr_enc_statfs(struct rpc_rqst *req, __be32 *p, const struct nfs
2018{ 2083{
2019 struct xdr_stream xdr; 2084 struct xdr_stream xdr;
2020 struct compound_hdr hdr = { 2085 struct compound_hdr hdr = {
2021 .nops = 2, 2086 .nops = 0,
2022 }; 2087 };
2023 int status; 2088 int status;
2024 2089
2025 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 2090 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
2026 encode_compound_hdr(&xdr, &hdr); 2091 encode_compound_hdr(&xdr, &hdr);
2027 status = encode_putfh(&xdr, args->fh); 2092 status = encode_putfh(&xdr, args->fh, &hdr);
2028 if (status == 0) 2093 if (status == 0)
2029 status = encode_getattr_two(&xdr, 2094 status = encode_getattr_two(&xdr,
2030 args->bitmask[0] & nfs4_statfs_bitmap[0], 2095 args->bitmask[0] & nfs4_statfs_bitmap[0],
2031 args->bitmask[1] & nfs4_statfs_bitmap[1]); 2096 args->bitmask[1] & nfs4_statfs_bitmap[1], &hdr);
2097 encode_nops(&hdr);
2032 return status; 2098 return status;
2033} 2099}
2034 2100
@@ -2039,18 +2105,19 @@ static int nfs4_xdr_enc_server_caps(struct rpc_rqst *req, __be32 *p, const struc
2039{ 2105{
2040 struct xdr_stream xdr; 2106 struct xdr_stream xdr;
2041 struct compound_hdr hdr = { 2107 struct compound_hdr hdr = {
2042 .nops = 2, 2108 .nops = 0,
2043 }; 2109 };
2044 int status; 2110 int status;
2045 2111
2046 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 2112 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
2047 encode_compound_hdr(&xdr, &hdr); 2113 encode_compound_hdr(&xdr, &hdr);
2048 status = encode_putfh(&xdr, fhandle); 2114 status = encode_putfh(&xdr, fhandle, &hdr);
2049 if (status == 0) 2115 if (status == 0)
2050 status = encode_getattr_one(&xdr, FATTR4_WORD0_SUPPORTED_ATTRS| 2116 status = encode_getattr_one(&xdr, FATTR4_WORD0_SUPPORTED_ATTRS|
2051 FATTR4_WORD0_LINK_SUPPORT| 2117 FATTR4_WORD0_LINK_SUPPORT|
2052 FATTR4_WORD0_SYMLINK_SUPPORT| 2118 FATTR4_WORD0_SYMLINK_SUPPORT|
2053 FATTR4_WORD0_ACLSUPPORT); 2119 FATTR4_WORD0_ACLSUPPORT, &hdr);
2120 encode_nops(&hdr);
2054 return status; 2121 return status;
2055} 2122}
2056 2123
@@ -2061,12 +2128,15 @@ static int nfs4_xdr_enc_renew(struct rpc_rqst *req, __be32 *p, struct nfs_client
2061{ 2128{
2062 struct xdr_stream xdr; 2129 struct xdr_stream xdr;
2063 struct compound_hdr hdr = { 2130 struct compound_hdr hdr = {
2064 .nops = 1, 2131 .nops = 0,
2065 }; 2132 };
2133 int status;
2066 2134
2067 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 2135 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
2068 encode_compound_hdr(&xdr, &hdr); 2136 encode_compound_hdr(&xdr, &hdr);
2069 return encode_renew(&xdr, clp); 2137 status = encode_renew(&xdr, clp, &hdr);
2138 encode_nops(&hdr);
2139 return status;
2070} 2140}
2071 2141
2072/* 2142/*
@@ -2076,12 +2146,15 @@ static int nfs4_xdr_enc_setclientid(struct rpc_rqst *req, __be32 *p, struct nfs4
2076{ 2146{
2077 struct xdr_stream xdr; 2147 struct xdr_stream xdr;
2078 struct compound_hdr hdr = { 2148 struct compound_hdr hdr = {
2079 .nops = 1, 2149 .nops = 0,
2080 }; 2150 };
2151 int status;
2081 2152
2082 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 2153 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
2083 encode_compound_hdr(&xdr, &hdr); 2154 encode_compound_hdr(&xdr, &hdr);
2084 return encode_setclientid(&xdr, sc); 2155 status = encode_setclientid(&xdr, sc, &hdr);
2156 encode_nops(&hdr);
2157 return status;
2085} 2158}
2086 2159
2087/* 2160/*
@@ -2091,18 +2164,19 @@ static int nfs4_xdr_enc_setclientid_confirm(struct rpc_rqst *req, __be32 *p, str
2091{ 2164{
2092 struct xdr_stream xdr; 2165 struct xdr_stream xdr;
2093 struct compound_hdr hdr = { 2166 struct compound_hdr hdr = {
2094 .nops = 3, 2167 .nops = 0,
2095 }; 2168 };
2096 const u32 lease_bitmap[2] = { FATTR4_WORD0_LEASE_TIME, 0 }; 2169 const u32 lease_bitmap[2] = { FATTR4_WORD0_LEASE_TIME, 0 };
2097 int status; 2170 int status;
2098 2171
2099 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 2172 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
2100 encode_compound_hdr(&xdr, &hdr); 2173 encode_compound_hdr(&xdr, &hdr);
2101 status = encode_setclientid_confirm(&xdr, clp); 2174 status = encode_setclientid_confirm(&xdr, clp, &hdr);
2102 if (!status) 2175 if (!status)
2103 status = encode_putrootfh(&xdr); 2176 status = encode_putrootfh(&xdr, &hdr);
2104 if (!status) 2177 if (!status)
2105 status = encode_fsinfo(&xdr, lease_bitmap); 2178 status = encode_fsinfo(&xdr, lease_bitmap, &hdr);
2179 encode_nops(&hdr);
2106 return status; 2180 return status;
2107} 2181}
2108 2182
@@ -2113,20 +2187,21 @@ static int nfs4_xdr_enc_delegreturn(struct rpc_rqst *req, __be32 *p, const struc
2113{ 2187{
2114 struct xdr_stream xdr; 2188 struct xdr_stream xdr;
2115 struct compound_hdr hdr = { 2189 struct compound_hdr hdr = {
2116 .nops = 3, 2190 .nops = 0,
2117 }; 2191 };
2118 int status; 2192 int status;
2119 2193
2120 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 2194 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
2121 encode_compound_hdr(&xdr, &hdr); 2195 encode_compound_hdr(&xdr, &hdr);
2122 status = encode_putfh(&xdr, args->fhandle); 2196 status = encode_putfh(&xdr, args->fhandle, &hdr);
2123 if (status != 0) 2197 if (status != 0)
2124 goto out; 2198 goto out;
2125 status = encode_delegreturn(&xdr, args->stateid); 2199 status = encode_delegreturn(&xdr, args->stateid, &hdr);
2126 if (status != 0) 2200 if (status != 0)
2127 goto out; 2201 goto out;
2128 status = encode_getfattr(&xdr, args->bitmask); 2202 status = encode_getfattr(&xdr, args->bitmask, &hdr);
2129out: 2203out:
2204 encode_nops(&hdr);
2130 return status; 2205 return status;
2131} 2206}
2132 2207
@@ -2137,7 +2212,7 @@ static int nfs4_xdr_enc_fs_locations(struct rpc_rqst *req, __be32 *p, struct nfs
2137{ 2212{
2138 struct xdr_stream xdr; 2213 struct xdr_stream xdr;
2139 struct compound_hdr hdr = { 2214 struct compound_hdr hdr = {
2140 .nops = 3, 2215 .nops = 0,
2141 }; 2216 };
2142 struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth; 2217 struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth;
2143 int replen; 2218 int replen;
@@ -2145,11 +2220,11 @@ static int nfs4_xdr_enc_fs_locations(struct rpc_rqst *req, __be32 *p, struct nfs
2145 2220
2146 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 2221 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
2147 encode_compound_hdr(&xdr, &hdr); 2222 encode_compound_hdr(&xdr, &hdr);
2148 if ((status = encode_putfh(&xdr, args->dir_fh)) != 0) 2223 if ((status = encode_putfh(&xdr, args->dir_fh, &hdr)) != 0)
2149 goto out; 2224 goto out;
2150 if ((status = encode_lookup(&xdr, args->name)) != 0) 2225 if ((status = encode_lookup(&xdr, args->name, &hdr)) != 0)
2151 goto out; 2226 goto out;
2152 if ((status = encode_fs_locations(&xdr, args->bitmask)) != 0) 2227 if ((status = encode_fs_locations(&xdr, args->bitmask, &hdr)) != 0)
2153 goto out; 2228 goto out;
2154 /* set up reply 2229 /* set up reply
2155 * toplevel_status + OP_PUTFH + status 2230 * toplevel_status + OP_PUTFH + status
@@ -2159,6 +2234,7 @@ static int nfs4_xdr_enc_fs_locations(struct rpc_rqst *req, __be32 *p, struct nfs
2159 xdr_inline_pages(&req->rq_rcv_buf, replen, &args->page, 2234 xdr_inline_pages(&req->rq_rcv_buf, replen, &args->page,
2160 0, PAGE_SIZE); 2235 0, PAGE_SIZE);
2161out: 2236out:
2237 encode_nops(&hdr);
2162 return status; 2238 return status;
2163} 2239}
2164 2240
@@ -4033,17 +4109,18 @@ nfs4_xdr_enc_setacl(struct rpc_rqst *req, __be32 *p, struct nfs_setaclargs *args
4033{ 4109{
4034 struct xdr_stream xdr; 4110 struct xdr_stream xdr;
4035 struct compound_hdr hdr = { 4111 struct compound_hdr hdr = {
4036 .nops = 2, 4112 .nops = 0,
4037 }; 4113 };
4038 int status; 4114 int status;
4039 4115
4040 xdr_init_encode(&xdr, &req->rq_snd_buf, p); 4116 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
4041 encode_compound_hdr(&xdr, &hdr); 4117 encode_compound_hdr(&xdr, &hdr);
4042 status = encode_putfh(&xdr, args->fh); 4118 status = encode_putfh(&xdr, args->fh, &hdr);
4043 if (status) 4119 if (status)
4044 goto out; 4120 goto out;
4045 status = encode_setacl(&xdr, args); 4121 status = encode_setacl(&xdr, args, &hdr);
4046out: 4122out:
4123 encode_nops(&hdr);
4047 return status; 4124 return status;
4048} 4125}
4049 4126