1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2014 Anna Schumaker <Anna.Schumaker@Netapp.com>
5 #ifndef __LINUX_FS_NFS_NFS4_2XDR_H
6 #define __LINUX_FS_NFS_NFS4_2XDR_H
10 #define encode_fallocate_maxsz (encode_stateid_maxsz + \
13 #define NFS42_WRITE_RES_SIZE (1 /* wr_callback_id size */ +\
14 XDR_QUADLEN(NFS4_STATEID_SIZE) + \
16 1 /* wr_committed */ + \
17 XDR_QUADLEN(NFS4_VERIFIER_SIZE))
18 #define encode_allocate_maxsz (op_encode_hdr_maxsz + \
19 encode_fallocate_maxsz)
20 #define decode_allocate_maxsz (op_decode_hdr_maxsz)
21 #define encode_copy_maxsz (op_encode_hdr_maxsz + \
22 XDR_QUADLEN(NFS4_STATEID_SIZE) + \
23 XDR_QUADLEN(NFS4_STATEID_SIZE) + \
24 2 + 2 + 2 + 1 + 1 + 1 +\
25 1 + /* One cnr_source_server */\
27 1 + XDR_QUADLEN(NFS4_OPAQUE_LIMIT))
28 #define decode_copy_maxsz (op_decode_hdr_maxsz + \
29 NFS42_WRITE_RES_SIZE + \
30 1 /* cr_consecutive */ + \
31 1 /* cr_synchronous */)
32 #define encode_offload_cancel_maxsz (op_encode_hdr_maxsz + \
33 XDR_QUADLEN(NFS4_STATEID_SIZE))
34 #define decode_offload_cancel_maxsz (op_decode_hdr_maxsz)
35 #define encode_copy_notify_maxsz (op_encode_hdr_maxsz + \
36 XDR_QUADLEN(NFS4_STATEID_SIZE) + \
38 1 + XDR_QUADLEN(NFS4_OPAQUE_LIMIT))
39 #define decode_copy_notify_maxsz (op_decode_hdr_maxsz + \
40 3 + /* cnr_lease_time */\
41 XDR_QUADLEN(NFS4_STATEID_SIZE) + \
42 1 + /* Support 1 cnr_source_server */\
44 1 + XDR_QUADLEN(NFS4_OPAQUE_LIMIT))
45 #define encode_deallocate_maxsz (op_encode_hdr_maxsz + \
46 encode_fallocate_maxsz)
47 #define decode_deallocate_maxsz (op_decode_hdr_maxsz)
48 #define encode_read_plus_maxsz (op_encode_hdr_maxsz + \
49 encode_stateid_maxsz + 3)
50 #define NFS42_READ_PLUS_DATA_SEGMENT_SIZE \
51 (1 /* data_content4 */ + \
52 2 /* data_info4.di_offset */ + \
53 1 /* data_info4.di_length */)
54 #define NFS42_READ_PLUS_HOLE_SEGMENT_SIZE \
55 (1 /* data_content4 */ + \
56 2 /* data_info4.di_offset */ + \
57 2 /* data_info4.di_length */)
58 #define READ_PLUS_SEGMENT_SIZE_DIFF (NFS42_READ_PLUS_HOLE_SEGMENT_SIZE - \
59 NFS42_READ_PLUS_DATA_SEGMENT_SIZE)
60 #define decode_read_plus_maxsz (op_decode_hdr_maxsz + \
62 1 /* rpr_contents count */ + \
63 NFS42_READ_PLUS_HOLE_SEGMENT_SIZE)
64 #define encode_seek_maxsz (op_encode_hdr_maxsz + \
65 encode_stateid_maxsz + \
68 #define decode_seek_maxsz (op_decode_hdr_maxsz + \
73 #define encode_io_info_maxsz 4
74 #define encode_layoutstats_maxsz (op_decode_hdr_maxsz + \
77 encode_stateid_maxsz + \
78 encode_io_info_maxsz + \
79 encode_io_info_maxsz + \
80 1 /* opaque devaddr4 length */ + \
81 XDR_QUADLEN(PNFS_LAYOUTSTATS_MAXSIZE))
82 #define decode_layoutstats_maxsz (op_decode_hdr_maxsz)
83 #define encode_device_error_maxsz (XDR_QUADLEN(NFS4_DEVICEID4_SIZE) + \
84 1 /* status */ + 1 /* opnum */)
85 #define encode_layouterror_maxsz (op_decode_hdr_maxsz + \
88 encode_stateid_maxsz + \
89 1 /* Array size */ + \
90 encode_device_error_maxsz)
91 #define decode_layouterror_maxsz (op_decode_hdr_maxsz)
92 #define encode_clone_maxsz (encode_stateid_maxsz + \
93 encode_stateid_maxsz + \
94 2 /* src offset */ + \
95 2 /* dst offset */ + \
97 #define decode_clone_maxsz (op_decode_hdr_maxsz)
99 #define NFS4_enc_allocate_sz (compound_encode_hdr_maxsz + \
100 encode_sequence_maxsz + \
101 encode_putfh_maxsz + \
102 encode_allocate_maxsz + \
103 encode_getattr_maxsz)
104 #define NFS4_dec_allocate_sz (compound_decode_hdr_maxsz + \
105 decode_sequence_maxsz + \
106 decode_putfh_maxsz + \
107 decode_allocate_maxsz + \
108 decode_getattr_maxsz)
109 #define NFS4_enc_copy_sz (compound_encode_hdr_maxsz + \
110 encode_sequence_maxsz + \
111 encode_putfh_maxsz + \
112 encode_savefh_maxsz + \
113 encode_putfh_maxsz + \
114 encode_copy_maxsz + \
116 #define NFS4_dec_copy_sz (compound_decode_hdr_maxsz + \
117 decode_sequence_maxsz + \
118 decode_putfh_maxsz + \
119 decode_savefh_maxsz + \
120 decode_putfh_maxsz + \
121 decode_copy_maxsz + \
123 #define NFS4_enc_offload_cancel_sz (compound_encode_hdr_maxsz + \
124 encode_sequence_maxsz + \
125 encode_putfh_maxsz + \
126 encode_offload_cancel_maxsz)
127 #define NFS4_dec_offload_cancel_sz (compound_decode_hdr_maxsz + \
128 decode_sequence_maxsz + \
129 decode_putfh_maxsz + \
130 decode_offload_cancel_maxsz)
131 #define NFS4_enc_copy_notify_sz (compound_encode_hdr_maxsz + \
132 encode_putfh_maxsz + \
133 encode_copy_notify_maxsz)
134 #define NFS4_dec_copy_notify_sz (compound_decode_hdr_maxsz + \
135 decode_putfh_maxsz + \
136 decode_copy_notify_maxsz)
137 #define NFS4_enc_deallocate_sz (compound_encode_hdr_maxsz + \
138 encode_sequence_maxsz + \
139 encode_putfh_maxsz + \
140 encode_deallocate_maxsz + \
141 encode_getattr_maxsz)
142 #define NFS4_dec_deallocate_sz (compound_decode_hdr_maxsz + \
143 decode_sequence_maxsz + \
144 decode_putfh_maxsz + \
145 decode_deallocate_maxsz + \
146 decode_getattr_maxsz)
147 #define NFS4_enc_read_plus_sz (compound_encode_hdr_maxsz + \
148 encode_sequence_maxsz + \
149 encode_putfh_maxsz + \
150 encode_read_plus_maxsz)
151 #define NFS4_dec_read_plus_sz (compound_decode_hdr_maxsz + \
152 decode_sequence_maxsz + \
153 decode_putfh_maxsz + \
154 decode_read_plus_maxsz)
155 #define NFS4_enc_seek_sz (compound_encode_hdr_maxsz + \
156 encode_sequence_maxsz + \
157 encode_putfh_maxsz + \
159 #define NFS4_dec_seek_sz (compound_decode_hdr_maxsz + \
160 decode_sequence_maxsz + \
161 decode_putfh_maxsz + \
163 #define NFS4_enc_layoutstats_sz (compound_encode_hdr_maxsz + \
164 encode_sequence_maxsz + \
165 encode_putfh_maxsz + \
166 PNFS_LAYOUTSTATS_MAXDEV * encode_layoutstats_maxsz)
167 #define NFS4_dec_layoutstats_sz (compound_decode_hdr_maxsz + \
168 decode_sequence_maxsz + \
169 decode_putfh_maxsz + \
170 PNFS_LAYOUTSTATS_MAXDEV * decode_layoutstats_maxsz)
171 #define NFS4_enc_layouterror_sz (compound_encode_hdr_maxsz + \
172 encode_sequence_maxsz + \
173 encode_putfh_maxsz + \
174 NFS42_LAYOUTERROR_MAX * \
175 encode_layouterror_maxsz)
176 #define NFS4_dec_layouterror_sz (compound_decode_hdr_maxsz + \
177 decode_sequence_maxsz + \
178 decode_putfh_maxsz + \
179 NFS42_LAYOUTERROR_MAX * \
180 decode_layouterror_maxsz)
181 #define NFS4_enc_clone_sz (compound_encode_hdr_maxsz + \
182 encode_sequence_maxsz + \
183 encode_putfh_maxsz + \
184 encode_savefh_maxsz + \
185 encode_putfh_maxsz + \
186 encode_clone_maxsz + \
187 encode_getattr_maxsz)
188 #define NFS4_dec_clone_sz (compound_decode_hdr_maxsz + \
189 decode_sequence_maxsz + \
190 decode_putfh_maxsz + \
191 decode_savefh_maxsz + \
192 decode_putfh_maxsz + \
193 decode_clone_maxsz + \
194 decode_getattr_maxsz)
196 /* Not limited by NFS itself, limited by the generic xattr code */
197 #define nfs4_xattr_name_maxsz XDR_QUADLEN(XATTR_NAME_MAX)
199 #define encode_getxattr_maxsz (op_encode_hdr_maxsz + 1 + \
200 nfs4_xattr_name_maxsz)
201 #define decode_getxattr_maxsz (op_decode_hdr_maxsz + 1 + pagepad_maxsz)
202 #define encode_setxattr_maxsz (op_encode_hdr_maxsz + \
203 1 + nfs4_xattr_name_maxsz + 1)
204 #define decode_setxattr_maxsz (op_decode_hdr_maxsz + decode_change_info_maxsz)
205 #define encode_listxattrs_maxsz (op_encode_hdr_maxsz + 2 + 1)
206 #define decode_listxattrs_maxsz (op_decode_hdr_maxsz + 2 + 1 + 1 + 1)
207 #define encode_removexattr_maxsz (op_encode_hdr_maxsz + 1 + \
208 nfs4_xattr_name_maxsz)
209 #define decode_removexattr_maxsz (op_decode_hdr_maxsz + \
210 decode_change_info_maxsz)
212 #define NFS4_enc_getxattr_sz (compound_encode_hdr_maxsz + \
213 encode_sequence_maxsz + \
214 encode_putfh_maxsz + \
215 encode_getxattr_maxsz)
216 #define NFS4_dec_getxattr_sz (compound_decode_hdr_maxsz + \
217 decode_sequence_maxsz + \
218 decode_putfh_maxsz + \
219 decode_getxattr_maxsz)
220 #define NFS4_enc_setxattr_sz (compound_encode_hdr_maxsz + \
221 encode_sequence_maxsz + \
222 encode_putfh_maxsz + \
223 encode_setxattr_maxsz)
224 #define NFS4_dec_setxattr_sz (compound_decode_hdr_maxsz + \
225 decode_sequence_maxsz + \
226 decode_putfh_maxsz + \
227 decode_setxattr_maxsz)
228 #define NFS4_enc_listxattrs_sz (compound_encode_hdr_maxsz + \
229 encode_sequence_maxsz + \
230 encode_putfh_maxsz + \
231 encode_listxattrs_maxsz)
232 #define NFS4_dec_listxattrs_sz (compound_decode_hdr_maxsz + \
233 decode_sequence_maxsz + \
234 decode_putfh_maxsz + \
235 decode_listxattrs_maxsz)
236 #define NFS4_enc_removexattr_sz (compound_encode_hdr_maxsz + \
237 encode_sequence_maxsz + \
238 encode_putfh_maxsz + \
239 encode_removexattr_maxsz)
240 #define NFS4_dec_removexattr_sz (compound_decode_hdr_maxsz + \
241 decode_sequence_maxsz + \
242 decode_putfh_maxsz + \
243 decode_removexattr_maxsz)
246 * These values specify the maximum amount of data that is not
247 * associated with the extended attribute name or extended
248 * attribute list in the SETXATTR, GETXATTR and LISTXATTR
251 const u32 nfs42_maxsetxattr_overhead = ((RPC_MAX_HEADER_WITH_AUTH +
252 compound_encode_hdr_maxsz +
253 encode_sequence_maxsz +
254 encode_putfh_maxsz + 1 +
255 nfs4_xattr_name_maxsz)
258 const u32 nfs42_maxgetxattr_overhead = ((RPC_MAX_HEADER_WITH_AUTH +
259 compound_decode_hdr_maxsz +
260 decode_sequence_maxsz +
261 decode_putfh_maxsz + 1) * XDR_UNIT);
263 const u32 nfs42_maxlistxattrs_overhead = ((RPC_MAX_HEADER_WITH_AUTH +
264 compound_decode_hdr_maxsz +
265 decode_sequence_maxsz +
266 decode_putfh_maxsz + 3) * XDR_UNIT);
268 static void encode_fallocate(struct xdr_stream *xdr,
269 const struct nfs42_falloc_args *args)
271 encode_nfs4_stateid(xdr, &args->falloc_stateid);
272 encode_uint64(xdr, args->falloc_offset);
273 encode_uint64(xdr, args->falloc_length);
276 static void encode_allocate(struct xdr_stream *xdr,
277 const struct nfs42_falloc_args *args,
278 struct compound_hdr *hdr)
280 encode_op_hdr(xdr, OP_ALLOCATE, decode_allocate_maxsz, hdr);
281 encode_fallocate(xdr, args);
284 static void encode_nl4_server(struct xdr_stream *xdr,
285 const struct nl4_server *ns)
287 encode_uint32(xdr, ns->nl4_type);
288 switch (ns->nl4_type) {
291 encode_string(xdr, ns->u.nl4_str_sz, ns->u.nl4_str);
294 encode_string(xdr, ns->u.nl4_addr.netid_len,
295 ns->u.nl4_addr.netid);
296 encode_string(xdr, ns->u.nl4_addr.addr_len,
297 ns->u.nl4_addr.addr);
304 static void encode_copy(struct xdr_stream *xdr,
305 const struct nfs42_copy_args *args,
306 struct compound_hdr *hdr)
308 encode_op_hdr(xdr, OP_COPY, decode_copy_maxsz, hdr);
309 encode_nfs4_stateid(xdr, &args->src_stateid);
310 encode_nfs4_stateid(xdr, &args->dst_stateid);
312 encode_uint64(xdr, args->src_pos);
313 encode_uint64(xdr, args->dst_pos);
314 encode_uint64(xdr, args->count);
316 encode_uint32(xdr, 1); /* consecutive = true */
317 encode_uint32(xdr, args->sync);
318 if (args->cp_src == NULL) { /* intra-ssc */
319 encode_uint32(xdr, 0); /* no src server list */
322 encode_uint32(xdr, 1); /* supporting 1 server */
323 encode_nl4_server(xdr, args->cp_src);
326 static void encode_offload_cancel(struct xdr_stream *xdr,
327 const struct nfs42_offload_status_args *args,
328 struct compound_hdr *hdr)
330 encode_op_hdr(xdr, OP_OFFLOAD_CANCEL, decode_offload_cancel_maxsz, hdr);
331 encode_nfs4_stateid(xdr, &args->osa_stateid);
334 static void encode_copy_notify(struct xdr_stream *xdr,
335 const struct nfs42_copy_notify_args *args,
336 struct compound_hdr *hdr)
338 encode_op_hdr(xdr, OP_COPY_NOTIFY, decode_copy_notify_maxsz, hdr);
339 encode_nfs4_stateid(xdr, &args->cna_src_stateid);
340 encode_nl4_server(xdr, &args->cna_dst);
343 static void encode_deallocate(struct xdr_stream *xdr,
344 const struct nfs42_falloc_args *args,
345 struct compound_hdr *hdr)
347 encode_op_hdr(xdr, OP_DEALLOCATE, decode_deallocate_maxsz, hdr);
348 encode_fallocate(xdr, args);
351 static void encode_read_plus(struct xdr_stream *xdr,
352 const struct nfs_pgio_args *args,
353 struct compound_hdr *hdr)
355 encode_op_hdr(xdr, OP_READ_PLUS, decode_read_plus_maxsz, hdr);
356 encode_nfs4_stateid(xdr, &args->stateid);
357 encode_uint64(xdr, args->offset);
358 encode_uint32(xdr, args->count);
361 static void encode_seek(struct xdr_stream *xdr,
362 const struct nfs42_seek_args *args,
363 struct compound_hdr *hdr)
365 encode_op_hdr(xdr, OP_SEEK, decode_seek_maxsz, hdr);
366 encode_nfs4_stateid(xdr, &args->sa_stateid);
367 encode_uint64(xdr, args->sa_offset);
368 encode_uint32(xdr, args->sa_what);
371 static void encode_layoutstats(struct xdr_stream *xdr,
372 const struct nfs42_layoutstat_args *args,
373 struct nfs42_layoutstat_devinfo *devinfo,
374 struct compound_hdr *hdr)
378 encode_op_hdr(xdr, OP_LAYOUTSTATS, decode_layoutstats_maxsz, hdr);
379 p = reserve_space(xdr, 8 + 8);
380 p = xdr_encode_hyper(p, devinfo->offset);
381 p = xdr_encode_hyper(p, devinfo->length);
382 encode_nfs4_stateid(xdr, &args->stateid);
383 p = reserve_space(xdr, 4*8 + NFS4_DEVICEID4_SIZE + 4);
384 p = xdr_encode_hyper(p, devinfo->read_count);
385 p = xdr_encode_hyper(p, devinfo->read_bytes);
386 p = xdr_encode_hyper(p, devinfo->write_count);
387 p = xdr_encode_hyper(p, devinfo->write_bytes);
388 p = xdr_encode_opaque_fixed(p, devinfo->dev_id.data,
389 NFS4_DEVICEID4_SIZE);
390 /* Encode layoutupdate4 */
391 *p++ = cpu_to_be32(devinfo->layout_type);
392 if (devinfo->ld_private.ops)
393 devinfo->ld_private.ops->encode(xdr, args,
394 &devinfo->ld_private);
396 encode_uint32(xdr, 0);
399 static void encode_clone(struct xdr_stream *xdr,
400 const struct nfs42_clone_args *args,
401 struct compound_hdr *hdr)
405 encode_op_hdr(xdr, OP_CLONE, decode_clone_maxsz, hdr);
406 encode_nfs4_stateid(xdr, &args->src_stateid);
407 encode_nfs4_stateid(xdr, &args->dst_stateid);
408 p = reserve_space(xdr, 3*8);
409 p = xdr_encode_hyper(p, args->src_offset);
410 p = xdr_encode_hyper(p, args->dst_offset);
411 xdr_encode_hyper(p, args->count);
414 static void encode_device_error(struct xdr_stream *xdr,
415 const struct nfs42_device_error *error)
419 p = reserve_space(xdr, NFS4_DEVICEID4_SIZE + 2*4);
420 p = xdr_encode_opaque_fixed(p, error->dev_id.data,
421 NFS4_DEVICEID4_SIZE);
422 *p++ = cpu_to_be32(error->status);
423 *p = cpu_to_be32(error->opnum);
426 static void encode_layouterror(struct xdr_stream *xdr,
427 const struct nfs42_layout_error *args,
428 struct compound_hdr *hdr)
432 encode_op_hdr(xdr, OP_LAYOUTERROR, decode_layouterror_maxsz, hdr);
433 p = reserve_space(xdr, 8 + 8);
434 p = xdr_encode_hyper(p, args->offset);
435 p = xdr_encode_hyper(p, args->length);
436 encode_nfs4_stateid(xdr, &args->stateid);
437 p = reserve_space(xdr, 4);
439 encode_device_error(xdr, &args->errors[0]);
442 static void encode_setxattr(struct xdr_stream *xdr,
443 const struct nfs42_setxattrargs *arg,
444 struct compound_hdr *hdr)
448 BUILD_BUG_ON(XATTR_CREATE != SETXATTR4_CREATE);
449 BUILD_BUG_ON(XATTR_REPLACE != SETXATTR4_REPLACE);
451 encode_op_hdr(xdr, OP_SETXATTR, decode_setxattr_maxsz, hdr);
452 p = reserve_space(xdr, 4);
453 *p = cpu_to_be32(arg->xattr_flags);
454 encode_string(xdr, strlen(arg->xattr_name), arg->xattr_name);
455 p = reserve_space(xdr, 4);
456 *p = cpu_to_be32(arg->xattr_len);
458 xdr_write_pages(xdr, arg->xattr_pages, 0, arg->xattr_len);
461 static int decode_setxattr(struct xdr_stream *xdr,
462 struct nfs4_change_info *cinfo)
466 status = decode_op_hdr(xdr, OP_SETXATTR);
469 status = decode_change_info(xdr, cinfo);
475 static void encode_getxattr(struct xdr_stream *xdr, const char *name,
476 struct compound_hdr *hdr)
478 encode_op_hdr(xdr, OP_GETXATTR, decode_getxattr_maxsz, hdr);
479 encode_string(xdr, strlen(name), name);
482 static int decode_getxattr(struct xdr_stream *xdr,
483 struct nfs42_getxattrres *res,
484 struct rpc_rqst *req)
490 status = decode_op_hdr(xdr, OP_GETXATTR);
494 p = xdr_inline_decode(xdr, 4);
498 len = be32_to_cpup(p);
501 * Only check against the page length here. The actual
502 * requested length may be smaller, but that is only
503 * checked against after possibly caching a valid reply.
505 if (len > req->rq_rcv_buf.page_len)
508 res->xattr_len = len;
511 rdlen = xdr_read_pages(xdr, len);
519 static void encode_removexattr(struct xdr_stream *xdr, const char *name,
520 struct compound_hdr *hdr)
522 encode_op_hdr(xdr, OP_REMOVEXATTR, decode_removexattr_maxsz, hdr);
523 encode_string(xdr, strlen(name), name);
527 static int decode_removexattr(struct xdr_stream *xdr,
528 struct nfs4_change_info *cinfo)
532 status = decode_op_hdr(xdr, OP_REMOVEXATTR);
536 status = decode_change_info(xdr, cinfo);
541 static void encode_listxattrs(struct xdr_stream *xdr,
542 const struct nfs42_listxattrsargs *arg,
543 struct compound_hdr *hdr)
547 encode_op_hdr(xdr, OP_LISTXATTRS, decode_listxattrs_maxsz, hdr);
549 p = reserve_space(xdr, 12);
553 p = xdr_encode_hyper(p, arg->cookie);
555 * RFC 8276 says to specify the full max length of the LISTXATTRS
556 * XDR reply. Count is set to the XDR length of the names array
557 * plus the EOF marker. So, add the cookie and the names count.
559 *p = cpu_to_be32(arg->count + 8 + 4);
562 static int decode_listxattrs(struct xdr_stream *xdr,
563 struct nfs42_listxattrsres *res)
567 u32 count, len, ulen;
571 status = decode_op_hdr(xdr, OP_LISTXATTRS);
574 * Special case: for LISTXATTRS, NFS4ERR_TOOSMALL
575 * should be translated to ERANGE.
577 if (status == -ETOOSMALL)
580 * Special case: for LISTXATTRS, NFS4ERR_NOXATTR
581 * should be translated to success with zero-length reply.
583 if (status == -ENODATA) {
590 p = xdr_inline_decode(xdr, 8);
594 xdr_decode_hyper(p, &res->cookie);
596 p = xdr_inline_decode(xdr, 4);
600 left = res->xattr_len;
601 buf = res->xattr_buf;
603 count = be32_to_cpup(p);
607 * We have asked for enough room to encode the maximum number
608 * of possible attribute names, so everything should fit.
610 * But, don't rely on that assumption. Just decode entries
611 * until they don't fit anymore, just in case the server did
615 p = xdr_inline_decode(xdr, 4);
619 len = be32_to_cpup(p);
620 if (len > (XATTR_NAME_MAX - XATTR_USER_PREFIX_LEN)) {
625 p = xdr_inline_decode(xdr, len);
629 ulen = len + XATTR_USER_PREFIX_LEN + 1;
636 memcpy(buf, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN);
637 memcpy(buf + XATTR_USER_PREFIX_LEN, p, len);
646 p = xdr_inline_decode(xdr, 4);
650 res->eof = be32_to_cpup(p);
651 res->copied = copied;
654 if (status == -ERANGE && res->xattr_len == XATTR_LIST_MAX)
661 * Encode ALLOCATE request
663 static void nfs4_xdr_enc_allocate(struct rpc_rqst *req,
664 struct xdr_stream *xdr,
667 const struct nfs42_falloc_args *args = data;
668 struct compound_hdr hdr = {
669 .minorversion = nfs4_xdr_minorversion(&args->seq_args),
672 encode_compound_hdr(xdr, req, &hdr);
673 encode_sequence(xdr, &args->seq_args, &hdr);
674 encode_putfh(xdr, args->falloc_fh, &hdr);
675 encode_allocate(xdr, args, &hdr);
676 encode_getfattr(xdr, args->falloc_bitmask, &hdr);
680 static void encode_copy_commit(struct xdr_stream *xdr,
681 const struct nfs42_copy_args *args,
682 struct compound_hdr *hdr)
686 encode_op_hdr(xdr, OP_COMMIT, decode_commit_maxsz, hdr);
687 p = reserve_space(xdr, 12);
688 p = xdr_encode_hyper(p, args->dst_pos);
689 *p = cpu_to_be32(args->count);
693 * Encode COPY request
695 static void nfs4_xdr_enc_copy(struct rpc_rqst *req,
696 struct xdr_stream *xdr,
699 const struct nfs42_copy_args *args = data;
700 struct compound_hdr hdr = {
701 .minorversion = nfs4_xdr_minorversion(&args->seq_args),
704 encode_compound_hdr(xdr, req, &hdr);
705 encode_sequence(xdr, &args->seq_args, &hdr);
706 encode_putfh(xdr, args->src_fh, &hdr);
707 encode_savefh(xdr, &hdr);
708 encode_putfh(xdr, args->dst_fh, &hdr);
709 encode_copy(xdr, args, &hdr);
711 encode_copy_commit(xdr, args, &hdr);
716 * Encode OFFLOAD_CANEL request
718 static void nfs4_xdr_enc_offload_cancel(struct rpc_rqst *req,
719 struct xdr_stream *xdr,
722 const struct nfs42_offload_status_args *args = data;
723 struct compound_hdr hdr = {
724 .minorversion = nfs4_xdr_minorversion(&args->osa_seq_args),
727 encode_compound_hdr(xdr, req, &hdr);
728 encode_sequence(xdr, &args->osa_seq_args, &hdr);
729 encode_putfh(xdr, args->osa_src_fh, &hdr);
730 encode_offload_cancel(xdr, args, &hdr);
735 * Encode COPY_NOTIFY request
737 static void nfs4_xdr_enc_copy_notify(struct rpc_rqst *req,
738 struct xdr_stream *xdr,
741 const struct nfs42_copy_notify_args *args = data;
742 struct compound_hdr hdr = {
743 .minorversion = nfs4_xdr_minorversion(&args->cna_seq_args),
746 encode_compound_hdr(xdr, req, &hdr);
747 encode_sequence(xdr, &args->cna_seq_args, &hdr);
748 encode_putfh(xdr, args->cna_src_fh, &hdr);
749 encode_copy_notify(xdr, args, &hdr);
754 * Encode DEALLOCATE request
756 static void nfs4_xdr_enc_deallocate(struct rpc_rqst *req,
757 struct xdr_stream *xdr,
760 const struct nfs42_falloc_args *args = data;
761 struct compound_hdr hdr = {
762 .minorversion = nfs4_xdr_minorversion(&args->seq_args),
765 encode_compound_hdr(xdr, req, &hdr);
766 encode_sequence(xdr, &args->seq_args, &hdr);
767 encode_putfh(xdr, args->falloc_fh, &hdr);
768 encode_deallocate(xdr, args, &hdr);
769 encode_getfattr(xdr, args->falloc_bitmask, &hdr);
774 * Encode READ_PLUS request
776 static void nfs4_xdr_enc_read_plus(struct rpc_rqst *req,
777 struct xdr_stream *xdr,
780 const struct nfs_pgio_args *args = data;
781 struct compound_hdr hdr = {
782 .minorversion = nfs4_xdr_minorversion(&args->seq_args),
785 encode_compound_hdr(xdr, req, &hdr);
786 encode_sequence(xdr, &args->seq_args, &hdr);
787 encode_putfh(xdr, args->fh, &hdr);
788 encode_read_plus(xdr, args, &hdr);
790 rpc_prepare_reply_pages(req, args->pages, args->pgbase, args->count,
791 hdr.replen - READ_PLUS_SEGMENT_SIZE_DIFF);
796 * Encode SEEK request
798 static void nfs4_xdr_enc_seek(struct rpc_rqst *req,
799 struct xdr_stream *xdr,
802 const struct nfs42_seek_args *args = data;
803 struct compound_hdr hdr = {
804 .minorversion = nfs4_xdr_minorversion(&args->seq_args),
807 encode_compound_hdr(xdr, req, &hdr);
808 encode_sequence(xdr, &args->seq_args, &hdr);
809 encode_putfh(xdr, args->sa_fh, &hdr);
810 encode_seek(xdr, args, &hdr);
815 * Encode LAYOUTSTATS request
817 static void nfs4_xdr_enc_layoutstats(struct rpc_rqst *req,
818 struct xdr_stream *xdr,
821 const struct nfs42_layoutstat_args *args = data;
824 struct compound_hdr hdr = {
825 .minorversion = nfs4_xdr_minorversion(&args->seq_args),
828 encode_compound_hdr(xdr, req, &hdr);
829 encode_sequence(xdr, &args->seq_args, &hdr);
830 encode_putfh(xdr, args->fh, &hdr);
831 WARN_ON(args->num_dev > PNFS_LAYOUTSTATS_MAXDEV);
832 for (i = 0; i < args->num_dev; i++)
833 encode_layoutstats(xdr, args, &args->devinfo[i], &hdr);
838 * Encode CLONE request
840 static void nfs4_xdr_enc_clone(struct rpc_rqst *req,
841 struct xdr_stream *xdr,
844 const struct nfs42_clone_args *args = data;
845 struct compound_hdr hdr = {
846 .minorversion = nfs4_xdr_minorversion(&args->seq_args),
849 encode_compound_hdr(xdr, req, &hdr);
850 encode_sequence(xdr, &args->seq_args, &hdr);
851 encode_putfh(xdr, args->src_fh, &hdr);
852 encode_savefh(xdr, &hdr);
853 encode_putfh(xdr, args->dst_fh, &hdr);
854 encode_clone(xdr, args, &hdr);
855 encode_getfattr(xdr, args->dst_bitmask, &hdr);
860 * Encode LAYOUTERROR request
862 static void nfs4_xdr_enc_layouterror(struct rpc_rqst *req,
863 struct xdr_stream *xdr,
866 const struct nfs42_layouterror_args *args = data;
867 struct compound_hdr hdr = {
868 .minorversion = nfs4_xdr_minorversion(&args->seq_args),
872 encode_compound_hdr(xdr, req, &hdr);
873 encode_sequence(xdr, &args->seq_args, &hdr);
874 encode_putfh(xdr, NFS_FH(args->inode), &hdr);
875 for (i = 0; i < args->num_errors; i++)
876 encode_layouterror(xdr, &args->errors[i], &hdr);
880 static int decode_allocate(struct xdr_stream *xdr, struct nfs42_falloc_res *res)
882 return decode_op_hdr(xdr, OP_ALLOCATE);
885 static int decode_write_response(struct xdr_stream *xdr,
886 struct nfs42_write_res *res)
891 p = xdr_inline_decode(xdr, 4);
894 count = be32_to_cpup(p);
897 else if (count == 1) {
898 status = decode_opaque_fixed(xdr, &res->stateid,
900 if (unlikely(status))
903 p = xdr_inline_decode(xdr, 8 + 4);
906 p = xdr_decode_hyper(p, &res->count);
907 res->verifier.committed = be32_to_cpup(p);
908 return decode_verifier(xdr, &res->verifier.verifier);
911 static int decode_nl4_server(struct xdr_stream *xdr, struct nl4_server *ns)
913 struct nfs42_netaddr *naddr;
920 p = xdr_inline_decode(xdr, 4);
923 ns->nl4_type = be32_to_cpup(p);
924 switch (ns->nl4_type) {
927 status = decode_opaque_inline(xdr, &dummy, &dummy_str);
928 if (unlikely(status))
930 if (unlikely(dummy > NFS4_OPAQUE_LIMIT))
932 memcpy(&ns->u.nl4_str, dummy_str, dummy);
933 ns->u.nl4_str_sz = dummy;
936 naddr = &ns->u.nl4_addr;
939 status = decode_opaque_inline(xdr, &dummy, &dummy_str);
940 if (unlikely(status))
942 if (unlikely(dummy > RPCBIND_MAXNETIDLEN))
944 naddr->netid_len = dummy;
945 memcpy(naddr->netid, dummy_str, naddr->netid_len);
948 status = decode_opaque_inline(xdr, &dummy, &dummy_str);
949 if (unlikely(status))
951 if (unlikely(dummy > RPCBIND_MAXUADDRLEN))
953 naddr->addr_len = dummy;
954 memcpy(naddr->addr, dummy_str, naddr->addr_len);
963 static int decode_copy_requirements(struct xdr_stream *xdr,
964 struct nfs42_copy_res *res) {
967 p = xdr_inline_decode(xdr, 4 + 4);
971 res->consecutive = be32_to_cpup(p++);
972 res->synchronous = be32_to_cpup(p++);
976 static int decode_copy(struct xdr_stream *xdr, struct nfs42_copy_res *res)
980 status = decode_op_hdr(xdr, OP_COPY);
981 if (status == NFS4ERR_OFFLOAD_NO_REQS) {
982 status = decode_copy_requirements(xdr, res);
985 return NFS4ERR_OFFLOAD_NO_REQS;
989 status = decode_write_response(xdr, &res->write_res);
993 return decode_copy_requirements(xdr, res);
996 static int decode_offload_cancel(struct xdr_stream *xdr,
997 struct nfs42_offload_status_res *res)
999 return decode_op_hdr(xdr, OP_OFFLOAD_CANCEL);
1002 static int decode_copy_notify(struct xdr_stream *xdr,
1003 struct nfs42_copy_notify_res *res)
1008 status = decode_op_hdr(xdr, OP_COPY_NOTIFY);
1011 /* cnr_lease_time */
1012 p = xdr_inline_decode(xdr, 12);
1015 p = xdr_decode_hyper(p, &res->cnr_lease_time.seconds);
1016 res->cnr_lease_time.nseconds = be32_to_cpup(p);
1018 status = decode_opaque_fixed(xdr, &res->cnr_stateid, NFS4_STATEID_SIZE);
1019 if (unlikely(status))
1022 /* number of source addresses */
1023 p = xdr_inline_decode(xdr, 4);
1027 count = be32_to_cpup(p);
1029 pr_warn("NFS: %s: nsvr %d > Supported. Use first servers\n",
1032 status = decode_nl4_server(xdr, &res->cnr_src);
1033 if (unlikely(status))
1038 static int decode_deallocate(struct xdr_stream *xdr, struct nfs42_falloc_res *res)
1040 return decode_op_hdr(xdr, OP_DEALLOCATE);
1043 struct read_plus_segment {
1044 enum data_content4 type;
1058 static inline uint64_t read_plus_segment_length(struct read_plus_segment *seg)
1060 return seg->type == NFS4_CONTENT_DATA ? seg->data.length : seg->hole.length;
1063 static int decode_read_plus_segment(struct xdr_stream *xdr,
1064 struct read_plus_segment *seg)
1068 p = xdr_inline_decode(xdr, 4);
1071 seg->type = be32_to_cpup(p++);
1073 p = xdr_inline_decode(xdr, seg->type == NFS4_CONTENT_DATA ? 12 : 16);
1076 p = xdr_decode_hyper(p, &seg->offset);
1078 if (seg->type == NFS4_CONTENT_DATA) {
1080 uint32_t len = be32_to_cpup(p);
1082 seg->data.length = len;
1083 seg->data.from = xdr_stream_pos(xdr);
1085 if (!xdr_stream_subsegment(xdr, &buf, xdr_align_size(len)))
1087 } else if (seg->type == NFS4_CONTENT_HOLE) {
1088 xdr_decode_hyper(p, &seg->hole.length);
1094 static int process_read_plus_segment(struct xdr_stream *xdr,
1095 struct nfs_pgio_args *args,
1096 struct nfs_pgio_res *res,
1097 struct read_plus_segment *seg)
1099 unsigned long offset = seg->offset;
1100 unsigned long length = read_plus_segment_length(seg);
1101 unsigned int bufpos;
1103 if (offset + length < args->offset)
1105 else if (offset > args->offset + args->count) {
1108 } else if (offset < args->offset) {
1109 length -= (args->offset - offset);
1110 offset = args->offset;
1111 } else if (offset + length > args->offset + args->count) {
1112 length = (args->offset + args->count) - offset;
1116 bufpos = xdr->buf->head[0].iov_len + (offset - args->offset);
1117 if (seg->type == NFS4_CONTENT_HOLE)
1118 return xdr_stream_zero(xdr, bufpos, length);
1120 return xdr_stream_move_subsegment(xdr, seg->data.from, bufpos, length);
1123 static int decode_read_plus(struct xdr_stream *xdr, struct nfs_pgio_res *res)
1125 struct nfs_pgio_header *hdr =
1126 container_of(res, struct nfs_pgio_header, res);
1127 struct nfs_pgio_args *args = &hdr->args;
1129 struct read_plus_segment *segs;
1133 status = decode_op_hdr(xdr, OP_READ_PLUS);
1137 p = xdr_inline_decode(xdr, 4 + 4);
1142 res->eof = be32_to_cpup(p++);
1143 segments = be32_to_cpup(p++);
1147 segs = kmalloc_array(segments, sizeof(*segs), GFP_KERNEL);
1151 for (i = 0; i < segments; i++) {
1152 status = decode_read_plus_segment(xdr, &segs[i]);
1157 xdr_set_pagelen(xdr, xdr_align_size(args->count));
1158 for (i = segments; i > 0; i--)
1159 res->count += process_read_plus_segment(xdr, args, res, &segs[i-1]);
1167 static int decode_seek(struct xdr_stream *xdr, struct nfs42_seek_res *res)
1172 status = decode_op_hdr(xdr, OP_SEEK);
1176 p = xdr_inline_decode(xdr, 4 + 8);
1180 res->sr_eof = be32_to_cpup(p++);
1181 p = xdr_decode_hyper(p, &res->sr_offset);
1185 static int decode_layoutstats(struct xdr_stream *xdr)
1187 return decode_op_hdr(xdr, OP_LAYOUTSTATS);
1190 static int decode_clone(struct xdr_stream *xdr)
1192 return decode_op_hdr(xdr, OP_CLONE);
1195 static int decode_layouterror(struct xdr_stream *xdr)
1197 return decode_op_hdr(xdr, OP_LAYOUTERROR);
1201 * Decode ALLOCATE request
1203 static int nfs4_xdr_dec_allocate(struct rpc_rqst *rqstp,
1204 struct xdr_stream *xdr,
1207 struct nfs42_falloc_res *res = data;
1208 struct compound_hdr hdr;
1211 status = decode_compound_hdr(xdr, &hdr);
1214 status = decode_sequence(xdr, &res->seq_res, rqstp);
1217 status = decode_putfh(xdr);
1220 status = decode_allocate(xdr, res);
1223 decode_getfattr(xdr, res->falloc_fattr, res->falloc_server);
1229 * Decode COPY response
1231 static int nfs4_xdr_dec_copy(struct rpc_rqst *rqstp,
1232 struct xdr_stream *xdr,
1235 struct nfs42_copy_res *res = data;
1236 struct compound_hdr hdr;
1239 status = decode_compound_hdr(xdr, &hdr);
1242 status = decode_sequence(xdr, &res->seq_res, rqstp);
1245 status = decode_putfh(xdr);
1248 status = decode_savefh(xdr);
1251 status = decode_putfh(xdr);
1254 status = decode_copy(xdr, res);
1257 if (res->commit_res.verf)
1258 status = decode_commit(xdr, &res->commit_res);
1264 * Decode OFFLOAD_CANCEL response
1266 static int nfs4_xdr_dec_offload_cancel(struct rpc_rqst *rqstp,
1267 struct xdr_stream *xdr,
1270 struct nfs42_offload_status_res *res = data;
1271 struct compound_hdr hdr;
1274 status = decode_compound_hdr(xdr, &hdr);
1277 status = decode_sequence(xdr, &res->osr_seq_res, rqstp);
1280 status = decode_putfh(xdr);
1283 status = decode_offload_cancel(xdr, res);
1290 * Decode COPY_NOTIFY response
1292 static int nfs4_xdr_dec_copy_notify(struct rpc_rqst *rqstp,
1293 struct xdr_stream *xdr,
1296 struct nfs42_copy_notify_res *res = data;
1297 struct compound_hdr hdr;
1300 status = decode_compound_hdr(xdr, &hdr);
1303 status = decode_sequence(xdr, &res->cnr_seq_res, rqstp);
1306 status = decode_putfh(xdr);
1309 status = decode_copy_notify(xdr, res);
1316 * Decode DEALLOCATE request
1318 static int nfs4_xdr_dec_deallocate(struct rpc_rqst *rqstp,
1319 struct xdr_stream *xdr,
1322 struct nfs42_falloc_res *res = data;
1323 struct compound_hdr hdr;
1326 status = decode_compound_hdr(xdr, &hdr);
1329 status = decode_sequence(xdr, &res->seq_res, rqstp);
1332 status = decode_putfh(xdr);
1335 status = decode_deallocate(xdr, res);
1338 decode_getfattr(xdr, res->falloc_fattr, res->falloc_server);
1344 * Decode READ_PLUS request
1346 static int nfs4_xdr_dec_read_plus(struct rpc_rqst *rqstp,
1347 struct xdr_stream *xdr,
1350 struct nfs_pgio_res *res = data;
1351 struct compound_hdr hdr;
1354 xdr_set_scratch_buffer(xdr, res->scratch, READ_PLUS_SCRATCH_SIZE);
1356 status = decode_compound_hdr(xdr, &hdr);
1359 status = decode_sequence(xdr, &res->seq_res, rqstp);
1362 status = decode_putfh(xdr);
1365 status = decode_read_plus(xdr, res);
1367 status = res->count;
1373 * Decode SEEK request
1375 static int nfs4_xdr_dec_seek(struct rpc_rqst *rqstp,
1376 struct xdr_stream *xdr,
1379 struct nfs42_seek_res *res = data;
1380 struct compound_hdr hdr;
1383 status = decode_compound_hdr(xdr, &hdr);
1386 status = decode_sequence(xdr, &res->seq_res, rqstp);
1389 status = decode_putfh(xdr);
1392 status = decode_seek(xdr, res);
1398 * Decode LAYOUTSTATS request
1400 static int nfs4_xdr_dec_layoutstats(struct rpc_rqst *rqstp,
1401 struct xdr_stream *xdr,
1404 struct nfs42_layoutstat_res *res = data;
1405 struct compound_hdr hdr;
1408 status = decode_compound_hdr(xdr, &hdr);
1411 status = decode_sequence(xdr, &res->seq_res, rqstp);
1414 status = decode_putfh(xdr);
1417 WARN_ON(res->num_dev > PNFS_LAYOUTSTATS_MAXDEV);
1418 for (i = 0; i < res->num_dev; i++) {
1419 status = decode_layoutstats(xdr);
1424 res->rpc_status = status;
1429 * Decode CLONE request
1431 static int nfs4_xdr_dec_clone(struct rpc_rqst *rqstp,
1432 struct xdr_stream *xdr,
1435 struct nfs42_clone_res *res = data;
1436 struct compound_hdr hdr;
1439 status = decode_compound_hdr(xdr, &hdr);
1442 status = decode_sequence(xdr, &res->seq_res, rqstp);
1445 status = decode_putfh(xdr);
1448 status = decode_savefh(xdr);
1451 status = decode_putfh(xdr);
1454 status = decode_clone(xdr);
1457 decode_getfattr(xdr, res->dst_fattr, res->server);
1459 res->rpc_status = status;
1464 * Decode LAYOUTERROR request
1466 static int nfs4_xdr_dec_layouterror(struct rpc_rqst *rqstp,
1467 struct xdr_stream *xdr,
1470 struct nfs42_layouterror_res *res = data;
1471 struct compound_hdr hdr;
1474 status = decode_compound_hdr(xdr, &hdr);
1477 status = decode_sequence(xdr, &res->seq_res, rqstp);
1480 status = decode_putfh(xdr);
1482 for (i = 0; i < res->num_errors && status == 0; i++)
1483 status = decode_layouterror(xdr);
1485 res->rpc_status = status;
1489 #ifdef CONFIG_NFS_V4_2
1490 static void nfs4_xdr_enc_setxattr(struct rpc_rqst *req, struct xdr_stream *xdr,
1493 const struct nfs42_setxattrargs *args = data;
1494 struct compound_hdr hdr = {
1495 .minorversion = nfs4_xdr_minorversion(&args->seq_args),
1498 encode_compound_hdr(xdr, req, &hdr);
1499 encode_sequence(xdr, &args->seq_args, &hdr);
1500 encode_putfh(xdr, args->fh, &hdr);
1501 encode_setxattr(xdr, args, &hdr);
1505 static int nfs4_xdr_dec_setxattr(struct rpc_rqst *req, struct xdr_stream *xdr,
1508 struct nfs42_setxattrres *res = data;
1509 struct compound_hdr hdr;
1512 status = decode_compound_hdr(xdr, &hdr);
1515 status = decode_sequence(xdr, &res->seq_res, req);
1518 status = decode_putfh(xdr);
1522 status = decode_setxattr(xdr, &res->cinfo);
1527 static void nfs4_xdr_enc_getxattr(struct rpc_rqst *req, struct xdr_stream *xdr,
1530 const struct nfs42_getxattrargs *args = data;
1531 struct compound_hdr hdr = {
1532 .minorversion = nfs4_xdr_minorversion(&args->seq_args),
1536 encode_compound_hdr(xdr, req, &hdr);
1537 encode_sequence(xdr, &args->seq_args, &hdr);
1538 encode_putfh(xdr, args->fh, &hdr);
1539 replen = hdr.replen + op_decode_hdr_maxsz + 1;
1540 encode_getxattr(xdr, args->xattr_name, &hdr);
1542 rpc_prepare_reply_pages(req, args->xattr_pages, 0, args->xattr_len,
1548 static int nfs4_xdr_dec_getxattr(struct rpc_rqst *rqstp,
1549 struct xdr_stream *xdr, void *data)
1551 struct nfs42_getxattrres *res = data;
1552 struct compound_hdr hdr;
1555 status = decode_compound_hdr(xdr, &hdr);
1558 status = decode_sequence(xdr, &res->seq_res, rqstp);
1561 status = decode_putfh(xdr);
1564 status = decode_getxattr(xdr, res, rqstp);
1569 static void nfs4_xdr_enc_listxattrs(struct rpc_rqst *req,
1570 struct xdr_stream *xdr, const void *data)
1572 const struct nfs42_listxattrsargs *args = data;
1573 struct compound_hdr hdr = {
1574 .minorversion = nfs4_xdr_minorversion(&args->seq_args),
1578 encode_compound_hdr(xdr, req, &hdr);
1579 encode_sequence(xdr, &args->seq_args, &hdr);
1580 encode_putfh(xdr, args->fh, &hdr);
1581 replen = hdr.replen + op_decode_hdr_maxsz + 2 + 1;
1582 encode_listxattrs(xdr, args, &hdr);
1584 rpc_prepare_reply_pages(req, args->xattr_pages, 0, args->count, replen);
1589 static int nfs4_xdr_dec_listxattrs(struct rpc_rqst *rqstp,
1590 struct xdr_stream *xdr, void *data)
1592 struct nfs42_listxattrsres *res = data;
1593 struct compound_hdr hdr;
1596 xdr_set_scratch_page(xdr, res->scratch);
1598 status = decode_compound_hdr(xdr, &hdr);
1601 status = decode_sequence(xdr, &res->seq_res, rqstp);
1604 status = decode_putfh(xdr);
1607 status = decode_listxattrs(xdr, res);
1612 static void nfs4_xdr_enc_removexattr(struct rpc_rqst *req,
1613 struct xdr_stream *xdr, const void *data)
1615 const struct nfs42_removexattrargs *args = data;
1616 struct compound_hdr hdr = {
1617 .minorversion = nfs4_xdr_minorversion(&args->seq_args),
1620 encode_compound_hdr(xdr, req, &hdr);
1621 encode_sequence(xdr, &args->seq_args, &hdr);
1622 encode_putfh(xdr, args->fh, &hdr);
1623 encode_removexattr(xdr, args->xattr_name, &hdr);
1627 static int nfs4_xdr_dec_removexattr(struct rpc_rqst *req,
1628 struct xdr_stream *xdr, void *data)
1630 struct nfs42_removexattrres *res = data;
1631 struct compound_hdr hdr;
1634 status = decode_compound_hdr(xdr, &hdr);
1637 status = decode_sequence(xdr, &res->seq_res, req);
1640 status = decode_putfh(xdr);
1644 status = decode_removexattr(xdr, &res->cinfo);
1649 #endif /* __LINUX_FS_NFS_NFS4_2XDR_H */