* task to translate them into Linux-specific versions which are more
* consistent with the style used in NFSv2/v3...
*/
-#define WRITE64(n) do { \
- *p++ = htonl((uint32_t)((n) >> 32)); \
- *p++ = htonl((uint32_t)(n)); \
-} while (0)
#define WRITEMEM(ptr,nbytes) do { \
p = xdr_encode_opaque_fixed(p, ptr, nbytes); \
} while (0)
if (iap->ia_valid & ATTR_SIZE) {
bmval0 |= FATTR4_WORD0_SIZE;
- WRITE64(iap->ia_size);
+ p = xdr_encode_hyper(p, iap->ia_size);
}
if (iap->ia_valid & ATTR_MODE) {
bmval1 |= FATTR4_WORD1_MODE;
RESERVE_SPACE(16);
*p++ = cpu_to_be32(OP_COMMIT);
- WRITE64(args->offset);
+ p = xdr_encode_hyper(p, args->offset);
*p++ = cpu_to_be32(args->count);
hdr->nops++;
hdr->replen += decode_commit_maxsz;
*p++ = cpu_to_be32(OP_LOCK);
*p++ = cpu_to_be32(nfs4_lock_type(args->fl, args->block));
*p++ = cpu_to_be32(args->reclaim);
- WRITE64(args->fl->fl_start);
- WRITE64(nfs4_lock_length(args->fl));
+ p = xdr_encode_hyper(p, args->fl->fl_start);
+ p = xdr_encode_hyper(p, nfs4_lock_length(args->fl));
*p++ = cpu_to_be32(args->new_lock_owner);
if (args->new_lock_owner){
RESERVE_SPACE(4+NFS4_STATEID_SIZE+32);
*p++ = cpu_to_be32(args->open_seqid->sequence->counter);
WRITEMEM(args->open_stateid->data, NFS4_STATEID_SIZE);
*p++ = cpu_to_be32(args->lock_seqid->sequence->counter);
- WRITE64(args->lock_owner.clientid);
+ p = xdr_encode_hyper(p, args->lock_owner.clientid);
*p++ = cpu_to_be32(16);
WRITEMEM("lock id:", 8);
- WRITE64(args->lock_owner.id);
+ p = xdr_encode_hyper(p, args->lock_owner.id);
}
else {
RESERVE_SPACE(NFS4_STATEID_SIZE+4);
RESERVE_SPACE(52);
*p++ = cpu_to_be32(OP_LOCKT);
*p++ = cpu_to_be32(nfs4_lock_type(args->fl, 0));
- WRITE64(args->fl->fl_start);
- WRITE64(nfs4_lock_length(args->fl));
- WRITE64(args->lock_owner.clientid);
+ p = xdr_encode_hyper(p, args->fl->fl_start);
+ p = xdr_encode_hyper(p, nfs4_lock_length(args->fl));
+ p = xdr_encode_hyper(p, args->lock_owner.clientid);
*p++ = cpu_to_be32(16);
WRITEMEM("lock id:", 8);
- WRITE64(args->lock_owner.id);
+ p = xdr_encode_hyper(p, args->lock_owner.id);
hdr->nops++;
hdr->replen += decode_lockt_maxsz;
}
*p++ = cpu_to_be32(nfs4_lock_type(args->fl, 0));
*p++ = cpu_to_be32(args->seqid->sequence->counter);
WRITEMEM(args->stateid->data, NFS4_STATEID_SIZE);
- WRITE64(args->fl->fl_start);
- WRITE64(nfs4_lock_length(args->fl));
+ p = xdr_encode_hyper(p, args->fl->fl_start);
+ p = xdr_encode_hyper(p, nfs4_lock_length(args->fl));
hdr->nops++;
hdr->replen += decode_locku_maxsz;
}
*p++ = cpu_to_be32(arg->seqid->sequence->counter);
encode_share_access(xdr, arg->fmode);
RESERVE_SPACE(28);
- WRITE64(arg->clientid);
+ p = xdr_encode_hyper(p, arg->clientid);
*p++ = cpu_to_be32(16);
WRITEMEM("open id:", 8);
- WRITE64(arg->id);
+ p = xdr_encode_hyper(p, arg->id);
}
static inline void encode_createmode(struct xdr_stream *xdr, const struct nfs_openargs *arg)
encode_stateid(xdr, args->context);
RESERVE_SPACE(12);
- WRITE64(args->offset);
+ p = xdr_encode_hyper(p, args->offset);
*p++ = cpu_to_be32(args->count);
hdr->nops++;
hdr->replen += decode_read_maxsz;
RESERVE_SPACE(12+NFS4_VERIFIER_SIZE+20);
*p++ = cpu_to_be32(OP_READDIR);
- WRITE64(readdir->cookie);
+ p = xdr_encode_hyper(p, readdir->cookie);
WRITEMEM(readdir->verifier.data, NFS4_VERIFIER_SIZE);
*p++ = cpu_to_be32(readdir->count >> 1); /* We're not doing readdirplus */
*p++ = cpu_to_be32(readdir->count);
RESERVE_SPACE(12);
*p++ = cpu_to_be32(OP_RENEW);
- WRITE64(client_stateid->cl_clientid);
+ p = xdr_encode_hyper(p, client_stateid->cl_clientid);
hdr->nops++;
hdr->replen += decode_renew_maxsz;
}
RESERVE_SPACE(12 + NFS4_VERIFIER_SIZE);
*p++ = cpu_to_be32(OP_SETCLIENTID_CONFIRM);
- WRITE64(client_state->cl_clientid);
+ p = xdr_encode_hyper(p, client_state->cl_clientid);
WRITEMEM(client_state->cl_confirm.data, NFS4_VERIFIER_SIZE);
hdr->nops++;
hdr->replen += decode_setclientid_confirm_maxsz;
encode_stateid(xdr, args->context);
RESERVE_SPACE(16);
- WRITE64(args->offset);
+ p = xdr_encode_hyper(p, args->offset);
*p++ = cpu_to_be32(args->stable);
*p++ = cpu_to_be32(args->count);
*p++ = cpu_to_be32(OP_CREATE_SESSION);
RESERVE_SPACE(8);
- WRITE64(clp->cl_ex_clid);
+ p = xdr_encode_hyper(p, clp->cl_ex_clid);
RESERVE_SPACE(8);
*p++ = cpu_to_be32(clp->cl_seqid); /*Sequence id */