aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4xdr.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-03-05 11:40:12 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-03-06 10:32:50 -0500
commitff2eb6818d0d5b2691c112f51c539a817fcc59fc (patch)
treea21cbf015c37babb6a913a30c7619b8670dda99e /fs/nfs/nfs4xdr.c
parent475d4ba02c3748b69cc71fa5c11c4b281cac5928 (diff)
NFSv4: Add a helper encode_uint64
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r--fs/nfs/nfs4xdr.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 4ea9f50a32f2..e4bb8e6409a7 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -909,6 +909,14 @@ static void encode_uint32(struct xdr_stream *xdr, u32 n)
909 *p = cpu_to_be32(n); 909 *p = cpu_to_be32(n);
910} 910}
911 911
912static void encode_uint64(struct xdr_stream *xdr, u64 n)
913{
914 __be32 *p;
915
916 p = reserve_space(xdr, 8);
917 xdr_encode_hyper(p, n);
918}
919
912static void encode_nfs4_seqid(struct xdr_stream *xdr, 920static void encode_nfs4_seqid(struct xdr_stream *xdr,
913 const struct nfs_seqid *seqid) 921 const struct nfs_seqid *seqid)
914{ 922{
@@ -1532,8 +1540,7 @@ static void encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg
1532 attrs[0] |= FATTR4_WORD0_FILEID; 1540 attrs[0] |= FATTR4_WORD0_FILEID;
1533 1541
1534 encode_op_hdr(xdr, OP_READDIR, decode_readdir_maxsz, hdr); 1542 encode_op_hdr(xdr, OP_READDIR, decode_readdir_maxsz, hdr);
1535 p = reserve_space(xdr, 8); 1543 encode_uint64(xdr, readdir->cookie);
1536 p = xdr_encode_hyper(p, readdir->cookie);
1537 encode_nfs4_verifier(xdr, &readdir->verifier); 1544 encode_nfs4_verifier(xdr, &readdir->verifier);
1538 p = reserve_space(xdr, 20); 1545 p = reserve_space(xdr, 20);
1539 *p++ = cpu_to_be32(dircount); 1546 *p++ = cpu_to_be32(dircount);
@@ -1572,11 +1579,8 @@ static void encode_rename(struct xdr_stream *xdr, const struct qstr *oldname, co
1572static void encode_renew(struct xdr_stream *xdr, clientid4 clid, 1579static void encode_renew(struct xdr_stream *xdr, clientid4 clid,
1573 struct compound_hdr *hdr) 1580 struct compound_hdr *hdr)
1574{ 1581{
1575 __be32 *p;
1576
1577 encode_op_hdr(xdr, OP_RENEW, decode_renew_maxsz, hdr); 1582 encode_op_hdr(xdr, OP_RENEW, decode_renew_maxsz, hdr);
1578 p = reserve_space(xdr, 8); 1583 encode_uint64(xdr, clid);
1579 xdr_encode_hyper(p, clid);
1580} 1584}
1581 1585
1582static void 1586static void
@@ -1632,12 +1636,9 @@ static void encode_setclientid(struct xdr_stream *xdr, const struct nfs4_setclie
1632 1636
1633static void encode_setclientid_confirm(struct xdr_stream *xdr, const struct nfs4_setclientid_res *arg, struct compound_hdr *hdr) 1637static void encode_setclientid_confirm(struct xdr_stream *xdr, const struct nfs4_setclientid_res *arg, struct compound_hdr *hdr)
1634{ 1638{
1635 __be32 *p;
1636
1637 encode_op_hdr(xdr, OP_SETCLIENTID_CONFIRM, 1639 encode_op_hdr(xdr, OP_SETCLIENTID_CONFIRM,
1638 decode_setclientid_confirm_maxsz, hdr); 1640 decode_setclientid_confirm_maxsz, hdr);
1639 p = reserve_space(xdr, 8); 1641 encode_uint64(xdr, arg->clientid);
1640 p = xdr_encode_hyper(p, arg->clientid);
1641 encode_nfs4_verifier(xdr, &arg->confirm); 1642 encode_nfs4_verifier(xdr, &arg->confirm);
1642} 1643}
1643 1644