aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4xdr.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r--fs/nfs/nfs4xdr.c68
1 files changed, 32 insertions, 36 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 5d80766fc672..17915c8ea7fa 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -712,10 +712,6 @@ struct compound_hdr {
712 * task to translate them into Linux-specific versions which are more 712 * task to translate them into Linux-specific versions which are more
713 * consistent with the style used in NFSv2/v3... 713 * consistent with the style used in NFSv2/v3...
714 */ 714 */
715#define WRITEMEM(ptr,nbytes) do { \
716 p = xdr_encode_opaque_fixed(p, ptr, nbytes); \
717} while (0)
718
719#define RESERVE_SPACE(nbytes) do { \ 715#define RESERVE_SPACE(nbytes) do { \
720 p = xdr_reserve_space(xdr, nbytes); \ 716 p = xdr_reserve_space(xdr, nbytes); \
721 BUG_ON(!p); \ 717 BUG_ON(!p); \
@@ -746,7 +742,7 @@ static void encode_compound_hdr(struct xdr_stream *xdr,
746 BUG_ON(hdr->taglen > NFS4_MAXTAGLEN); 742 BUG_ON(hdr->taglen > NFS4_MAXTAGLEN);
747 RESERVE_SPACE(12+(XDR_QUADLEN(hdr->taglen)<<2)); 743 RESERVE_SPACE(12+(XDR_QUADLEN(hdr->taglen)<<2));
748 *p++ = cpu_to_be32(hdr->taglen); 744 *p++ = cpu_to_be32(hdr->taglen);
749 WRITEMEM(hdr->tag, hdr->taglen); 745 p = xdr_encode_opaque_fixed(p, hdr->tag, hdr->taglen);
750 *p++ = cpu_to_be32(hdr->minorversion); 746 *p++ = cpu_to_be32(hdr->minorversion);
751 hdr->nops_p = p; 747 hdr->nops_p = p;
752 *p++ = cpu_to_be32(hdr->nops); 748 *p++ = cpu_to_be32(hdr->nops);
@@ -845,12 +841,12 @@ static void encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const
845 if (iap->ia_valid & ATTR_UID) { 841 if (iap->ia_valid & ATTR_UID) {
846 bmval1 |= FATTR4_WORD1_OWNER; 842 bmval1 |= FATTR4_WORD1_OWNER;
847 *p++ = cpu_to_be32(owner_namelen); 843 *p++ = cpu_to_be32(owner_namelen);
848 WRITEMEM(owner_name, owner_namelen); 844 p = xdr_encode_opaque_fixed(p, owner_name, owner_namelen);
849 } 845 }
850 if (iap->ia_valid & ATTR_GID) { 846 if (iap->ia_valid & ATTR_GID) {
851 bmval1 |= FATTR4_WORD1_OWNER_GROUP; 847 bmval1 |= FATTR4_WORD1_OWNER_GROUP;
852 *p++ = cpu_to_be32(owner_grouplen); 848 *p++ = cpu_to_be32(owner_grouplen);
853 WRITEMEM(owner_group, owner_grouplen); 849 p = xdr_encode_opaque_fixed(p, owner_group, owner_grouplen);
854 } 850 }
855 if (iap->ia_valid & ATTR_ATIME_SET) { 851 if (iap->ia_valid & ATTR_ATIME_SET) {
856 bmval1 |= FATTR4_WORD1_TIME_ACCESS_SET; 852 bmval1 |= FATTR4_WORD1_TIME_ACCESS_SET;
@@ -909,7 +905,7 @@ static void encode_close(struct xdr_stream *xdr, const struct nfs_closeargs *arg
909 RESERVE_SPACE(8+NFS4_STATEID_SIZE); 905 RESERVE_SPACE(8+NFS4_STATEID_SIZE);
910 *p++ = cpu_to_be32(OP_CLOSE); 906 *p++ = cpu_to_be32(OP_CLOSE);
911 *p++ = cpu_to_be32(arg->seqid->sequence->counter); 907 *p++ = cpu_to_be32(arg->seqid->sequence->counter);
912 WRITEMEM(arg->stateid->data, NFS4_STATEID_SIZE); 908 p = xdr_encode_opaque_fixed(p, arg->stateid->data, NFS4_STATEID_SIZE);
913 hdr->nops++; 909 hdr->nops++;
914 hdr->replen += decode_close_maxsz; 910 hdr->replen += decode_close_maxsz;
915} 911}
@@ -953,7 +949,7 @@ static void encode_create(struct xdr_stream *xdr, const struct nfs4_create_arg *
953 949
954 RESERVE_SPACE(4 + create->name->len); 950 RESERVE_SPACE(4 + create->name->len);
955 *p++ = cpu_to_be32(create->name->len); 951 *p++ = cpu_to_be32(create->name->len);
956 WRITEMEM(create->name->name, create->name->len); 952 p = xdr_encode_opaque_fixed(p, create->name->name, create->name->len);
957 hdr->nops++; 953 hdr->nops++;
958 hdr->replen += decode_create_maxsz; 954 hdr->replen += decode_create_maxsz;
959 955
@@ -1020,7 +1016,7 @@ static void encode_link(struct xdr_stream *xdr, const struct qstr *name, struct
1020 RESERVE_SPACE(8 + name->len); 1016 RESERVE_SPACE(8 + name->len);
1021 *p++ = cpu_to_be32(OP_LINK); 1017 *p++ = cpu_to_be32(OP_LINK);
1022 *p++ = cpu_to_be32(name->len); 1018 *p++ = cpu_to_be32(name->len);
1023 WRITEMEM(name->name, name->len); 1019 p = xdr_encode_opaque_fixed(p, name->name, name->len);
1024 hdr->nops++; 1020 hdr->nops++;
1025 hdr->replen += decode_link_maxsz; 1021 hdr->replen += decode_link_maxsz;
1026} 1022}
@@ -1057,16 +1053,16 @@ static void encode_lock(struct xdr_stream *xdr, const struct nfs_lock_args *args
1057 if (args->new_lock_owner){ 1053 if (args->new_lock_owner){
1058 RESERVE_SPACE(4+NFS4_STATEID_SIZE+32); 1054 RESERVE_SPACE(4+NFS4_STATEID_SIZE+32);
1059 *p++ = cpu_to_be32(args->open_seqid->sequence->counter); 1055 *p++ = cpu_to_be32(args->open_seqid->sequence->counter);
1060 WRITEMEM(args->open_stateid->data, NFS4_STATEID_SIZE); 1056 p = xdr_encode_opaque_fixed(p, args->open_stateid->data, NFS4_STATEID_SIZE);
1061 *p++ = cpu_to_be32(args->lock_seqid->sequence->counter); 1057 *p++ = cpu_to_be32(args->lock_seqid->sequence->counter);
1062 p = xdr_encode_hyper(p, args->lock_owner.clientid); 1058 p = xdr_encode_hyper(p, args->lock_owner.clientid);
1063 *p++ = cpu_to_be32(16); 1059 *p++ = cpu_to_be32(16);
1064 WRITEMEM("lock id:", 8); 1060 p = xdr_encode_opaque_fixed(p, "lock id:", 8);
1065 p = xdr_encode_hyper(p, args->lock_owner.id); 1061 p = xdr_encode_hyper(p, args->lock_owner.id);
1066 } 1062 }
1067 else { 1063 else {
1068 RESERVE_SPACE(NFS4_STATEID_SIZE+4); 1064 RESERVE_SPACE(NFS4_STATEID_SIZE+4);
1069 WRITEMEM(args->lock_stateid->data, NFS4_STATEID_SIZE); 1065 p = xdr_encode_opaque_fixed(p, args->lock_stateid->data, NFS4_STATEID_SIZE);
1070 *p++ = cpu_to_be32(args->lock_seqid->sequence->counter); 1066 *p++ = cpu_to_be32(args->lock_seqid->sequence->counter);
1071 } 1067 }
1072 hdr->nops++; 1068 hdr->nops++;
@@ -1084,7 +1080,7 @@ static void encode_lockt(struct xdr_stream *xdr, const struct nfs_lockt_args *ar
1084 p = xdr_encode_hyper(p, nfs4_lock_length(args->fl)); 1080 p = xdr_encode_hyper(p, nfs4_lock_length(args->fl));
1085 p = xdr_encode_hyper(p, args->lock_owner.clientid); 1081 p = xdr_encode_hyper(p, args->lock_owner.clientid);
1086 *p++ = cpu_to_be32(16); 1082 *p++ = cpu_to_be32(16);
1087 WRITEMEM("lock id:", 8); 1083 p = xdr_encode_opaque_fixed(p, "lock id:", 8);
1088 p = xdr_encode_hyper(p, args->lock_owner.id); 1084 p = xdr_encode_hyper(p, args->lock_owner.id);
1089 hdr->nops++; 1085 hdr->nops++;
1090 hdr->replen += decode_lockt_maxsz; 1086 hdr->replen += decode_lockt_maxsz;
@@ -1098,7 +1094,7 @@ static void encode_locku(struct xdr_stream *xdr, const struct nfs_locku_args *ar
1098 *p++ = cpu_to_be32(OP_LOCKU); 1094 *p++ = cpu_to_be32(OP_LOCKU);
1099 *p++ = cpu_to_be32(nfs4_lock_type(args->fl, 0)); 1095 *p++ = cpu_to_be32(nfs4_lock_type(args->fl, 0));
1100 *p++ = cpu_to_be32(args->seqid->sequence->counter); 1096 *p++ = cpu_to_be32(args->seqid->sequence->counter);
1101 WRITEMEM(args->stateid->data, NFS4_STATEID_SIZE); 1097 p = xdr_encode_opaque_fixed(p, args->stateid->data, NFS4_STATEID_SIZE);
1102 p = xdr_encode_hyper(p, args->fl->fl_start); 1098 p = xdr_encode_hyper(p, args->fl->fl_start);
1103 p = xdr_encode_hyper(p, nfs4_lock_length(args->fl)); 1099 p = xdr_encode_hyper(p, nfs4_lock_length(args->fl));
1104 hdr->nops++; 1100 hdr->nops++;
@@ -1113,7 +1109,7 @@ static void encode_lookup(struct xdr_stream *xdr, const struct qstr *name, struc
1113 RESERVE_SPACE(8 + len); 1109 RESERVE_SPACE(8 + len);
1114 *p++ = cpu_to_be32(OP_LOOKUP); 1110 *p++ = cpu_to_be32(OP_LOOKUP);
1115 *p++ = cpu_to_be32(len); 1111 *p++ = cpu_to_be32(len);
1116 WRITEMEM(name->name, len); 1112 p = xdr_encode_opaque_fixed(p, name->name, len);
1117 hdr->nops++; 1113 hdr->nops++;
1118 hdr->replen += decode_lookup_maxsz; 1114 hdr->replen += decode_lookup_maxsz;
1119} 1115}
@@ -1153,7 +1149,7 @@ static inline void encode_openhdr(struct xdr_stream *xdr, const struct nfs_opena
1153 RESERVE_SPACE(28); 1149 RESERVE_SPACE(28);
1154 p = xdr_encode_hyper(p, arg->clientid); 1150 p = xdr_encode_hyper(p, arg->clientid);
1155 *p++ = cpu_to_be32(16); 1151 *p++ = cpu_to_be32(16);
1156 WRITEMEM("open id:", 8); 1152 p = xdr_encode_opaque_fixed(p, "open id:", 8);
1157 p = xdr_encode_hyper(p, arg->id); 1153 p = xdr_encode_hyper(p, arg->id);
1158} 1154}
1159 1155
@@ -1233,7 +1229,7 @@ static inline void encode_claim_delegate_cur(struct xdr_stream *xdr, const struc
1233 1229
1234 RESERVE_SPACE(4+NFS4_STATEID_SIZE); 1230 RESERVE_SPACE(4+NFS4_STATEID_SIZE);
1235 *p++ = cpu_to_be32(NFS4_OPEN_CLAIM_DELEGATE_CUR); 1231 *p++ = cpu_to_be32(NFS4_OPEN_CLAIM_DELEGATE_CUR);
1236 WRITEMEM(stateid->data, NFS4_STATEID_SIZE); 1232 p = xdr_encode_opaque_fixed(p, stateid->data, NFS4_STATEID_SIZE);
1237 encode_string(xdr, name->len, name->name); 1233 encode_string(xdr, name->len, name->name);
1238} 1234}
1239 1235
@@ -1264,7 +1260,7 @@ static void encode_open_confirm(struct xdr_stream *xdr, const struct nfs_open_co
1264 1260
1265 RESERVE_SPACE(4+NFS4_STATEID_SIZE+4); 1261 RESERVE_SPACE(4+NFS4_STATEID_SIZE+4);
1266 *p++ = cpu_to_be32(OP_OPEN_CONFIRM); 1262 *p++ = cpu_to_be32(OP_OPEN_CONFIRM);
1267 WRITEMEM(arg->stateid->data, NFS4_STATEID_SIZE); 1263 p = xdr_encode_opaque_fixed(p, arg->stateid->data, NFS4_STATEID_SIZE);
1268 *p++ = cpu_to_be32(arg->seqid->sequence->counter); 1264 *p++ = cpu_to_be32(arg->seqid->sequence->counter);
1269 hdr->nops++; 1265 hdr->nops++;
1270 hdr->replen += decode_open_confirm_maxsz; 1266 hdr->replen += decode_open_confirm_maxsz;
@@ -1276,7 +1272,7 @@ static void encode_open_downgrade(struct xdr_stream *xdr, const struct nfs_close
1276 1272
1277 RESERVE_SPACE(4+NFS4_STATEID_SIZE+4); 1273 RESERVE_SPACE(4+NFS4_STATEID_SIZE+4);
1278 *p++ = cpu_to_be32(OP_OPEN_DOWNGRADE); 1274 *p++ = cpu_to_be32(OP_OPEN_DOWNGRADE);
1279 WRITEMEM(arg->stateid->data, NFS4_STATEID_SIZE); 1275 p = xdr_encode_opaque_fixed(p, arg->stateid->data, NFS4_STATEID_SIZE);
1280 *p++ = cpu_to_be32(arg->seqid->sequence->counter); 1276 *p++ = cpu_to_be32(arg->seqid->sequence->counter);
1281 encode_share_access(xdr, arg->fmode); 1277 encode_share_access(xdr, arg->fmode);
1282 hdr->nops++; 1278 hdr->nops++;
@@ -1292,7 +1288,7 @@ encode_putfh(struct xdr_stream *xdr, const struct nfs_fh *fh, struct compound_hd
1292 RESERVE_SPACE(8 + len); 1288 RESERVE_SPACE(8 + len);
1293 *p++ = cpu_to_be32(OP_PUTFH); 1289 *p++ = cpu_to_be32(OP_PUTFH);
1294 *p++ = cpu_to_be32(len); 1290 *p++ = cpu_to_be32(len);
1295 WRITEMEM(fh->data, len); 1291 p = xdr_encode_opaque_fixed(p, fh->data, len);
1296 hdr->nops++; 1292 hdr->nops++;
1297 hdr->replen += decode_putfh_maxsz; 1293 hdr->replen += decode_putfh_maxsz;
1298} 1294}
@@ -1315,9 +1311,9 @@ static void encode_stateid(struct xdr_stream *xdr, const struct nfs_open_context
1315 RESERVE_SPACE(NFS4_STATEID_SIZE); 1311 RESERVE_SPACE(NFS4_STATEID_SIZE);
1316 if (ctx->state != NULL) { 1312 if (ctx->state != NULL) {
1317 nfs4_copy_stateid(&stateid, ctx->state, ctx->lockowner); 1313 nfs4_copy_stateid(&stateid, ctx->state, ctx->lockowner);
1318 WRITEMEM(stateid.data, NFS4_STATEID_SIZE); 1314 p = xdr_encode_opaque_fixed(p, stateid.data, NFS4_STATEID_SIZE);
1319 } else 1315 } else
1320 WRITEMEM(zero_stateid.data, NFS4_STATEID_SIZE); 1316 p = xdr_encode_opaque_fixed(p, zero_stateid.data, NFS4_STATEID_SIZE);
1321} 1317}
1322 1318
1323static void encode_read(struct xdr_stream *xdr, const struct nfs_readargs *args, struct compound_hdr *hdr) 1319static void encode_read(struct xdr_stream *xdr, const struct nfs_readargs *args, struct compound_hdr *hdr)
@@ -1347,7 +1343,7 @@ static void encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg
1347 RESERVE_SPACE(12+NFS4_VERIFIER_SIZE+20); 1343 RESERVE_SPACE(12+NFS4_VERIFIER_SIZE+20);
1348 *p++ = cpu_to_be32(OP_READDIR); 1344 *p++ = cpu_to_be32(OP_READDIR);
1349 p = xdr_encode_hyper(p, readdir->cookie); 1345 p = xdr_encode_hyper(p, readdir->cookie);
1350 WRITEMEM(readdir->verifier.data, NFS4_VERIFIER_SIZE); 1346 p = xdr_encode_opaque_fixed(p, readdir->verifier.data, NFS4_VERIFIER_SIZE);
1351 *p++ = cpu_to_be32(readdir->count >> 1); /* We're not doing readdirplus */ 1347 *p++ = cpu_to_be32(readdir->count >> 1); /* We're not doing readdirplus */
1352 *p++ = cpu_to_be32(readdir->count); 1348 *p++ = cpu_to_be32(readdir->count);
1353 *p++ = cpu_to_be32(2); 1349 *p++ = cpu_to_be32(2);
@@ -1386,7 +1382,7 @@ static void encode_remove(struct xdr_stream *xdr, const struct qstr *name, struc
1386 RESERVE_SPACE(8 + name->len); 1382 RESERVE_SPACE(8 + name->len);
1387 *p++ = cpu_to_be32(OP_REMOVE); 1383 *p++ = cpu_to_be32(OP_REMOVE);
1388 *p++ = cpu_to_be32(name->len); 1384 *p++ = cpu_to_be32(name->len);
1389 WRITEMEM(name->name, name->len); 1385 p = xdr_encode_opaque_fixed(p, name->name, name->len);
1390 hdr->nops++; 1386 hdr->nops++;
1391 hdr->replen += decode_remove_maxsz; 1387 hdr->replen += decode_remove_maxsz;
1392} 1388}
@@ -1398,11 +1394,11 @@ static void encode_rename(struct xdr_stream *xdr, const struct qstr *oldname, co
1398 RESERVE_SPACE(8 + oldname->len); 1394 RESERVE_SPACE(8 + oldname->len);
1399 *p++ = cpu_to_be32(OP_RENAME); 1395 *p++ = cpu_to_be32(OP_RENAME);
1400 *p++ = cpu_to_be32(oldname->len); 1396 *p++ = cpu_to_be32(oldname->len);
1401 WRITEMEM(oldname->name, oldname->len); 1397 p = xdr_encode_opaque_fixed(p, oldname->name, oldname->len);
1402 1398
1403 RESERVE_SPACE(4 + newname->len); 1399 RESERVE_SPACE(4 + newname->len);
1404 *p++ = cpu_to_be32(newname->len); 1400 *p++ = cpu_to_be32(newname->len);
1405 WRITEMEM(newname->name, newname->len); 1401 p = xdr_encode_opaque_fixed(p, newname->name, newname->len);
1406 hdr->nops++; 1402 hdr->nops++;
1407 hdr->replen += decode_rename_maxsz; 1403 hdr->replen += decode_rename_maxsz;
1408} 1404}
@@ -1436,7 +1432,7 @@ encode_setacl(struct xdr_stream *xdr, struct nfs_setaclargs *arg, struct compoun
1436 1432
1437 RESERVE_SPACE(4+NFS4_STATEID_SIZE); 1433 RESERVE_SPACE(4+NFS4_STATEID_SIZE);
1438 *p++ = cpu_to_be32(OP_SETATTR); 1434 *p++ = cpu_to_be32(OP_SETATTR);
1439 WRITEMEM(zero_stateid.data, NFS4_STATEID_SIZE); 1435 p = xdr_encode_opaque_fixed(p, zero_stateid.data, NFS4_STATEID_SIZE);
1440 RESERVE_SPACE(2*4); 1436 RESERVE_SPACE(2*4);
1441 *p++ = cpu_to_be32(1); 1437 *p++ = cpu_to_be32(1);
1442 *p++ = cpu_to_be32(FATTR4_WORD0_ACL); 1438 *p++ = cpu_to_be32(FATTR4_WORD0_ACL);
@@ -1467,7 +1463,7 @@ static void encode_setattr(struct xdr_stream *xdr, const struct nfs_setattrargs
1467 1463
1468 RESERVE_SPACE(4+NFS4_STATEID_SIZE); 1464 RESERVE_SPACE(4+NFS4_STATEID_SIZE);
1469 *p++ = cpu_to_be32(OP_SETATTR); 1465 *p++ = cpu_to_be32(OP_SETATTR);
1470 WRITEMEM(arg->stateid.data, NFS4_STATEID_SIZE); 1466 p = xdr_encode_opaque_fixed(p, arg->stateid.data, NFS4_STATEID_SIZE);
1471 hdr->nops++; 1467 hdr->nops++;
1472 hdr->replen += decode_setattr_maxsz; 1468 hdr->replen += decode_setattr_maxsz;
1473 encode_attrs(xdr, arg->iap, server); 1469 encode_attrs(xdr, arg->iap, server);
@@ -1479,7 +1475,7 @@ static void encode_setclientid(struct xdr_stream *xdr, const struct nfs4_setclie
1479 1475
1480 RESERVE_SPACE(4 + NFS4_VERIFIER_SIZE); 1476 RESERVE_SPACE(4 + NFS4_VERIFIER_SIZE);
1481 *p++ = cpu_to_be32(OP_SETCLIENTID); 1477 *p++ = cpu_to_be32(OP_SETCLIENTID);
1482 WRITEMEM(setclientid->sc_verifier->data, NFS4_VERIFIER_SIZE); 1478 p = xdr_encode_opaque_fixed(p, setclientid->sc_verifier->data, NFS4_VERIFIER_SIZE);
1483 1479
1484 encode_string(xdr, setclientid->sc_name_len, setclientid->sc_name); 1480 encode_string(xdr, setclientid->sc_name_len, setclientid->sc_name);
1485 RESERVE_SPACE(4); 1481 RESERVE_SPACE(4);
@@ -1499,7 +1495,7 @@ static void encode_setclientid_confirm(struct xdr_stream *xdr, const struct nfs_
1499 RESERVE_SPACE(12 + NFS4_VERIFIER_SIZE); 1495 RESERVE_SPACE(12 + NFS4_VERIFIER_SIZE);
1500 *p++ = cpu_to_be32(OP_SETCLIENTID_CONFIRM); 1496 *p++ = cpu_to_be32(OP_SETCLIENTID_CONFIRM);
1501 p = xdr_encode_hyper(p, client_state->cl_clientid); 1497 p = xdr_encode_hyper(p, client_state->cl_clientid);
1502 WRITEMEM(client_state->cl_confirm.data, NFS4_VERIFIER_SIZE); 1498 p = xdr_encode_opaque_fixed(p, client_state->cl_confirm.data, NFS4_VERIFIER_SIZE);
1503 hdr->nops++; 1499 hdr->nops++;
1504 hdr->replen += decode_setclientid_confirm_maxsz; 1500 hdr->replen += decode_setclientid_confirm_maxsz;
1505} 1501}
@@ -1530,7 +1526,7 @@ static void encode_delegreturn(struct xdr_stream *xdr, const nfs4_stateid *state
1530 RESERVE_SPACE(4+NFS4_STATEID_SIZE); 1526 RESERVE_SPACE(4+NFS4_STATEID_SIZE);
1531 1527
1532 *p++ = cpu_to_be32(OP_DELEGRETURN); 1528 *p++ = cpu_to_be32(OP_DELEGRETURN);
1533 WRITEMEM(stateid->data, NFS4_STATEID_SIZE); 1529 p = xdr_encode_opaque_fixed(p, stateid->data, NFS4_STATEID_SIZE);
1534 hdr->nops++; 1530 hdr->nops++;
1535 hdr->replen += decode_delegreturn_maxsz; 1531 hdr->replen += decode_delegreturn_maxsz;
1536} 1532}
@@ -1545,7 +1541,7 @@ static void encode_exchange_id(struct xdr_stream *xdr,
1545 1541
1546 RESERVE_SPACE(4 + sizeof(args->verifier->data)); 1542 RESERVE_SPACE(4 + sizeof(args->verifier->data));
1547 *p++ = cpu_to_be32(OP_EXCHANGE_ID); 1543 *p++ = cpu_to_be32(OP_EXCHANGE_ID);
1548 WRITEMEM(args->verifier->data, sizeof(args->verifier->data)); 1544 p = xdr_encode_opaque_fixed(p, args->verifier->data, sizeof(args->verifier->data));
1549 1545
1550 encode_string(xdr, args->id_len, args->id); 1546 encode_string(xdr, args->id_len, args->id);
1551 1547
@@ -1611,7 +1607,7 @@ static void encode_create_session(struct xdr_stream *xdr,
1611 clp->cl_ipaddr); 1607 clp->cl_ipaddr);
1612 RESERVE_SPACE(16 + len); 1608 RESERVE_SPACE(16 + len);
1613 *p++ = cpu_to_be32(len); 1609 *p++ = cpu_to_be32(len);
1614 WRITEMEM(machine_name, len); 1610 p = xdr_encode_opaque_fixed(p, machine_name, len);
1615 *p++ = cpu_to_be32(0); /* UID */ 1611 *p++ = cpu_to_be32(0); /* UID */
1616 *p++ = cpu_to_be32(0); /* GID */ 1612 *p++ = cpu_to_be32(0); /* GID */
1617 *p++ = cpu_to_be32(0); /* No more gids */ 1613 *p++ = cpu_to_be32(0); /* No more gids */
@@ -1626,7 +1622,7 @@ static void encode_destroy_session(struct xdr_stream *xdr,
1626 __be32 *p; 1622 __be32 *p;
1627 RESERVE_SPACE(4 + NFS4_MAX_SESSIONID_LEN); 1623 RESERVE_SPACE(4 + NFS4_MAX_SESSIONID_LEN);
1628 *p++ = cpu_to_be32(OP_DESTROY_SESSION); 1624 *p++ = cpu_to_be32(OP_DESTROY_SESSION);
1629 WRITEMEM(session->sess_id.data, NFS4_MAX_SESSIONID_LEN); 1625 p = xdr_encode_opaque_fixed(p, session->sess_id.data, NFS4_MAX_SESSIONID_LEN);
1630 hdr->nops++; 1626 hdr->nops++;
1631 hdr->replen += decode_destroy_session_maxsz; 1627 hdr->replen += decode_destroy_session_maxsz;
1632} 1628}
@@ -1666,7 +1662,7 @@ static void encode_sequence(struct xdr_stream *xdr,
1666 slot->seq_nr, args->sa_slotid, 1662 slot->seq_nr, args->sa_slotid,
1667 tp->highest_used_slotid, args->sa_cache_this); 1663 tp->highest_used_slotid, args->sa_cache_this);
1668 RESERVE_SPACE(NFS4_MAX_SESSIONID_LEN + 16); 1664 RESERVE_SPACE(NFS4_MAX_SESSIONID_LEN + 16);
1669 WRITEMEM(session->sess_id.data, NFS4_MAX_SESSIONID_LEN); 1665 p = xdr_encode_opaque_fixed(p, session->sess_id.data, NFS4_MAX_SESSIONID_LEN);
1670 *p++ = cpu_to_be32(slot->seq_nr); 1666 *p++ = cpu_to_be32(slot->seq_nr);
1671 *p++ = cpu_to_be32(args->sa_slotid); 1667 *p++ = cpu_to_be32(args->sa_slotid);
1672 *p++ = cpu_to_be32(tp->highest_used_slotid); 1668 *p++ = cpu_to_be32(tp->highest_used_slotid);