diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-03-04 18:13:57 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-03-06 10:32:48 -0500 |
commit | ab19b4813fdbdef8f9c8732d1f7a2a69ae78d00b (patch) | |
tree | eef3e453d0c80d4134a833b2b8118e5ba134b275 /fs/nfs/nfs4xdr.c | |
parent | 4ade9821602ada8f56f3a3eb444dedbe42f1730e (diff) |
NFSv4: Add a encode op helper
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r-- | fs/nfs/nfs4xdr.c | 161 |
1 files changed, 32 insertions, 129 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 3b38ca5bafe8..e9d4ac06b5d9 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -935,6 +935,15 @@ static void encode_compound_hdr(struct xdr_stream *xdr, | |||
935 | *p = cpu_to_be32(hdr->nops); | 935 | *p = cpu_to_be32(hdr->nops); |
936 | } | 936 | } |
937 | 937 | ||
938 | static void encode_op_hdr(struct xdr_stream *xdr, enum nfs_opnum4 op, | ||
939 | uint32_t replen, | ||
940 | struct compound_hdr *hdr) | ||
941 | { | ||
942 | encode_uint32(xdr, op); | ||
943 | hdr->nops++; | ||
944 | hdr->replen += replen; | ||
945 | } | ||
946 | |||
938 | static void encode_nops(struct compound_hdr *hdr) | 947 | static void encode_nops(struct compound_hdr *hdr) |
939 | { | 948 | { |
940 | BUG_ON(hdr->nops > NFS4_MAX_OPS); | 949 | BUG_ON(hdr->nops > NFS4_MAX_OPS); |
@@ -1086,14 +1095,9 @@ static void encode_access(struct xdr_stream *xdr, u32 access, struct compound_hd | |||
1086 | 1095 | ||
1087 | static void encode_close(struct xdr_stream *xdr, const struct nfs_closeargs *arg, struct compound_hdr *hdr) | 1096 | static void encode_close(struct xdr_stream *xdr, const struct nfs_closeargs *arg, struct compound_hdr *hdr) |
1088 | { | 1097 | { |
1089 | __be32 *p; | 1098 | encode_op_hdr(xdr, OP_CLOSE, decode_close_maxsz, hdr); |
1090 | |||
1091 | p = reserve_space(xdr, 4); | ||
1092 | *p = cpu_to_be32(OP_CLOSE); | ||
1093 | encode_nfs4_seqid(xdr, arg->seqid); | 1099 | encode_nfs4_seqid(xdr, arg->seqid); |
1094 | encode_nfs4_stateid(xdr, arg->stateid); | 1100 | encode_nfs4_stateid(xdr, arg->stateid); |
1095 | hdr->nops++; | ||
1096 | hdr->replen += decode_close_maxsz; | ||
1097 | } | 1101 | } |
1098 | 1102 | ||
1099 | static void encode_commit(struct xdr_stream *xdr, const struct nfs_writeargs *args, struct compound_hdr *hdr) | 1103 | static void encode_commit(struct xdr_stream *xdr, const struct nfs_writeargs *args, struct compound_hdr *hdr) |
@@ -1172,8 +1176,7 @@ encode_getattr_three(struct xdr_stream *xdr, | |||
1172 | { | 1176 | { |
1173 | __be32 *p; | 1177 | __be32 *p; |
1174 | 1178 | ||
1175 | p = reserve_space(xdr, 4); | 1179 | encode_op_hdr(xdr, OP_GETATTR, decode_getattr_maxsz, hdr); |
1176 | *p = cpu_to_be32(OP_GETATTR); | ||
1177 | if (bm2) { | 1180 | if (bm2) { |
1178 | p = reserve_space(xdr, 16); | 1181 | p = reserve_space(xdr, 16); |
1179 | *p++ = cpu_to_be32(3); | 1182 | *p++ = cpu_to_be32(3); |
@@ -1190,8 +1193,6 @@ encode_getattr_three(struct xdr_stream *xdr, | |||
1190 | *p++ = cpu_to_be32(1); | 1193 | *p++ = cpu_to_be32(1); |
1191 | *p = cpu_to_be32(bm0); | 1194 | *p = cpu_to_be32(bm0); |
1192 | } | 1195 | } |
1193 | hdr->nops++; | ||
1194 | hdr->replen += decode_getattr_maxsz; | ||
1195 | } | 1196 | } |
1196 | 1197 | ||
1197 | static void encode_getfattr(struct xdr_stream *xdr, const u32* bitmask, struct compound_hdr *hdr) | 1198 | static void encode_getfattr(struct xdr_stream *xdr, const u32* bitmask, struct compound_hdr *hdr) |
@@ -1217,23 +1218,13 @@ static void encode_fs_locations(struct xdr_stream *xdr, const u32* bitmask, stru | |||
1217 | 1218 | ||
1218 | static void encode_getfh(struct xdr_stream *xdr, struct compound_hdr *hdr) | 1219 | static void encode_getfh(struct xdr_stream *xdr, struct compound_hdr *hdr) |
1219 | { | 1220 | { |
1220 | __be32 *p; | 1221 | encode_op_hdr(xdr, OP_GETFH, decode_getfh_maxsz, hdr); |
1221 | |||
1222 | p = reserve_space(xdr, 4); | ||
1223 | *p = cpu_to_be32(OP_GETFH); | ||
1224 | hdr->nops++; | ||
1225 | hdr->replen += decode_getfh_maxsz; | ||
1226 | } | 1222 | } |
1227 | 1223 | ||
1228 | static void encode_link(struct xdr_stream *xdr, const struct qstr *name, struct compound_hdr *hdr) | 1224 | static void encode_link(struct xdr_stream *xdr, const struct qstr *name, struct compound_hdr *hdr) |
1229 | { | 1225 | { |
1230 | __be32 *p; | 1226 | encode_op_hdr(xdr, OP_LINK, decode_link_maxsz, hdr); |
1231 | |||
1232 | p = reserve_space(xdr, 4); | ||
1233 | *p = cpu_to_be32(OP_LINK); | ||
1234 | encode_string(xdr, name->len, name->name); | 1227 | encode_string(xdr, name->len, name->name); |
1235 | hdr->nops++; | ||
1236 | hdr->replen += decode_link_maxsz; | ||
1237 | } | 1228 | } |
1238 | 1229 | ||
1239 | static inline int nfs4_lock_type(struct file_lock *fl, int block) | 1230 | static inline int nfs4_lock_type(struct file_lock *fl, int block) |
@@ -1323,24 +1314,14 @@ static void encode_locku(struct xdr_stream *xdr, const struct nfs_locku_args *ar | |||
1323 | 1314 | ||
1324 | static void encode_release_lockowner(struct xdr_stream *xdr, const struct nfs_lowner *lowner, struct compound_hdr *hdr) | 1315 | static void encode_release_lockowner(struct xdr_stream *xdr, const struct nfs_lowner *lowner, struct compound_hdr *hdr) |
1325 | { | 1316 | { |
1326 | __be32 *p; | 1317 | encode_op_hdr(xdr, OP_RELEASE_LOCKOWNER, decode_release_lockowner_maxsz, hdr); |
1327 | |||
1328 | p = reserve_space(xdr, 4); | ||
1329 | *p = cpu_to_be32(OP_RELEASE_LOCKOWNER); | ||
1330 | encode_lockowner(xdr, lowner); | 1318 | encode_lockowner(xdr, lowner); |
1331 | hdr->nops++; | ||
1332 | hdr->replen += decode_release_lockowner_maxsz; | ||
1333 | } | 1319 | } |
1334 | 1320 | ||
1335 | static void encode_lookup(struct xdr_stream *xdr, const struct qstr *name, struct compound_hdr *hdr) | 1321 | static void encode_lookup(struct xdr_stream *xdr, const struct qstr *name, struct compound_hdr *hdr) |
1336 | { | 1322 | { |
1337 | __be32 *p; | 1323 | encode_op_hdr(xdr, OP_LOOKUP, decode_lookup_maxsz, hdr); |
1338 | |||
1339 | p = reserve_space(xdr, 4); | ||
1340 | *p = cpu_to_be32(OP_LOOKUP); | ||
1341 | encode_string(xdr, name->len, name->name); | 1324 | encode_string(xdr, name->len, name->name); |
1342 | hdr->nops++; | ||
1343 | hdr->replen += decode_lookup_maxsz; | ||
1344 | } | 1325 | } |
1345 | 1326 | ||
1346 | static void encode_share_access(struct xdr_stream *xdr, fmode_t fmode) | 1327 | static void encode_share_access(struct xdr_stream *xdr, fmode_t fmode) |
@@ -1371,8 +1352,6 @@ static inline void encode_openhdr(struct xdr_stream *xdr, const struct nfs_opena | |||
1371 | * opcode 4, seqid 4, share_access 4, share_deny 4, clientid 8, ownerlen 4, | 1352 | * opcode 4, seqid 4, share_access 4, share_deny 4, clientid 8, ownerlen 4, |
1372 | * owner 4 = 32 | 1353 | * owner 4 = 32 |
1373 | */ | 1354 | */ |
1374 | p = reserve_space(xdr, 4); | ||
1375 | *p = cpu_to_be32(OP_OPEN); | ||
1376 | encode_nfs4_seqid(xdr, arg->seqid); | 1355 | encode_nfs4_seqid(xdr, arg->seqid); |
1377 | encode_share_access(xdr, arg->fmode); | 1356 | encode_share_access(xdr, arg->fmode); |
1378 | p = reserve_space(xdr, 32); | 1357 | p = reserve_space(xdr, 32); |
@@ -1481,6 +1460,7 @@ static inline void encode_claim_delegate_cur(struct xdr_stream *xdr, const struc | |||
1481 | 1460 | ||
1482 | static void encode_open(struct xdr_stream *xdr, const struct nfs_openargs *arg, struct compound_hdr *hdr) | 1461 | static void encode_open(struct xdr_stream *xdr, const struct nfs_openargs *arg, struct compound_hdr *hdr) |
1483 | { | 1462 | { |
1463 | encode_op_hdr(xdr, OP_OPEN, decode_open_maxsz, hdr); | ||
1484 | encode_openhdr(xdr, arg); | 1464 | encode_openhdr(xdr, arg); |
1485 | encode_opentype(xdr, arg); | 1465 | encode_opentype(xdr, arg); |
1486 | switch (arg->claim) { | 1466 | switch (arg->claim) { |
@@ -1496,55 +1476,33 @@ static void encode_open(struct xdr_stream *xdr, const struct nfs_openargs *arg, | |||
1496 | default: | 1476 | default: |
1497 | BUG(); | 1477 | BUG(); |
1498 | } | 1478 | } |
1499 | hdr->nops++; | ||
1500 | hdr->replen += decode_open_maxsz; | ||
1501 | } | 1479 | } |
1502 | 1480 | ||
1503 | static void encode_open_confirm(struct xdr_stream *xdr, const struct nfs_open_confirmargs *arg, struct compound_hdr *hdr) | 1481 | static void encode_open_confirm(struct xdr_stream *xdr, const struct nfs_open_confirmargs *arg, struct compound_hdr *hdr) |
1504 | { | 1482 | { |
1505 | __be32 *p; | 1483 | encode_op_hdr(xdr, OP_OPEN_CONFIRM, decode_open_confirm_maxsz, hdr); |
1506 | |||
1507 | p = reserve_space(xdr, 4); | ||
1508 | *p = cpu_to_be32(OP_OPEN_CONFIRM); | ||
1509 | encode_nfs4_stateid(xdr, arg->stateid); | 1484 | encode_nfs4_stateid(xdr, arg->stateid); |
1510 | encode_nfs4_seqid(xdr, arg->seqid); | 1485 | encode_nfs4_seqid(xdr, arg->seqid); |
1511 | hdr->nops++; | ||
1512 | hdr->replen += decode_open_confirm_maxsz; | ||
1513 | } | 1486 | } |
1514 | 1487 | ||
1515 | static void encode_open_downgrade(struct xdr_stream *xdr, const struct nfs_closeargs *arg, struct compound_hdr *hdr) | 1488 | static void encode_open_downgrade(struct xdr_stream *xdr, const struct nfs_closeargs *arg, struct compound_hdr *hdr) |
1516 | { | 1489 | { |
1517 | __be32 *p; | 1490 | encode_op_hdr(xdr, OP_OPEN_DOWNGRADE, decode_open_downgrade_maxsz, hdr); |
1518 | |||
1519 | p = reserve_space(xdr, 4); | ||
1520 | *p = cpu_to_be32(OP_OPEN_DOWNGRADE); | ||
1521 | encode_nfs4_stateid(xdr, arg->stateid); | 1491 | encode_nfs4_stateid(xdr, arg->stateid); |
1522 | encode_nfs4_seqid(xdr, arg->seqid); | 1492 | encode_nfs4_seqid(xdr, arg->seqid); |
1523 | encode_share_access(xdr, arg->fmode); | 1493 | encode_share_access(xdr, arg->fmode); |
1524 | hdr->nops++; | ||
1525 | hdr->replen += decode_open_downgrade_maxsz; | ||
1526 | } | 1494 | } |
1527 | 1495 | ||
1528 | static void | 1496 | static void |
1529 | encode_putfh(struct xdr_stream *xdr, const struct nfs_fh *fh, struct compound_hdr *hdr) | 1497 | encode_putfh(struct xdr_stream *xdr, const struct nfs_fh *fh, struct compound_hdr *hdr) |
1530 | { | 1498 | { |
1531 | __be32 *p; | 1499 | encode_op_hdr(xdr, OP_PUTFH, decode_putfh_maxsz, hdr); |
1532 | |||
1533 | p = reserve_space(xdr, 4); | ||
1534 | *p = cpu_to_be32(OP_PUTFH); | ||
1535 | encode_string(xdr, fh->size, fh->data); | 1500 | encode_string(xdr, fh->size, fh->data); |
1536 | hdr->nops++; | ||
1537 | hdr->replen += decode_putfh_maxsz; | ||
1538 | } | 1501 | } |
1539 | 1502 | ||
1540 | static void encode_putrootfh(struct xdr_stream *xdr, struct compound_hdr *hdr) | 1503 | static void encode_putrootfh(struct xdr_stream *xdr, struct compound_hdr *hdr) |
1541 | { | 1504 | { |
1542 | __be32 *p; | 1505 | encode_op_hdr(xdr, OP_PUTROOTFH, decode_putrootfh_maxsz, hdr); |
1543 | |||
1544 | p = reserve_space(xdr, 4); | ||
1545 | *p = cpu_to_be32(OP_PUTROOTFH); | ||
1546 | hdr->nops++; | ||
1547 | hdr->replen += decode_putrootfh_maxsz; | ||
1548 | } | 1506 | } |
1549 | 1507 | ||
1550 | static void encode_open_stateid(struct xdr_stream *xdr, const struct nfs_open_context *ctx, const struct nfs_lock_context *l_ctx, int zero_seqid) | 1508 | static void encode_open_stateid(struct xdr_stream *xdr, const struct nfs_open_context *ctx, const struct nfs_lock_context *l_ctx, int zero_seqid) |
@@ -1564,17 +1522,13 @@ static void encode_read(struct xdr_stream *xdr, const struct nfs_readargs *args, | |||
1564 | { | 1522 | { |
1565 | __be32 *p; | 1523 | __be32 *p; |
1566 | 1524 | ||
1567 | p = reserve_space(xdr, 4); | 1525 | encode_op_hdr(xdr, OP_READ, decode_read_maxsz, hdr); |
1568 | *p = cpu_to_be32(OP_READ); | ||
1569 | |||
1570 | encode_open_stateid(xdr, args->context, args->lock_context, | 1526 | encode_open_stateid(xdr, args->context, args->lock_context, |
1571 | hdr->minorversion); | 1527 | hdr->minorversion); |
1572 | 1528 | ||
1573 | p = reserve_space(xdr, 12); | 1529 | p = reserve_space(xdr, 12); |
1574 | p = xdr_encode_hyper(p, args->offset); | 1530 | p = xdr_encode_hyper(p, args->offset); |
1575 | *p = cpu_to_be32(args->count); | 1531 | *p = cpu_to_be32(args->count); |
1576 | hdr->nops++; | ||
1577 | hdr->replen += decode_read_maxsz; | ||
1578 | } | 1532 | } |
1579 | 1533 | ||
1580 | static void encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg *readdir, struct rpc_rqst *req, struct compound_hdr *hdr) | 1534 | static void encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg *readdir, struct rpc_rqst *req, struct compound_hdr *hdr) |
@@ -1622,35 +1576,20 @@ static void encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg | |||
1622 | 1576 | ||
1623 | static void encode_readlink(struct xdr_stream *xdr, const struct nfs4_readlink *readlink, struct rpc_rqst *req, struct compound_hdr *hdr) | 1577 | static void encode_readlink(struct xdr_stream *xdr, const struct nfs4_readlink *readlink, struct rpc_rqst *req, struct compound_hdr *hdr) |
1624 | { | 1578 | { |
1625 | __be32 *p; | 1579 | encode_op_hdr(xdr, OP_READLINK, decode_readlink_maxsz, hdr); |
1626 | |||
1627 | p = reserve_space(xdr, 4); | ||
1628 | *p = cpu_to_be32(OP_READLINK); | ||
1629 | hdr->nops++; | ||
1630 | hdr->replen += decode_readlink_maxsz; | ||
1631 | } | 1580 | } |
1632 | 1581 | ||
1633 | static void encode_remove(struct xdr_stream *xdr, const struct qstr *name, struct compound_hdr *hdr) | 1582 | static void encode_remove(struct xdr_stream *xdr, const struct qstr *name, struct compound_hdr *hdr) |
1634 | { | 1583 | { |
1635 | __be32 *p; | 1584 | encode_op_hdr(xdr, OP_REMOVE, decode_remove_maxsz, hdr); |
1636 | |||
1637 | p = reserve_space(xdr, 4); | ||
1638 | *p = cpu_to_be32(OP_REMOVE); | ||
1639 | encode_string(xdr, name->len, name->name); | 1585 | encode_string(xdr, name->len, name->name); |
1640 | hdr->nops++; | ||
1641 | hdr->replen += decode_remove_maxsz; | ||
1642 | } | 1586 | } |
1643 | 1587 | ||
1644 | static void encode_rename(struct xdr_stream *xdr, const struct qstr *oldname, const struct qstr *newname, struct compound_hdr *hdr) | 1588 | static void encode_rename(struct xdr_stream *xdr, const struct qstr *oldname, const struct qstr *newname, struct compound_hdr *hdr) |
1645 | { | 1589 | { |
1646 | __be32 *p; | 1590 | encode_op_hdr(xdr, OP_RENAME, decode_rename_maxsz, hdr); |
1647 | |||
1648 | p = reserve_space(xdr, 4); | ||
1649 | *p = cpu_to_be32(OP_RENAME); | ||
1650 | encode_string(xdr, oldname->len, oldname->name); | 1591 | encode_string(xdr, oldname->len, oldname->name); |
1651 | encode_string(xdr, newname->len, newname->name); | 1592 | encode_string(xdr, newname->len, newname->name); |
1652 | hdr->nops++; | ||
1653 | hdr->replen += decode_rename_maxsz; | ||
1654 | } | 1593 | } |
1655 | 1594 | ||
1656 | static void encode_renew(struct xdr_stream *xdr, clientid4 clid, | 1595 | static void encode_renew(struct xdr_stream *xdr, clientid4 clid, |
@@ -1668,12 +1607,7 @@ static void encode_renew(struct xdr_stream *xdr, clientid4 clid, | |||
1668 | static void | 1607 | static void |
1669 | encode_restorefh(struct xdr_stream *xdr, struct compound_hdr *hdr) | 1608 | encode_restorefh(struct xdr_stream *xdr, struct compound_hdr *hdr) |
1670 | { | 1609 | { |
1671 | __be32 *p; | 1610 | encode_op_hdr(xdr, OP_RESTOREFH, decode_restorefh_maxsz, hdr); |
1672 | |||
1673 | p = reserve_space(xdr, 4); | ||
1674 | *p = cpu_to_be32(OP_RESTOREFH); | ||
1675 | hdr->nops++; | ||
1676 | hdr->replen += decode_restorefh_maxsz; | ||
1677 | } | 1611 | } |
1678 | 1612 | ||
1679 | static void | 1613 | static void |
@@ -1681,8 +1615,7 @@ encode_setacl(struct xdr_stream *xdr, struct nfs_setaclargs *arg, struct compoun | |||
1681 | { | 1615 | { |
1682 | __be32 *p; | 1616 | __be32 *p; |
1683 | 1617 | ||
1684 | p = reserve_space(xdr, 4); | 1618 | encode_op_hdr(xdr, OP_SETATTR, decode_setacl_maxsz, hdr); |
1685 | *p = cpu_to_be32(OP_SETATTR); | ||
1686 | encode_nfs4_stateid(xdr, &zero_stateid); | 1619 | encode_nfs4_stateid(xdr, &zero_stateid); |
1687 | p = reserve_space(xdr, 2*4); | 1620 | p = reserve_space(xdr, 2*4); |
1688 | *p++ = cpu_to_be32(1); | 1621 | *p++ = cpu_to_be32(1); |
@@ -1691,30 +1624,18 @@ encode_setacl(struct xdr_stream *xdr, struct nfs_setaclargs *arg, struct compoun | |||
1691 | p = reserve_space(xdr, 4); | 1624 | p = reserve_space(xdr, 4); |
1692 | *p = cpu_to_be32(arg->acl_len); | 1625 | *p = cpu_to_be32(arg->acl_len); |
1693 | xdr_write_pages(xdr, arg->acl_pages, arg->acl_pgbase, arg->acl_len); | 1626 | xdr_write_pages(xdr, arg->acl_pages, arg->acl_pgbase, arg->acl_len); |
1694 | hdr->nops++; | ||
1695 | hdr->replen += decode_setacl_maxsz; | ||
1696 | } | 1627 | } |
1697 | 1628 | ||
1698 | static void | 1629 | static void |
1699 | encode_savefh(struct xdr_stream *xdr, struct compound_hdr *hdr) | 1630 | encode_savefh(struct xdr_stream *xdr, struct compound_hdr *hdr) |
1700 | { | 1631 | { |
1701 | __be32 *p; | 1632 | encode_op_hdr(xdr, OP_SAVEFH, decode_savefh_maxsz, hdr); |
1702 | |||
1703 | p = reserve_space(xdr, 4); | ||
1704 | *p = cpu_to_be32(OP_SAVEFH); | ||
1705 | hdr->nops++; | ||
1706 | hdr->replen += decode_savefh_maxsz; | ||
1707 | } | 1633 | } |
1708 | 1634 | ||
1709 | static void encode_setattr(struct xdr_stream *xdr, const struct nfs_setattrargs *arg, const struct nfs_server *server, struct compound_hdr *hdr) | 1635 | static void encode_setattr(struct xdr_stream *xdr, const struct nfs_setattrargs *arg, const struct nfs_server *server, struct compound_hdr *hdr) |
1710 | { | 1636 | { |
1711 | __be32 *p; | 1637 | encode_op_hdr(xdr, OP_SETATTR, decode_setattr_maxsz, hdr); |
1712 | |||
1713 | p = reserve_space(xdr, 4); | ||
1714 | *p = cpu_to_be32(OP_SETATTR); | ||
1715 | encode_nfs4_stateid(xdr, &arg->stateid); | 1638 | encode_nfs4_stateid(xdr, &arg->stateid); |
1716 | hdr->nops++; | ||
1717 | hdr->replen += decode_setattr_maxsz; | ||
1718 | encode_attrs(xdr, arg->iap, server); | 1639 | encode_attrs(xdr, arg->iap, server); |
1719 | } | 1640 | } |
1720 | 1641 | ||
@@ -1753,9 +1674,7 @@ static void encode_write(struct xdr_stream *xdr, const struct nfs_writeargs *arg | |||
1753 | { | 1674 | { |
1754 | __be32 *p; | 1675 | __be32 *p; |
1755 | 1676 | ||
1756 | p = reserve_space(xdr, 4); | 1677 | encode_op_hdr(xdr, OP_WRITE, decode_write_maxsz, hdr); |
1757 | *p = cpu_to_be32(OP_WRITE); | ||
1758 | |||
1759 | encode_open_stateid(xdr, args->context, args->lock_context, | 1678 | encode_open_stateid(xdr, args->context, args->lock_context, |
1760 | hdr->minorversion); | 1679 | hdr->minorversion); |
1761 | 1680 | ||
@@ -1765,30 +1684,18 @@ static void encode_write(struct xdr_stream *xdr, const struct nfs_writeargs *arg | |||
1765 | *p = cpu_to_be32(args->count); | 1684 | *p = cpu_to_be32(args->count); |
1766 | 1685 | ||
1767 | xdr_write_pages(xdr, args->pages, args->pgbase, args->count); | 1686 | xdr_write_pages(xdr, args->pages, args->pgbase, args->count); |
1768 | hdr->nops++; | ||
1769 | hdr->replen += decode_write_maxsz; | ||
1770 | } | 1687 | } |
1771 | 1688 | ||
1772 | static void encode_delegreturn(struct xdr_stream *xdr, const nfs4_stateid *stateid, struct compound_hdr *hdr) | 1689 | static void encode_delegreturn(struct xdr_stream *xdr, const nfs4_stateid *stateid, struct compound_hdr *hdr) |
1773 | { | 1690 | { |
1774 | __be32 *p; | 1691 | encode_op_hdr(xdr, OP_DELEGRETURN, decode_delegreturn_maxsz, hdr); |
1775 | |||
1776 | p = reserve_space(xdr, 4); | ||
1777 | *p = cpu_to_be32(OP_DELEGRETURN); | ||
1778 | encode_nfs4_stateid(xdr, stateid); | 1692 | encode_nfs4_stateid(xdr, stateid); |
1779 | hdr->nops++; | ||
1780 | hdr->replen += decode_delegreturn_maxsz; | ||
1781 | } | 1693 | } |
1782 | 1694 | ||
1783 | static void encode_secinfo(struct xdr_stream *xdr, const struct qstr *name, struct compound_hdr *hdr) | 1695 | static void encode_secinfo(struct xdr_stream *xdr, const struct qstr *name, struct compound_hdr *hdr) |
1784 | { | 1696 | { |
1785 | __be32 *p; | 1697 | encode_op_hdr(xdr, OP_SECINFO, decode_secinfo_maxsz, hdr); |
1786 | |||
1787 | p = reserve_space(xdr, 4); | ||
1788 | *p = cpu_to_be32(OP_SECINFO); | ||
1789 | encode_string(xdr, name->len, name->name); | 1698 | encode_string(xdr, name->len, name->name); |
1790 | hdr->nops++; | ||
1791 | hdr->replen += decode_secinfo_maxsz; | ||
1792 | } | 1699 | } |
1793 | 1700 | ||
1794 | #if defined(CONFIG_NFS_V4_1) | 1701 | #if defined(CONFIG_NFS_V4_1) |
@@ -2132,12 +2039,8 @@ static void encode_free_stateid(struct xdr_stream *xdr, | |||
2132 | struct nfs41_free_stateid_args *args, | 2039 | struct nfs41_free_stateid_args *args, |
2133 | struct compound_hdr *hdr) | 2040 | struct compound_hdr *hdr) |
2134 | { | 2041 | { |
2135 | __be32 *p; | 2042 | encode_op_hdr(xdr, OP_FREE_STATEID, decode_free_stateid_maxsz, hdr); |
2136 | p = reserve_space(xdr, 4); | ||
2137 | *p = cpu_to_be32(OP_FREE_STATEID); | ||
2138 | encode_nfs4_stateid(xdr, args->stateid); | 2043 | encode_nfs4_stateid(xdr, args->stateid); |
2139 | hdr->nops++; | ||
2140 | hdr->replen += decode_free_stateid_maxsz; | ||
2141 | } | 2044 | } |
2142 | #endif /* CONFIG_NFS_V4_1 */ | 2045 | #endif /* CONFIG_NFS_V4_1 */ |
2143 | 2046 | ||