Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Anna Schumaker | 1c6dcbe | 2014-09-26 13:58:48 -0400 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2014 Anna Schumaker <Anna.Schumaker@Netapp.com> |
| 4 | */ |
| 5 | #ifndef __LINUX_FS_NFS_NFS4_2XDR_H |
| 6 | #define __LINUX_FS_NFS_NFS4_2XDR_H |
| 7 | |
Trond Myklebust | be3a5d2 | 2015-06-23 19:51:55 +0800 | [diff] [blame] | 8 | #include "nfs42.h" |
| 9 | |
Anna Schumaker | f4ac167 | 2014-11-25 13:18:15 -0500 | [diff] [blame] | 10 | #define encode_fallocate_maxsz (encode_stateid_maxsz + \ |
| 11 | 2 /* offset */ + \ |
| 12 | 2 /* length */) |
Anna Schumaker | 2e72448 | 2013-05-21 16:53:03 -0400 | [diff] [blame] | 13 | #define NFS42_WRITE_RES_SIZE (1 /* wr_callback_id size */ +\ |
| 14 | XDR_QUADLEN(NFS4_STATEID_SIZE) + \ |
| 15 | 2 /* wr_count */ + \ |
| 16 | 1 /* wr_committed */ + \ |
| 17 | XDR_QUADLEN(NFS4_VERIFIER_SIZE)) |
Anna Schumaker | f4ac167 | 2014-11-25 13:18:15 -0500 | [diff] [blame] | 18 | #define encode_allocate_maxsz (op_encode_hdr_maxsz + \ |
| 19 | encode_fallocate_maxsz) |
| 20 | #define decode_allocate_maxsz (op_decode_hdr_maxsz) |
Anna Schumaker | 2e72448 | 2013-05-21 16:53:03 -0400 | [diff] [blame] | 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 | #define decode_copy_maxsz (op_decode_hdr_maxsz + \ |
| 26 | NFS42_WRITE_RES_SIZE + \ |
| 27 | 1 /* cr_consecutive */ + \ |
| 28 | 1 /* cr_synchronous */) |
Olga Kornievskaia | cb95dee | 2018-07-09 15:13:29 -0400 | [diff] [blame] | 29 | #define encode_offload_cancel_maxsz (op_encode_hdr_maxsz + \ |
| 30 | XDR_QUADLEN(NFS4_STATEID_SIZE)) |
| 31 | #define decode_offload_cancel_maxsz (op_decode_hdr_maxsz) |
Anna Schumaker | 624bd5b | 2014-11-25 13:18:16 -0500 | [diff] [blame] | 32 | #define encode_deallocate_maxsz (op_encode_hdr_maxsz + \ |
| 33 | encode_fallocate_maxsz) |
| 34 | #define decode_deallocate_maxsz (op_decode_hdr_maxsz) |
Anna Schumaker | 1c6dcbe | 2014-09-26 13:58:48 -0400 | [diff] [blame] | 35 | #define encode_seek_maxsz (op_encode_hdr_maxsz + \ |
| 36 | encode_stateid_maxsz + \ |
| 37 | 2 /* offset */ + \ |
| 38 | 1 /* whence */) |
| 39 | #define decode_seek_maxsz (op_decode_hdr_maxsz + \ |
| 40 | 1 /* eof */ + \ |
| 41 | 1 /* whence */ + \ |
| 42 | 2 /* offset */ + \ |
| 43 | 2 /* length */) |
Trond Myklebust | be3a5d2 | 2015-06-23 19:51:55 +0800 | [diff] [blame] | 44 | #define encode_io_info_maxsz 4 |
| 45 | #define encode_layoutstats_maxsz (op_decode_hdr_maxsz + \ |
| 46 | 2 /* offset */ + \ |
| 47 | 2 /* length */ + \ |
| 48 | encode_stateid_maxsz + \ |
| 49 | encode_io_info_maxsz + \ |
| 50 | encode_io_info_maxsz + \ |
| 51 | 1 /* opaque devaddr4 length */ + \ |
| 52 | XDR_QUADLEN(PNFS_LAYOUTSTATS_MAXSIZE)) |
| 53 | #define decode_layoutstats_maxsz (op_decode_hdr_maxsz) |
Peng Tao | 3602277 | 2015-09-26 02:24:34 +0800 | [diff] [blame] | 54 | #define encode_clone_maxsz (encode_stateid_maxsz + \ |
| 55 | encode_stateid_maxsz + \ |
| 56 | 2 /* src offset */ + \ |
| 57 | 2 /* dst offset */ + \ |
| 58 | 2 /* count */) |
| 59 | #define decode_clone_maxsz (op_decode_hdr_maxsz) |
Anna Schumaker | 1c6dcbe | 2014-09-26 13:58:48 -0400 | [diff] [blame] | 60 | |
Anna Schumaker | f4ac167 | 2014-11-25 13:18:15 -0500 | [diff] [blame] | 61 | #define NFS4_enc_allocate_sz (compound_encode_hdr_maxsz + \ |
| 62 | encode_putfh_maxsz + \ |
Anna Schumaker | 9a51940 | 2015-03-16 14:06:23 -0400 | [diff] [blame] | 63 | encode_allocate_maxsz + \ |
| 64 | encode_getattr_maxsz) |
Anna Schumaker | f4ac167 | 2014-11-25 13:18:15 -0500 | [diff] [blame] | 65 | #define NFS4_dec_allocate_sz (compound_decode_hdr_maxsz + \ |
| 66 | decode_putfh_maxsz + \ |
Anna Schumaker | 9a51940 | 2015-03-16 14:06:23 -0400 | [diff] [blame] | 67 | decode_allocate_maxsz + \ |
| 68 | decode_getattr_maxsz) |
Anna Schumaker | 2e72448 | 2013-05-21 16:53:03 -0400 | [diff] [blame] | 69 | #define NFS4_enc_copy_sz (compound_encode_hdr_maxsz + \ |
| 70 | encode_putfh_maxsz + \ |
| 71 | encode_savefh_maxsz + \ |
| 72 | encode_putfh_maxsz + \ |
Olga Kornievskaia | e092693 | 2017-05-08 18:02:24 -0400 | [diff] [blame] | 73 | encode_copy_maxsz + \ |
| 74 | encode_commit_maxsz) |
Anna Schumaker | 2e72448 | 2013-05-21 16:53:03 -0400 | [diff] [blame] | 75 | #define NFS4_dec_copy_sz (compound_decode_hdr_maxsz + \ |
| 76 | decode_putfh_maxsz + \ |
| 77 | decode_savefh_maxsz + \ |
| 78 | decode_putfh_maxsz + \ |
Olga Kornievskaia | e092693 | 2017-05-08 18:02:24 -0400 | [diff] [blame] | 79 | decode_copy_maxsz + \ |
| 80 | decode_commit_maxsz) |
Olga Kornievskaia | cb95dee | 2018-07-09 15:13:29 -0400 | [diff] [blame] | 81 | #define NFS4_enc_offload_cancel_sz (compound_encode_hdr_maxsz + \ |
| 82 | encode_putfh_maxsz + \ |
| 83 | encode_offload_cancel_maxsz) |
| 84 | #define NFS4_dec_offload_cancel_sz (compound_decode_hdr_maxsz + \ |
| 85 | decode_putfh_maxsz + \ |
| 86 | decode_offload_cancel_maxsz) |
Anna Schumaker | 624bd5b | 2014-11-25 13:18:16 -0500 | [diff] [blame] | 87 | #define NFS4_enc_deallocate_sz (compound_encode_hdr_maxsz + \ |
| 88 | encode_putfh_maxsz + \ |
Anna Schumaker | 9a51940 | 2015-03-16 14:06:23 -0400 | [diff] [blame] | 89 | encode_deallocate_maxsz + \ |
| 90 | encode_getattr_maxsz) |
Anna Schumaker | 624bd5b | 2014-11-25 13:18:16 -0500 | [diff] [blame] | 91 | #define NFS4_dec_deallocate_sz (compound_decode_hdr_maxsz + \ |
| 92 | decode_putfh_maxsz + \ |
Anna Schumaker | 9a51940 | 2015-03-16 14:06:23 -0400 | [diff] [blame] | 93 | decode_deallocate_maxsz + \ |
| 94 | decode_getattr_maxsz) |
Anna Schumaker | 1c6dcbe | 2014-09-26 13:58:48 -0400 | [diff] [blame] | 95 | #define NFS4_enc_seek_sz (compound_encode_hdr_maxsz + \ |
| 96 | encode_putfh_maxsz + \ |
| 97 | encode_seek_maxsz) |
| 98 | #define NFS4_dec_seek_sz (compound_decode_hdr_maxsz + \ |
| 99 | decode_putfh_maxsz + \ |
| 100 | decode_seek_maxsz) |
Trond Myklebust | be3a5d2 | 2015-06-23 19:51:55 +0800 | [diff] [blame] | 101 | #define NFS4_enc_layoutstats_sz (compound_encode_hdr_maxsz + \ |
| 102 | encode_sequence_maxsz + \ |
| 103 | encode_putfh_maxsz + \ |
| 104 | PNFS_LAYOUTSTATS_MAXDEV * encode_layoutstats_maxsz) |
| 105 | #define NFS4_dec_layoutstats_sz (compound_decode_hdr_maxsz + \ |
| 106 | decode_sequence_maxsz + \ |
| 107 | decode_putfh_maxsz + \ |
| 108 | PNFS_LAYOUTSTATS_MAXDEV * decode_layoutstats_maxsz) |
Peng Tao | 3602277 | 2015-09-26 02:24:34 +0800 | [diff] [blame] | 109 | #define NFS4_enc_clone_sz (compound_encode_hdr_maxsz + \ |
| 110 | encode_sequence_maxsz + \ |
| 111 | encode_putfh_maxsz + \ |
| 112 | encode_savefh_maxsz + \ |
| 113 | encode_putfh_maxsz + \ |
| 114 | encode_clone_maxsz + \ |
| 115 | encode_getattr_maxsz) |
| 116 | #define NFS4_dec_clone_sz (compound_decode_hdr_maxsz + \ |
| 117 | decode_sequence_maxsz + \ |
| 118 | decode_putfh_maxsz + \ |
| 119 | decode_savefh_maxsz + \ |
| 120 | decode_putfh_maxsz + \ |
| 121 | decode_clone_maxsz + \ |
| 122 | decode_getattr_maxsz) |
Anna Schumaker | 1c6dcbe | 2014-09-26 13:58:48 -0400 | [diff] [blame] | 123 | |
Anna Schumaker | f4ac167 | 2014-11-25 13:18:15 -0500 | [diff] [blame] | 124 | static void encode_fallocate(struct xdr_stream *xdr, |
Christoph Hellwig | 0096d39 | 2017-05-08 10:01:49 +0200 | [diff] [blame] | 125 | const struct nfs42_falloc_args *args) |
Anna Schumaker | f4ac167 | 2014-11-25 13:18:15 -0500 | [diff] [blame] | 126 | { |
| 127 | encode_nfs4_stateid(xdr, &args->falloc_stateid); |
| 128 | encode_uint64(xdr, args->falloc_offset); |
| 129 | encode_uint64(xdr, args->falloc_length); |
| 130 | } |
| 131 | |
| 132 | static void encode_allocate(struct xdr_stream *xdr, |
Christoph Hellwig | 0096d39 | 2017-05-08 10:01:49 +0200 | [diff] [blame] | 133 | const struct nfs42_falloc_args *args, |
Anna Schumaker | f4ac167 | 2014-11-25 13:18:15 -0500 | [diff] [blame] | 134 | struct compound_hdr *hdr) |
| 135 | { |
| 136 | encode_op_hdr(xdr, OP_ALLOCATE, decode_allocate_maxsz, hdr); |
| 137 | encode_fallocate(xdr, args); |
| 138 | } |
| 139 | |
Anna Schumaker | 2e72448 | 2013-05-21 16:53:03 -0400 | [diff] [blame] | 140 | static void encode_copy(struct xdr_stream *xdr, |
Christoph Hellwig | 0096d39 | 2017-05-08 10:01:49 +0200 | [diff] [blame] | 141 | const struct nfs42_copy_args *args, |
Anna Schumaker | 2e72448 | 2013-05-21 16:53:03 -0400 | [diff] [blame] | 142 | struct compound_hdr *hdr) |
| 143 | { |
| 144 | encode_op_hdr(xdr, OP_COPY, decode_copy_maxsz, hdr); |
| 145 | encode_nfs4_stateid(xdr, &args->src_stateid); |
| 146 | encode_nfs4_stateid(xdr, &args->dst_stateid); |
| 147 | |
| 148 | encode_uint64(xdr, args->src_pos); |
| 149 | encode_uint64(xdr, args->dst_pos); |
| 150 | encode_uint64(xdr, args->count); |
| 151 | |
| 152 | encode_uint32(xdr, 1); /* consecutive = true */ |
Olga Kornievskaia | 62164f3 | 2018-07-09 15:13:31 -0400 | [diff] [blame] | 153 | encode_uint32(xdr, args->sync); |
Anna Schumaker | 2e72448 | 2013-05-21 16:53:03 -0400 | [diff] [blame] | 154 | encode_uint32(xdr, 0); /* src server list */ |
| 155 | } |
| 156 | |
Olga Kornievskaia | cb95dee | 2018-07-09 15:13:29 -0400 | [diff] [blame] | 157 | static void encode_offload_cancel(struct xdr_stream *xdr, |
| 158 | const struct nfs42_offload_status_args *args, |
| 159 | struct compound_hdr *hdr) |
| 160 | { |
| 161 | encode_op_hdr(xdr, OP_OFFLOAD_CANCEL, decode_offload_cancel_maxsz, hdr); |
| 162 | encode_nfs4_stateid(xdr, &args->osa_stateid); |
| 163 | } |
| 164 | |
Anna Schumaker | 624bd5b | 2014-11-25 13:18:16 -0500 | [diff] [blame] | 165 | static void encode_deallocate(struct xdr_stream *xdr, |
Christoph Hellwig | 0096d39 | 2017-05-08 10:01:49 +0200 | [diff] [blame] | 166 | const struct nfs42_falloc_args *args, |
Anna Schumaker | 624bd5b | 2014-11-25 13:18:16 -0500 | [diff] [blame] | 167 | struct compound_hdr *hdr) |
| 168 | { |
| 169 | encode_op_hdr(xdr, OP_DEALLOCATE, decode_deallocate_maxsz, hdr); |
| 170 | encode_fallocate(xdr, args); |
| 171 | } |
| 172 | |
Anna Schumaker | 1c6dcbe | 2014-09-26 13:58:48 -0400 | [diff] [blame] | 173 | static void encode_seek(struct xdr_stream *xdr, |
Christoph Hellwig | 0096d39 | 2017-05-08 10:01:49 +0200 | [diff] [blame] | 174 | const struct nfs42_seek_args *args, |
Anna Schumaker | 1c6dcbe | 2014-09-26 13:58:48 -0400 | [diff] [blame] | 175 | struct compound_hdr *hdr) |
| 176 | { |
| 177 | encode_op_hdr(xdr, OP_SEEK, decode_seek_maxsz, hdr); |
| 178 | encode_nfs4_stateid(xdr, &args->sa_stateid); |
| 179 | encode_uint64(xdr, args->sa_offset); |
| 180 | encode_uint32(xdr, args->sa_what); |
| 181 | } |
| 182 | |
Trond Myklebust | be3a5d2 | 2015-06-23 19:51:55 +0800 | [diff] [blame] | 183 | static void encode_layoutstats(struct xdr_stream *xdr, |
Christoph Hellwig | 0096d39 | 2017-05-08 10:01:49 +0200 | [diff] [blame] | 184 | const struct nfs42_layoutstat_args *args, |
Trond Myklebust | be3a5d2 | 2015-06-23 19:51:55 +0800 | [diff] [blame] | 185 | struct nfs42_layoutstat_devinfo *devinfo, |
| 186 | struct compound_hdr *hdr) |
| 187 | { |
| 188 | __be32 *p; |
| 189 | |
| 190 | encode_op_hdr(xdr, OP_LAYOUTSTATS, decode_layoutstats_maxsz, hdr); |
| 191 | p = reserve_space(xdr, 8 + 8); |
| 192 | p = xdr_encode_hyper(p, devinfo->offset); |
| 193 | p = xdr_encode_hyper(p, devinfo->length); |
| 194 | encode_nfs4_stateid(xdr, &args->stateid); |
| 195 | p = reserve_space(xdr, 4*8 + NFS4_DEVICEID4_SIZE + 4); |
| 196 | p = xdr_encode_hyper(p, devinfo->read_count); |
| 197 | p = xdr_encode_hyper(p, devinfo->read_bytes); |
| 198 | p = xdr_encode_hyper(p, devinfo->write_count); |
| 199 | p = xdr_encode_hyper(p, devinfo->write_bytes); |
| 200 | p = xdr_encode_opaque_fixed(p, devinfo->dev_id.data, |
| 201 | NFS4_DEVICEID4_SIZE); |
| 202 | /* Encode layoutupdate4 */ |
| 203 | *p++ = cpu_to_be32(devinfo->layout_type); |
Trond Myklebust | 422c93c | 2016-10-06 17:53:20 -0400 | [diff] [blame] | 204 | if (devinfo->ld_private.ops) |
| 205 | devinfo->ld_private.ops->encode(xdr, args, |
| 206 | &devinfo->ld_private); |
Trond Myklebust | be3a5d2 | 2015-06-23 19:51:55 +0800 | [diff] [blame] | 207 | else |
| 208 | encode_uint32(xdr, 0); |
| 209 | } |
| 210 | |
Peng Tao | 3602277 | 2015-09-26 02:24:34 +0800 | [diff] [blame] | 211 | static void encode_clone(struct xdr_stream *xdr, |
Christoph Hellwig | 0096d39 | 2017-05-08 10:01:49 +0200 | [diff] [blame] | 212 | const struct nfs42_clone_args *args, |
Peng Tao | 3602277 | 2015-09-26 02:24:34 +0800 | [diff] [blame] | 213 | struct compound_hdr *hdr) |
| 214 | { |
| 215 | __be32 *p; |
| 216 | |
| 217 | encode_op_hdr(xdr, OP_CLONE, decode_clone_maxsz, hdr); |
| 218 | encode_nfs4_stateid(xdr, &args->src_stateid); |
| 219 | encode_nfs4_stateid(xdr, &args->dst_stateid); |
| 220 | p = reserve_space(xdr, 3*8); |
| 221 | p = xdr_encode_hyper(p, args->src_offset); |
| 222 | p = xdr_encode_hyper(p, args->dst_offset); |
| 223 | xdr_encode_hyper(p, args->count); |
| 224 | } |
| 225 | |
Anna Schumaker | 1c6dcbe | 2014-09-26 13:58:48 -0400 | [diff] [blame] | 226 | /* |
Anna Schumaker | f4ac167 | 2014-11-25 13:18:15 -0500 | [diff] [blame] | 227 | * Encode ALLOCATE request |
| 228 | */ |
| 229 | static void nfs4_xdr_enc_allocate(struct rpc_rqst *req, |
| 230 | struct xdr_stream *xdr, |
Christoph Hellwig | 0096d39 | 2017-05-08 10:01:49 +0200 | [diff] [blame] | 231 | const void *data) |
Anna Schumaker | f4ac167 | 2014-11-25 13:18:15 -0500 | [diff] [blame] | 232 | { |
Christoph Hellwig | 0096d39 | 2017-05-08 10:01:49 +0200 | [diff] [blame] | 233 | const struct nfs42_falloc_args *args = data; |
Anna Schumaker | f4ac167 | 2014-11-25 13:18:15 -0500 | [diff] [blame] | 234 | struct compound_hdr hdr = { |
| 235 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
| 236 | }; |
| 237 | |
| 238 | encode_compound_hdr(xdr, req, &hdr); |
| 239 | encode_sequence(xdr, &args->seq_args, &hdr); |
| 240 | encode_putfh(xdr, args->falloc_fh, &hdr); |
| 241 | encode_allocate(xdr, args, &hdr); |
Anna Schumaker | 9a51940 | 2015-03-16 14:06:23 -0400 | [diff] [blame] | 242 | encode_getfattr(xdr, args->falloc_bitmask, &hdr); |
Anna Schumaker | f4ac167 | 2014-11-25 13:18:15 -0500 | [diff] [blame] | 243 | encode_nops(&hdr); |
| 244 | } |
| 245 | |
Olga Kornievskaia | e092693 | 2017-05-08 18:02:24 -0400 | [diff] [blame] | 246 | static void encode_copy_commit(struct xdr_stream *xdr, |
Christoph Hellwig | 0096d39 | 2017-05-08 10:01:49 +0200 | [diff] [blame] | 247 | const struct nfs42_copy_args *args, |
Olga Kornievskaia | e092693 | 2017-05-08 18:02:24 -0400 | [diff] [blame] | 248 | struct compound_hdr *hdr) |
| 249 | { |
| 250 | __be32 *p; |
| 251 | |
| 252 | encode_op_hdr(xdr, OP_COMMIT, decode_commit_maxsz, hdr); |
| 253 | p = reserve_space(xdr, 12); |
| 254 | p = xdr_encode_hyper(p, args->dst_pos); |
| 255 | *p = cpu_to_be32(args->count); |
| 256 | } |
| 257 | |
Anna Schumaker | f4ac167 | 2014-11-25 13:18:15 -0500 | [diff] [blame] | 258 | /* |
Anna Schumaker | 2e72448 | 2013-05-21 16:53:03 -0400 | [diff] [blame] | 259 | * Encode COPY request |
| 260 | */ |
| 261 | static void nfs4_xdr_enc_copy(struct rpc_rqst *req, |
| 262 | struct xdr_stream *xdr, |
Christoph Hellwig | 0096d39 | 2017-05-08 10:01:49 +0200 | [diff] [blame] | 263 | const void *data) |
Anna Schumaker | 2e72448 | 2013-05-21 16:53:03 -0400 | [diff] [blame] | 264 | { |
Christoph Hellwig | 0096d39 | 2017-05-08 10:01:49 +0200 | [diff] [blame] | 265 | const struct nfs42_copy_args *args = data; |
Anna Schumaker | 2e72448 | 2013-05-21 16:53:03 -0400 | [diff] [blame] | 266 | struct compound_hdr hdr = { |
| 267 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
| 268 | }; |
| 269 | |
| 270 | encode_compound_hdr(xdr, req, &hdr); |
| 271 | encode_sequence(xdr, &args->seq_args, &hdr); |
| 272 | encode_putfh(xdr, args->src_fh, &hdr); |
| 273 | encode_savefh(xdr, &hdr); |
| 274 | encode_putfh(xdr, args->dst_fh, &hdr); |
| 275 | encode_copy(xdr, args, &hdr); |
Olga Kornievskaia | 62164f3 | 2018-07-09 15:13:31 -0400 | [diff] [blame] | 276 | if (args->sync) |
| 277 | encode_copy_commit(xdr, args, &hdr); |
Anna Schumaker | 2e72448 | 2013-05-21 16:53:03 -0400 | [diff] [blame] | 278 | encode_nops(&hdr); |
| 279 | } |
| 280 | |
| 281 | /* |
Olga Kornievskaia | cb95dee | 2018-07-09 15:13:29 -0400 | [diff] [blame] | 282 | * Encode OFFLOAD_CANEL request |
| 283 | */ |
| 284 | static void nfs4_xdr_enc_offload_cancel(struct rpc_rqst *req, |
| 285 | struct xdr_stream *xdr, |
| 286 | const void *data) |
| 287 | { |
| 288 | const struct nfs42_offload_status_args *args = data; |
| 289 | struct compound_hdr hdr = { |
| 290 | .minorversion = nfs4_xdr_minorversion(&args->osa_seq_args), |
| 291 | }; |
| 292 | |
| 293 | encode_compound_hdr(xdr, req, &hdr); |
| 294 | encode_sequence(xdr, &args->osa_seq_args, &hdr); |
| 295 | encode_putfh(xdr, args->osa_src_fh, &hdr); |
| 296 | encode_offload_cancel(xdr, args, &hdr); |
| 297 | encode_nops(&hdr); |
| 298 | } |
| 299 | |
| 300 | /* |
Anna Schumaker | 624bd5b | 2014-11-25 13:18:16 -0500 | [diff] [blame] | 301 | * Encode DEALLOCATE request |
| 302 | */ |
| 303 | static void nfs4_xdr_enc_deallocate(struct rpc_rqst *req, |
| 304 | struct xdr_stream *xdr, |
Christoph Hellwig | 0096d39 | 2017-05-08 10:01:49 +0200 | [diff] [blame] | 305 | const void *data) |
Anna Schumaker | 624bd5b | 2014-11-25 13:18:16 -0500 | [diff] [blame] | 306 | { |
Christoph Hellwig | 0096d39 | 2017-05-08 10:01:49 +0200 | [diff] [blame] | 307 | const struct nfs42_falloc_args *args = data; |
Anna Schumaker | 624bd5b | 2014-11-25 13:18:16 -0500 | [diff] [blame] | 308 | struct compound_hdr hdr = { |
| 309 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
| 310 | }; |
| 311 | |
| 312 | encode_compound_hdr(xdr, req, &hdr); |
| 313 | encode_sequence(xdr, &args->seq_args, &hdr); |
| 314 | encode_putfh(xdr, args->falloc_fh, &hdr); |
| 315 | encode_deallocate(xdr, args, &hdr); |
Anna Schumaker | 9a51940 | 2015-03-16 14:06:23 -0400 | [diff] [blame] | 316 | encode_getfattr(xdr, args->falloc_bitmask, &hdr); |
Anna Schumaker | 624bd5b | 2014-11-25 13:18:16 -0500 | [diff] [blame] | 317 | encode_nops(&hdr); |
| 318 | } |
| 319 | |
| 320 | /* |
Anna Schumaker | 1c6dcbe | 2014-09-26 13:58:48 -0400 | [diff] [blame] | 321 | * Encode SEEK request |
| 322 | */ |
| 323 | static void nfs4_xdr_enc_seek(struct rpc_rqst *req, |
| 324 | struct xdr_stream *xdr, |
Christoph Hellwig | 0096d39 | 2017-05-08 10:01:49 +0200 | [diff] [blame] | 325 | const void *data) |
Anna Schumaker | 1c6dcbe | 2014-09-26 13:58:48 -0400 | [diff] [blame] | 326 | { |
Christoph Hellwig | 0096d39 | 2017-05-08 10:01:49 +0200 | [diff] [blame] | 327 | const struct nfs42_seek_args *args = data; |
Anna Schumaker | 1c6dcbe | 2014-09-26 13:58:48 -0400 | [diff] [blame] | 328 | struct compound_hdr hdr = { |
| 329 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
| 330 | }; |
| 331 | |
| 332 | encode_compound_hdr(xdr, req, &hdr); |
| 333 | encode_sequence(xdr, &args->seq_args, &hdr); |
| 334 | encode_putfh(xdr, args->sa_fh, &hdr); |
| 335 | encode_seek(xdr, args, &hdr); |
| 336 | encode_nops(&hdr); |
| 337 | } |
| 338 | |
Trond Myklebust | be3a5d2 | 2015-06-23 19:51:55 +0800 | [diff] [blame] | 339 | /* |
| 340 | * Encode LAYOUTSTATS request |
| 341 | */ |
| 342 | static void nfs4_xdr_enc_layoutstats(struct rpc_rqst *req, |
| 343 | struct xdr_stream *xdr, |
Christoph Hellwig | 0096d39 | 2017-05-08 10:01:49 +0200 | [diff] [blame] | 344 | const void *data) |
Trond Myklebust | be3a5d2 | 2015-06-23 19:51:55 +0800 | [diff] [blame] | 345 | { |
Christoph Hellwig | 0096d39 | 2017-05-08 10:01:49 +0200 | [diff] [blame] | 346 | const struct nfs42_layoutstat_args *args = data; |
Trond Myklebust | be3a5d2 | 2015-06-23 19:51:55 +0800 | [diff] [blame] | 347 | int i; |
| 348 | |
| 349 | struct compound_hdr hdr = { |
| 350 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
| 351 | }; |
| 352 | |
| 353 | encode_compound_hdr(xdr, req, &hdr); |
| 354 | encode_sequence(xdr, &args->seq_args, &hdr); |
| 355 | encode_putfh(xdr, args->fh, &hdr); |
| 356 | WARN_ON(args->num_dev > PNFS_LAYOUTSTATS_MAXDEV); |
| 357 | for (i = 0; i < args->num_dev; i++) |
| 358 | encode_layoutstats(xdr, args, &args->devinfo[i], &hdr); |
| 359 | encode_nops(&hdr); |
| 360 | } |
| 361 | |
Peng Tao | 3602277 | 2015-09-26 02:24:34 +0800 | [diff] [blame] | 362 | /* |
| 363 | * Encode CLONE request |
| 364 | */ |
| 365 | static void nfs4_xdr_enc_clone(struct rpc_rqst *req, |
| 366 | struct xdr_stream *xdr, |
Christoph Hellwig | 0096d39 | 2017-05-08 10:01:49 +0200 | [diff] [blame] | 367 | const void *data) |
Peng Tao | 3602277 | 2015-09-26 02:24:34 +0800 | [diff] [blame] | 368 | { |
Christoph Hellwig | 0096d39 | 2017-05-08 10:01:49 +0200 | [diff] [blame] | 369 | const struct nfs42_clone_args *args = data; |
Peng Tao | 3602277 | 2015-09-26 02:24:34 +0800 | [diff] [blame] | 370 | struct compound_hdr hdr = { |
| 371 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
| 372 | }; |
| 373 | |
| 374 | encode_compound_hdr(xdr, req, &hdr); |
| 375 | encode_sequence(xdr, &args->seq_args, &hdr); |
| 376 | encode_putfh(xdr, args->src_fh, &hdr); |
| 377 | encode_savefh(xdr, &hdr); |
| 378 | encode_putfh(xdr, args->dst_fh, &hdr); |
| 379 | encode_clone(xdr, args, &hdr); |
| 380 | encode_getfattr(xdr, args->dst_bitmask, &hdr); |
| 381 | encode_nops(&hdr); |
| 382 | } |
| 383 | |
Anna Schumaker | f4ac167 | 2014-11-25 13:18:15 -0500 | [diff] [blame] | 384 | static int decode_allocate(struct xdr_stream *xdr, struct nfs42_falloc_res *res) |
| 385 | { |
| 386 | return decode_op_hdr(xdr, OP_ALLOCATE); |
| 387 | } |
| 388 | |
Anna Schumaker | 2e72448 | 2013-05-21 16:53:03 -0400 | [diff] [blame] | 389 | static int decode_write_response(struct xdr_stream *xdr, |
| 390 | struct nfs42_write_res *res) |
| 391 | { |
| 392 | __be32 *p; |
Olga Kornievskaia | 67aa744 | 2018-07-09 15:13:30 -0400 | [diff] [blame] | 393 | int status, count; |
Anna Schumaker | 2e72448 | 2013-05-21 16:53:03 -0400 | [diff] [blame] | 394 | |
Olga Kornievskaia | 67aa744 | 2018-07-09 15:13:30 -0400 | [diff] [blame] | 395 | p = xdr_inline_decode(xdr, 4); |
Anna Schumaker | 2e72448 | 2013-05-21 16:53:03 -0400 | [diff] [blame] | 396 | if (unlikely(!p)) |
| 397 | goto out_overflow; |
Olga Kornievskaia | 67aa744 | 2018-07-09 15:13:30 -0400 | [diff] [blame] | 398 | count = be32_to_cpup(p); |
| 399 | if (count > 1) |
Trond Myklebust | 6fdf339 | 2016-07-24 17:17:16 -0400 | [diff] [blame] | 400 | return -EREMOTEIO; |
Olga Kornievskaia | 67aa744 | 2018-07-09 15:13:30 -0400 | [diff] [blame] | 401 | else if (count == 1) { |
| 402 | status = decode_opaque_fixed(xdr, &res->stateid, |
| 403 | NFS4_STATEID_SIZE); |
| 404 | if (unlikely(status)) |
| 405 | goto out_overflow; |
Trond Myklebust | 6fdf339 | 2016-07-24 17:17:16 -0400 | [diff] [blame] | 406 | } |
Olga Kornievskaia | 67aa744 | 2018-07-09 15:13:30 -0400 | [diff] [blame] | 407 | p = xdr_inline_decode(xdr, 8 + 4); |
| 408 | if (unlikely(!p)) |
| 409 | goto out_overflow; |
Anna Schumaker | 2e72448 | 2013-05-21 16:53:03 -0400 | [diff] [blame] | 410 | p = xdr_decode_hyper(p, &res->count); |
| 411 | res->verifier.committed = be32_to_cpup(p); |
| 412 | return decode_verifier(xdr, &res->verifier.verifier); |
| 413 | |
| 414 | out_overflow: |
| 415 | print_overflow_msg(__func__, xdr); |
| 416 | return -EIO; |
| 417 | } |
| 418 | |
| 419 | static int decode_copy_requirements(struct xdr_stream *xdr, |
| 420 | struct nfs42_copy_res *res) { |
| 421 | __be32 *p; |
| 422 | |
| 423 | p = xdr_inline_decode(xdr, 4 + 4); |
| 424 | if (unlikely(!p)) |
| 425 | goto out_overflow; |
| 426 | |
| 427 | res->consecutive = be32_to_cpup(p++); |
| 428 | res->synchronous = be32_to_cpup(p++); |
| 429 | return 0; |
| 430 | out_overflow: |
| 431 | print_overflow_msg(__func__, xdr); |
| 432 | return -EIO; |
| 433 | } |
| 434 | |
| 435 | static int decode_copy(struct xdr_stream *xdr, struct nfs42_copy_res *res) |
| 436 | { |
| 437 | int status; |
| 438 | |
| 439 | status = decode_op_hdr(xdr, OP_COPY); |
| 440 | if (status == NFS4ERR_OFFLOAD_NO_REQS) { |
| 441 | status = decode_copy_requirements(xdr, res); |
| 442 | if (status) |
| 443 | return status; |
| 444 | return NFS4ERR_OFFLOAD_NO_REQS; |
| 445 | } else if (status) |
| 446 | return status; |
| 447 | |
| 448 | status = decode_write_response(xdr, &res->write_res); |
| 449 | if (status) |
| 450 | return status; |
| 451 | |
| 452 | return decode_copy_requirements(xdr, res); |
| 453 | } |
| 454 | |
Olga Kornievskaia | cb95dee | 2018-07-09 15:13:29 -0400 | [diff] [blame] | 455 | static int decode_offload_cancel(struct xdr_stream *xdr, |
| 456 | struct nfs42_offload_status_res *res) |
| 457 | { |
| 458 | return decode_op_hdr(xdr, OP_OFFLOAD_CANCEL); |
| 459 | } |
| 460 | |
Anna Schumaker | 624bd5b | 2014-11-25 13:18:16 -0500 | [diff] [blame] | 461 | static int decode_deallocate(struct xdr_stream *xdr, struct nfs42_falloc_res *res) |
| 462 | { |
| 463 | return decode_op_hdr(xdr, OP_DEALLOCATE); |
| 464 | } |
| 465 | |
Anna Schumaker | 1c6dcbe | 2014-09-26 13:58:48 -0400 | [diff] [blame] | 466 | static int decode_seek(struct xdr_stream *xdr, struct nfs42_seek_res *res) |
| 467 | { |
| 468 | int status; |
| 469 | __be32 *p; |
| 470 | |
| 471 | status = decode_op_hdr(xdr, OP_SEEK); |
| 472 | if (status) |
| 473 | return status; |
| 474 | |
| 475 | p = xdr_inline_decode(xdr, 4 + 8); |
| 476 | if (unlikely(!p)) |
| 477 | goto out_overflow; |
| 478 | |
| 479 | res->sr_eof = be32_to_cpup(p++); |
| 480 | p = xdr_decode_hyper(p, &res->sr_offset); |
| 481 | return 0; |
| 482 | |
| 483 | out_overflow: |
| 484 | print_overflow_msg(__func__, xdr); |
| 485 | return -EIO; |
| 486 | } |
| 487 | |
Peng Tao | 19cf633 | 2015-08-26 00:13:15 +0800 | [diff] [blame] | 488 | static int decode_layoutstats(struct xdr_stream *xdr) |
Trond Myklebust | be3a5d2 | 2015-06-23 19:51:55 +0800 | [diff] [blame] | 489 | { |
Trond Myklebust | da2e812 | 2015-06-27 11:30:57 -0400 | [diff] [blame] | 490 | return decode_op_hdr(xdr, OP_LAYOUTSTATS); |
Trond Myklebust | be3a5d2 | 2015-06-23 19:51:55 +0800 | [diff] [blame] | 491 | } |
| 492 | |
Peng Tao | 3602277 | 2015-09-26 02:24:34 +0800 | [diff] [blame] | 493 | static int decode_clone(struct xdr_stream *xdr) |
| 494 | { |
| 495 | return decode_op_hdr(xdr, OP_CLONE); |
| 496 | } |
| 497 | |
Anna Schumaker | 1c6dcbe | 2014-09-26 13:58:48 -0400 | [diff] [blame] | 498 | /* |
Anna Schumaker | f4ac167 | 2014-11-25 13:18:15 -0500 | [diff] [blame] | 499 | * Decode ALLOCATE request |
| 500 | */ |
| 501 | static int nfs4_xdr_dec_allocate(struct rpc_rqst *rqstp, |
| 502 | struct xdr_stream *xdr, |
Christoph Hellwig | 18d9cff | 2017-05-08 15:09:02 +0200 | [diff] [blame] | 503 | void *data) |
Anna Schumaker | f4ac167 | 2014-11-25 13:18:15 -0500 | [diff] [blame] | 504 | { |
Christoph Hellwig | 18d9cff | 2017-05-08 15:09:02 +0200 | [diff] [blame] | 505 | struct nfs42_falloc_res *res = data; |
Anna Schumaker | f4ac167 | 2014-11-25 13:18:15 -0500 | [diff] [blame] | 506 | struct compound_hdr hdr; |
| 507 | int status; |
| 508 | |
| 509 | status = decode_compound_hdr(xdr, &hdr); |
| 510 | if (status) |
| 511 | goto out; |
| 512 | status = decode_sequence(xdr, &res->seq_res, rqstp); |
| 513 | if (status) |
| 514 | goto out; |
| 515 | status = decode_putfh(xdr); |
| 516 | if (status) |
| 517 | goto out; |
| 518 | status = decode_allocate(xdr, res); |
Anna Schumaker | 9a51940 | 2015-03-16 14:06:23 -0400 | [diff] [blame] | 519 | if (status) |
| 520 | goto out; |
| 521 | decode_getfattr(xdr, res->falloc_fattr, res->falloc_server); |
Anna Schumaker | f4ac167 | 2014-11-25 13:18:15 -0500 | [diff] [blame] | 522 | out: |
| 523 | return status; |
| 524 | } |
| 525 | |
| 526 | /* |
Anna Schumaker | 2e72448 | 2013-05-21 16:53:03 -0400 | [diff] [blame] | 527 | * Decode COPY response |
| 528 | */ |
| 529 | static int nfs4_xdr_dec_copy(struct rpc_rqst *rqstp, |
| 530 | struct xdr_stream *xdr, |
Christoph Hellwig | 18d9cff | 2017-05-08 15:09:02 +0200 | [diff] [blame] | 531 | void *data) |
Anna Schumaker | 2e72448 | 2013-05-21 16:53:03 -0400 | [diff] [blame] | 532 | { |
Christoph Hellwig | 18d9cff | 2017-05-08 15:09:02 +0200 | [diff] [blame] | 533 | struct nfs42_copy_res *res = data; |
Anna Schumaker | 2e72448 | 2013-05-21 16:53:03 -0400 | [diff] [blame] | 534 | struct compound_hdr hdr; |
| 535 | int status; |
| 536 | |
| 537 | status = decode_compound_hdr(xdr, &hdr); |
| 538 | if (status) |
| 539 | goto out; |
| 540 | status = decode_sequence(xdr, &res->seq_res, rqstp); |
| 541 | if (status) |
| 542 | goto out; |
| 543 | status = decode_putfh(xdr); |
| 544 | if (status) |
| 545 | goto out; |
| 546 | status = decode_savefh(xdr); |
| 547 | if (status) |
| 548 | goto out; |
| 549 | status = decode_putfh(xdr); |
| 550 | if (status) |
| 551 | goto out; |
| 552 | status = decode_copy(xdr, res); |
Olga Kornievskaia | e092693 | 2017-05-08 18:02:24 -0400 | [diff] [blame] | 553 | if (status) |
| 554 | goto out; |
Olga Kornievskaia | 62164f3 | 2018-07-09 15:13:31 -0400 | [diff] [blame] | 555 | if (res->commit_res.verf) |
| 556 | status = decode_commit(xdr, &res->commit_res); |
Anna Schumaker | 2e72448 | 2013-05-21 16:53:03 -0400 | [diff] [blame] | 557 | out: |
| 558 | return status; |
| 559 | } |
| 560 | |
| 561 | /* |
Olga Kornievskaia | cb95dee | 2018-07-09 15:13:29 -0400 | [diff] [blame] | 562 | * Decode OFFLOAD_CANCEL response |
| 563 | */ |
| 564 | static int nfs4_xdr_dec_offload_cancel(struct rpc_rqst *rqstp, |
| 565 | struct xdr_stream *xdr, |
| 566 | void *data) |
| 567 | { |
| 568 | struct nfs42_offload_status_res *res = data; |
| 569 | struct compound_hdr hdr; |
| 570 | int status; |
| 571 | |
| 572 | status = decode_compound_hdr(xdr, &hdr); |
| 573 | if (status) |
| 574 | goto out; |
| 575 | status = decode_sequence(xdr, &res->osr_seq_res, rqstp); |
| 576 | if (status) |
| 577 | goto out; |
| 578 | status = decode_putfh(xdr); |
| 579 | if (status) |
| 580 | goto out; |
| 581 | status = decode_offload_cancel(xdr, res); |
| 582 | |
| 583 | out: |
| 584 | return status; |
| 585 | } |
| 586 | |
| 587 | /* |
Anna Schumaker | 624bd5b | 2014-11-25 13:18:16 -0500 | [diff] [blame] | 588 | * Decode DEALLOCATE request |
| 589 | */ |
| 590 | static int nfs4_xdr_dec_deallocate(struct rpc_rqst *rqstp, |
| 591 | struct xdr_stream *xdr, |
Christoph Hellwig | 18d9cff | 2017-05-08 15:09:02 +0200 | [diff] [blame] | 592 | void *data) |
Anna Schumaker | 624bd5b | 2014-11-25 13:18:16 -0500 | [diff] [blame] | 593 | { |
Christoph Hellwig | 18d9cff | 2017-05-08 15:09:02 +0200 | [diff] [blame] | 594 | struct nfs42_falloc_res *res = data; |
Anna Schumaker | 624bd5b | 2014-11-25 13:18:16 -0500 | [diff] [blame] | 595 | struct compound_hdr hdr; |
| 596 | int status; |
| 597 | |
| 598 | status = decode_compound_hdr(xdr, &hdr); |
| 599 | if (status) |
| 600 | goto out; |
| 601 | status = decode_sequence(xdr, &res->seq_res, rqstp); |
| 602 | if (status) |
| 603 | goto out; |
| 604 | status = decode_putfh(xdr); |
| 605 | if (status) |
| 606 | goto out; |
| 607 | status = decode_deallocate(xdr, res); |
Anna Schumaker | 9a51940 | 2015-03-16 14:06:23 -0400 | [diff] [blame] | 608 | if (status) |
| 609 | goto out; |
| 610 | decode_getfattr(xdr, res->falloc_fattr, res->falloc_server); |
Anna Schumaker | 624bd5b | 2014-11-25 13:18:16 -0500 | [diff] [blame] | 611 | out: |
| 612 | return status; |
| 613 | } |
| 614 | |
| 615 | /* |
Anna Schumaker | 1c6dcbe | 2014-09-26 13:58:48 -0400 | [diff] [blame] | 616 | * Decode SEEK request |
| 617 | */ |
| 618 | static int nfs4_xdr_dec_seek(struct rpc_rqst *rqstp, |
| 619 | struct xdr_stream *xdr, |
Christoph Hellwig | 18d9cff | 2017-05-08 15:09:02 +0200 | [diff] [blame] | 620 | void *data) |
Anna Schumaker | 1c6dcbe | 2014-09-26 13:58:48 -0400 | [diff] [blame] | 621 | { |
Christoph Hellwig | 18d9cff | 2017-05-08 15:09:02 +0200 | [diff] [blame] | 622 | struct nfs42_seek_res *res = data; |
Anna Schumaker | 1c6dcbe | 2014-09-26 13:58:48 -0400 | [diff] [blame] | 623 | struct compound_hdr hdr; |
| 624 | int status; |
| 625 | |
| 626 | status = decode_compound_hdr(xdr, &hdr); |
| 627 | if (status) |
| 628 | goto out; |
| 629 | status = decode_sequence(xdr, &res->seq_res, rqstp); |
| 630 | if (status) |
| 631 | goto out; |
| 632 | status = decode_putfh(xdr); |
| 633 | if (status) |
| 634 | goto out; |
| 635 | status = decode_seek(xdr, res); |
| 636 | out: |
| 637 | return status; |
| 638 | } |
Trond Myklebust | be3a5d2 | 2015-06-23 19:51:55 +0800 | [diff] [blame] | 639 | |
| 640 | /* |
| 641 | * Decode LAYOUTSTATS request |
| 642 | */ |
| 643 | static int nfs4_xdr_dec_layoutstats(struct rpc_rqst *rqstp, |
| 644 | struct xdr_stream *xdr, |
Christoph Hellwig | 18d9cff | 2017-05-08 15:09:02 +0200 | [diff] [blame] | 645 | void *data) |
Trond Myklebust | be3a5d2 | 2015-06-23 19:51:55 +0800 | [diff] [blame] | 646 | { |
Christoph Hellwig | 18d9cff | 2017-05-08 15:09:02 +0200 | [diff] [blame] | 647 | struct nfs42_layoutstat_res *res = data; |
Trond Myklebust | be3a5d2 | 2015-06-23 19:51:55 +0800 | [diff] [blame] | 648 | struct compound_hdr hdr; |
| 649 | int status, i; |
| 650 | |
| 651 | status = decode_compound_hdr(xdr, &hdr); |
| 652 | if (status) |
| 653 | goto out; |
| 654 | status = decode_sequence(xdr, &res->seq_res, rqstp); |
| 655 | if (status) |
| 656 | goto out; |
| 657 | status = decode_putfh(xdr); |
| 658 | if (status) |
| 659 | goto out; |
| 660 | WARN_ON(res->num_dev > PNFS_LAYOUTSTATS_MAXDEV); |
| 661 | for (i = 0; i < res->num_dev; i++) { |
Peng Tao | 19cf633 | 2015-08-26 00:13:15 +0800 | [diff] [blame] | 662 | status = decode_layoutstats(xdr); |
Trond Myklebust | be3a5d2 | 2015-06-23 19:51:55 +0800 | [diff] [blame] | 663 | if (status) |
| 664 | goto out; |
| 665 | } |
| 666 | out: |
| 667 | res->rpc_status = status; |
| 668 | return status; |
| 669 | } |
| 670 | |
Peng Tao | 3602277 | 2015-09-26 02:24:34 +0800 | [diff] [blame] | 671 | /* |
| 672 | * Decode CLONE request |
| 673 | */ |
| 674 | static int nfs4_xdr_dec_clone(struct rpc_rqst *rqstp, |
| 675 | struct xdr_stream *xdr, |
Christoph Hellwig | 18d9cff | 2017-05-08 15:09:02 +0200 | [diff] [blame] | 676 | void *data) |
Peng Tao | 3602277 | 2015-09-26 02:24:34 +0800 | [diff] [blame] | 677 | { |
Christoph Hellwig | 18d9cff | 2017-05-08 15:09:02 +0200 | [diff] [blame] | 678 | struct nfs42_clone_res *res = data; |
Peng Tao | 3602277 | 2015-09-26 02:24:34 +0800 | [diff] [blame] | 679 | struct compound_hdr hdr; |
| 680 | int status; |
| 681 | |
| 682 | status = decode_compound_hdr(xdr, &hdr); |
| 683 | if (status) |
| 684 | goto out; |
| 685 | status = decode_sequence(xdr, &res->seq_res, rqstp); |
| 686 | if (status) |
| 687 | goto out; |
| 688 | status = decode_putfh(xdr); |
| 689 | if (status) |
| 690 | goto out; |
| 691 | status = decode_savefh(xdr); |
| 692 | if (status) |
| 693 | goto out; |
| 694 | status = decode_putfh(xdr); |
| 695 | if (status) |
| 696 | goto out; |
| 697 | status = decode_clone(xdr); |
| 698 | if (status) |
| 699 | goto out; |
| 700 | status = decode_getfattr(xdr, res->dst_fattr, res->server); |
| 701 | |
| 702 | out: |
| 703 | res->rpc_status = status; |
| 704 | return status; |
| 705 | } |
| 706 | |
Anna Schumaker | 1c6dcbe | 2014-09-26 13:58:48 -0400 | [diff] [blame] | 707 | #endif /* __LINUX_FS_NFS_NFS4_2XDR_H */ |