4 #ifndef __LINUX_FS_NFS_NFS4_2XDR_H
5 #define __LINUX_FS_NFS_NFS4_2XDR_H
7 #define encode_seek_maxsz (op_encode_hdr_maxsz + \
8 encode_stateid_maxsz + \
11 #define decode_seek_maxsz (op_decode_hdr_maxsz + \
17 #define NFS4_enc_seek_sz (compound_encode_hdr_maxsz + \
18 encode_putfh_maxsz + \
20 #define NFS4_dec_seek_sz (compound_decode_hdr_maxsz + \
21 decode_putfh_maxsz + \
25 static void encode_seek(struct xdr_stream *xdr,
26 struct nfs42_seek_args *args,
27 struct compound_hdr *hdr)
29 encode_op_hdr(xdr, OP_SEEK, decode_seek_maxsz, hdr);
30 encode_nfs4_stateid(xdr, &args->sa_stateid);
31 encode_uint64(xdr, args->sa_offset);
32 encode_uint32(xdr, args->sa_what);
38 static void nfs4_xdr_enc_seek(struct rpc_rqst *req,
39 struct xdr_stream *xdr,
40 struct nfs42_seek_args *args)
42 struct compound_hdr hdr = {
43 .minorversion = nfs4_xdr_minorversion(&args->seq_args),
46 encode_compound_hdr(xdr, req, &hdr);
47 encode_sequence(xdr, &args->seq_args, &hdr);
48 encode_putfh(xdr, args->sa_fh, &hdr);
49 encode_seek(xdr, args, &hdr);
53 static int decode_seek(struct xdr_stream *xdr, struct nfs42_seek_res *res)
58 status = decode_op_hdr(xdr, OP_SEEK);
62 p = xdr_inline_decode(xdr, 4 + 8);
66 res->sr_eof = be32_to_cpup(p++);
67 p = xdr_decode_hyper(p, &res->sr_offset);
71 print_overflow_msg(__func__, xdr);
78 static int nfs4_xdr_dec_seek(struct rpc_rqst *rqstp,
79 struct xdr_stream *xdr,
80 struct nfs42_seek_res *res)
82 struct compound_hdr hdr;
85 status = decode_compound_hdr(xdr, &hdr);
88 status = decode_sequence(xdr, &res->seq_res, rqstp);
91 status = decode_putfh(xdr);
94 status = decode_seek(xdr, res);
98 #endif /* __LINUX_FS_NFS_NFS4_2XDR_H */