Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
1da177e4 LT |
2 | #ifndef _LINUX_NFS_XDR_H |
3 | #define _LINUX_NFS_XDR_H | |
4 | ||
b7fa0554 | 5 | #include <linux/nfsacl.h> |
5a5ea0d4 | 6 | #include <linux/sunrpc/gss_api.h> |
1da177e4 | 7 | |
40859d7e CL |
8 | /* |
9 | * To change the maximum rsize and wsize supported by the NFS client, adjust | |
10 | * NFS_MAX_FILE_IO_SIZE. 64KB is a typical maximum, but some servers can | |
11 | * support a megabyte or more. The default is left at 4096 bytes, which is | |
12 | * reasonable for NFS over UDP. | |
13 | */ | |
14 | #define NFS_MAX_FILE_IO_SIZE (1048576U) | |
15 | #define NFS_DEF_FILE_IO_SIZE (4096U) | |
16 | #define NFS_MIN_FILE_IO_SIZE (1024U) | |
17 | ||
332d1a03 TM |
18 | #define NFS_BITMASK_SZ 3 |
19 | ||
6926afd1 TM |
20 | struct nfs4_string { |
21 | unsigned int len; | |
22 | char *data; | |
23 | }; | |
24 | ||
8b4bdcf8 TM |
25 | struct nfs_fsid { |
26 | uint64_t major; | |
27 | uint64_t minor; | |
1da177e4 LT |
28 | }; |
29 | ||
8b4bdcf8 TM |
30 | /* |
31 | * Helper for checking equality between 2 fsids. | |
32 | */ | |
33 | static inline int nfs_fsid_equal(const struct nfs_fsid *a, const struct nfs_fsid *b) | |
34 | { | |
35 | return a->major == b->major && a->minor == b->minor; | |
36 | } | |
37 | ||
88034c3d AA |
38 | struct nfs4_threshold { |
39 | __u32 bm; | |
40 | __u32 l_type; | |
41 | __u64 rd_sz; | |
42 | __u64 wr_sz; | |
43 | __u64 rd_io_sz; | |
44 | __u64 wr_io_sz; | |
45 | }; | |
46 | ||
1da177e4 | 47 | struct nfs_fattr { |
9e6e70f8 | 48 | unsigned int valid; /* which fields are valid */ |
bca79478 | 49 | umode_t mode; |
1da177e4 | 50 | __u32 nlink; |
54f834cd EB |
51 | kuid_t uid; |
52 | kgid_t gid; | |
9fa8d66f | 53 | dev_t rdev; |
1da177e4 LT |
54 | __u64 size; |
55 | union { | |
56 | struct { | |
57 | __u32 blocksize; | |
58 | __u32 blocks; | |
59 | } nfs2; | |
60 | struct { | |
61 | __u64 used; | |
62 | } nfs3; | |
63 | } du; | |
8b4bdcf8 | 64 | struct nfs_fsid fsid; |
1da177e4 | 65 | __u64 fileid; |
28331a46 | 66 | __u64 mounted_on_fileid; |
e86d5a02 TM |
67 | struct timespec64 atime; |
68 | struct timespec64 mtime; | |
69 | struct timespec64 ctime; | |
1da177e4 LT |
70 | __u64 change_attr; /* NFSv4 change attribute */ |
71 | __u64 pre_change_attr;/* pre-op NFSv4 change attribute */ | |
1ca277d8 | 72 | __u64 pre_size; /* pre_op_attr.size */ |
e86d5a02 TM |
73 | struct timespec64 pre_mtime; /* pre_op_attr.mtime */ |
74 | struct timespec64 pre_ctime; /* pre_op_attr.ctime */ | |
33801147 | 75 | unsigned long time_start; |
4704f0e2 | 76 | unsigned long gencount; |
6926afd1 TM |
77 | struct nfs4_string *owner_name; |
78 | struct nfs4_string *group_name; | |
88034c3d | 79 | struct nfs4_threshold *mdsthreshold; /* pNFS threshold hints */ |
779df6a5 | 80 | struct nfs4_label *label; |
1da177e4 LT |
81 | }; |
82 | ||
9e6e70f8 TM |
83 | #define NFS_ATTR_FATTR_TYPE (1U << 0) |
84 | #define NFS_ATTR_FATTR_MODE (1U << 1) | |
85 | #define NFS_ATTR_FATTR_NLINK (1U << 2) | |
86 | #define NFS_ATTR_FATTR_OWNER (1U << 3) | |
87 | #define NFS_ATTR_FATTR_GROUP (1U << 4) | |
88 | #define NFS_ATTR_FATTR_RDEV (1U << 5) | |
89 | #define NFS_ATTR_FATTR_SIZE (1U << 6) | |
90 | #define NFS_ATTR_FATTR_PRESIZE (1U << 7) | |
91 | #define NFS_ATTR_FATTR_BLOCKS_USED (1U << 8) | |
92 | #define NFS_ATTR_FATTR_SPACE_USED (1U << 9) | |
93 | #define NFS_ATTR_FATTR_FSID (1U << 10) | |
94 | #define NFS_ATTR_FATTR_FILEID (1U << 11) | |
95 | #define NFS_ATTR_FATTR_ATIME (1U << 12) | |
96 | #define NFS_ATTR_FATTR_MTIME (1U << 13) | |
97 | #define NFS_ATTR_FATTR_CTIME (1U << 14) | |
98 | #define NFS_ATTR_FATTR_PREMTIME (1U << 15) | |
99 | #define NFS_ATTR_FATTR_PRECTIME (1U << 16) | |
100 | #define NFS_ATTR_FATTR_CHANGE (1U << 17) | |
101 | #define NFS_ATTR_FATTR_PRECHANGE (1U << 18) | |
81934ddb CL |
102 | #define NFS_ATTR_FATTR_V4_LOCATIONS (1U << 19) |
103 | #define NFS_ATTR_FATTR_V4_REFERRAL (1U << 20) | |
104 | #define NFS_ATTR_FATTR_MOUNTPOINT (1U << 21) | |
105 | #define NFS_ATTR_FATTR_MOUNTED_ON_FILEID (1U << 22) | |
106 | #define NFS_ATTR_FATTR_OWNER_NAME (1U << 23) | |
107 | #define NFS_ATTR_FATTR_GROUP_NAME (1U << 24) | |
e64a4210 | 108 | #define NFS_ATTR_FATTR_V4_SECURITY_LABEL (1U << 25) |
9e6e70f8 TM |
109 | |
110 | #define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \ | |
111 | | NFS_ATTR_FATTR_MODE \ | |
112 | | NFS_ATTR_FATTR_NLINK \ | |
113 | | NFS_ATTR_FATTR_OWNER \ | |
114 | | NFS_ATTR_FATTR_GROUP \ | |
115 | | NFS_ATTR_FATTR_RDEV \ | |
116 | | NFS_ATTR_FATTR_SIZE \ | |
117 | | NFS_ATTR_FATTR_FSID \ | |
118 | | NFS_ATTR_FATTR_FILEID \ | |
119 | | NFS_ATTR_FATTR_ATIME \ | |
120 | | NFS_ATTR_FATTR_MTIME \ | |
3a1556e8 TM |
121 | | NFS_ATTR_FATTR_CTIME \ |
122 | | NFS_ATTR_FATTR_CHANGE) | |
9e6e70f8 TM |
123 | #define NFS_ATTR_FATTR_V2 (NFS_ATTR_FATTR \ |
124 | | NFS_ATTR_FATTR_BLOCKS_USED) | |
125 | #define NFS_ATTR_FATTR_V3 (NFS_ATTR_FATTR \ | |
126 | | NFS_ATTR_FATTR_SPACE_USED) | |
127 | #define NFS_ATTR_FATTR_V4 (NFS_ATTR_FATTR \ | |
e64a4210 DQ |
128 | | NFS_ATTR_FATTR_SPACE_USED \ |
129 | | NFS_ATTR_FATTR_V4_SECURITY_LABEL) | |
1da177e4 | 130 | |
3132e49e JL |
131 | /* |
132 | * Maximal number of supported layout drivers. | |
133 | */ | |
134 | #define NFS_MAX_LAYOUT_TYPES 8 | |
135 | ||
1da177e4 LT |
136 | /* |
137 | * Info on the file system | |
138 | */ | |
139 | struct nfs_fsinfo { | |
140 | struct nfs_fattr *fattr; /* Post-op attributes */ | |
141 | __u32 rtmax; /* max. read transfer size */ | |
142 | __u32 rtpref; /* pref. read transfer size */ | |
143 | __u32 rtmult; /* reads should be multiple of this */ | |
144 | __u32 wtmax; /* max. write transfer size */ | |
145 | __u32 wtpref; /* pref. write transfer size */ | |
146 | __u32 wtmult; /* writes should be multiple of this */ | |
147 | __u32 dtpref; /* pref. readdir transfer size */ | |
148 | __u64 maxfilesize; | |
e86d5a02 | 149 | struct timespec64 time_delta; /* server time granularity */ |
1da177e4 | 150 | __u32 lease_time; /* in seconds */ |
ca440c38 | 151 | __u32 nlayouttypes; /* number of layouttypes */ |
3132e49e | 152 | __u32 layouttype[NFS_MAX_LAYOUT_TYPES]; /* supported pnfs layout driver */ |
dae100c2 | 153 | __u32 blksize; /* preferred pnfs io block size */ |
2a92ee92 | 154 | __u32 clone_blksize; /* granularity of a CLONE operation */ |
7f08a335 TM |
155 | enum nfs4_change_attr_type |
156 | change_attr_type; /* Info about change attr */ | |
b78ef845 | 157 | __u32 xattr_support; /* User xattrs supported */ |
1da177e4 LT |
158 | }; |
159 | ||
160 | struct nfs_fsstat { | |
161 | struct nfs_fattr *fattr; /* Post-op attributes */ | |
162 | __u64 tbytes; /* total size in bytes */ | |
163 | __u64 fbytes; /* # of free bytes */ | |
164 | __u64 abytes; /* # of bytes available to user */ | |
165 | __u64 tfiles; /* # of files */ | |
166 | __u64 ffiles; /* # of free files */ | |
167 | __u64 afiles; /* # of files available to user */ | |
168 | }; | |
169 | ||
170 | struct nfs2_fsstat { | |
171 | __u32 tsize; /* Server transfer size */ | |
172 | __u32 bsize; /* Filesystem block size */ | |
173 | __u32 blocks; /* No. of "bsize" blocks on filesystem */ | |
174 | __u32 bfree; /* No. of free "bsize" blocks */ | |
175 | __u32 bavail; /* No. of available "bsize" blocks */ | |
176 | }; | |
177 | ||
178 | struct nfs_pathconf { | |
179 | struct nfs_fattr *fattr; /* Post-op attributes */ | |
180 | __u32 max_link; /* max # of hard links */ | |
181 | __u32 max_namelen; /* max name length */ | |
182 | }; | |
183 | ||
184 | struct nfs4_change_info { | |
185 | u32 atomic; | |
186 | u64 before; | |
187 | u64 after; | |
188 | }; | |
189 | ||
cee54fc9 | 190 | struct nfs_seqid; |
9ff71c3a | 191 | |
557134a3 AA |
192 | /* nfs41 sessions channel attributes */ |
193 | struct nfs4_channel_attrs { | |
557134a3 AA |
194 | u32 max_rqst_sz; |
195 | u32 max_resp_sz; | |
196 | u32 max_resp_sz_cached; | |
197 | u32 max_ops; | |
198 | u32 max_reqs; | |
199 | }; | |
200 | ||
76e697ba | 201 | struct nfs4_slot; |
9ff71c3a | 202 | struct nfs4_sequence_args { |
2b2fa717 | 203 | struct nfs4_slot *sa_slot; |
8fe72bac TM |
204 | u8 sa_cache_this : 1, |
205 | sa_privileged : 1; | |
9ff71c3a BH |
206 | }; |
207 | ||
208 | struct nfs4_sequence_res { | |
dfb4f309 | 209 | struct nfs4_slot *sr_slot; /* slot used to send request */ |
8e63b6a8 | 210 | unsigned long sr_timestamp; |
fbcd4abc | 211 | int sr_status; /* sequence operation status */ |
0629e370 | 212 | u32 sr_status_flags; |
da0507b7 | 213 | u32 sr_highest_slotid; |
464ee9f9 | 214 | u32 sr_target_highest_slotid; |
9ff71c3a BH |
215 | }; |
216 | ||
2050f0cc AA |
217 | struct nfs4_get_lease_time_args { |
218 | struct nfs4_sequence_args la_seq_args; | |
219 | }; | |
220 | ||
221 | struct nfs4_get_lease_time_res { | |
2050f0cc | 222 | struct nfs4_sequence_res lr_seq_res; |
62ae082d | 223 | struct nfs_fsinfo *lr_fsinfo; |
2050f0cc AA |
224 | }; |
225 | ||
f8c3cf9d TM |
226 | struct xdr_stream; |
227 | struct nfs4_xdr_opaque_data; | |
228 | ||
229 | struct nfs4_xdr_opaque_ops { | |
230 | void (*encode)(struct xdr_stream *, const void *args, | |
231 | const struct nfs4_xdr_opaque_data *); | |
232 | void (*free)(struct nfs4_xdr_opaque_data *); | |
233 | }; | |
234 | ||
235 | struct nfs4_xdr_opaque_data { | |
236 | const struct nfs4_xdr_opaque_ops *ops; | |
237 | void *data; | |
238 | }; | |
239 | ||
b1f69b75 AA |
240 | #define PNFS_LAYOUT_MAXSIZE 4096 |
241 | ||
242 | struct nfs4_layoutdriver_data { | |
35124a09 WAA |
243 | struct page **pages; |
244 | __u32 pglen; | |
b1f69b75 | 245 | __u32 len; |
b1f69b75 AA |
246 | }; |
247 | ||
248 | struct pnfs_layout_range { | |
249 | u32 iomode; | |
250 | u64 offset; | |
251 | u64 length; | |
252 | }; | |
253 | ||
254 | struct nfs4_layoutget_args { | |
62ae082d | 255 | struct nfs4_sequence_args seq_args; |
b1f69b75 AA |
256 | __u32 type; |
257 | struct pnfs_layout_range range; | |
258 | __u64 minlength; | |
259 | __u32 maxcount; | |
260 | struct inode *inode; | |
261 | struct nfs_open_context *ctx; | |
cf7d63f1 | 262 | nfs4_stateid stateid; |
35124a09 | 263 | struct nfs4_layoutdriver_data layout; |
b1f69b75 AA |
264 | }; |
265 | ||
266 | struct nfs4_layoutget_res { | |
62ae082d | 267 | struct nfs4_sequence_res seq_res; |
808ba32a | 268 | int status; |
b1f69b75 AA |
269 | __u32 return_on_close; |
270 | struct pnfs_layout_range range; | |
271 | __u32 type; | |
272 | nfs4_stateid stateid; | |
35124a09 | 273 | struct nfs4_layoutdriver_data *layoutp; |
b1f69b75 AA |
274 | }; |
275 | ||
276 | struct nfs4_layoutget { | |
277 | struct nfs4_layoutget_args args; | |
278 | struct nfs4_layoutget_res res; | |
a52458b4 | 279 | const struct cred *cred; |
b4e89bcb | 280 | struct pnfs_layout_hdr *lo; |
a75b9df9 | 281 | gfp_t gfp_flags; |
b1f69b75 AA |
282 | }; |
283 | ||
284 | struct nfs4_getdeviceinfo_args { | |
b1f69b75 | 285 | struct nfs4_sequence_args seq_args; |
62ae082d | 286 | struct pnfs_device *pdev; |
4e590803 | 287 | __u32 notify_types; |
b1f69b75 AA |
288 | }; |
289 | ||
290 | struct nfs4_getdeviceinfo_res { | |
b1f69b75 | 291 | struct nfs4_sequence_res seq_res; |
62ae082d | 292 | struct pnfs_device *pdev; |
4e590803 | 293 | __u32 notification; |
b1f69b75 AA |
294 | }; |
295 | ||
863a3c6c | 296 | struct nfs4_layoutcommit_args { |
62ae082d | 297 | struct nfs4_sequence_args seq_args; |
863a3c6c AA |
298 | nfs4_stateid stateid; |
299 | __u64 lastbytewritten; | |
300 | struct inode *inode; | |
301 | const u32 *bitmask; | |
5f919c9f CH |
302 | size_t layoutupdate_len; |
303 | struct page *layoutupdate_page; | |
304 | struct page **layoutupdate_pages; | |
c8975706 | 305 | __be32 *start_p; |
863a3c6c AA |
306 | }; |
307 | ||
308 | struct nfs4_layoutcommit_res { | |
62ae082d | 309 | struct nfs4_sequence_res seq_res; |
863a3c6c AA |
310 | struct nfs_fattr *fattr; |
311 | const struct nfs_server *server; | |
db29c089 | 312 | int status; |
863a3c6c AA |
313 | }; |
314 | ||
315 | struct nfs4_layoutcommit_data { | |
316 | struct rpc_task task; | |
317 | struct nfs_fattr fattr; | |
a9bae566 | 318 | struct list_head lseg_list; |
a52458b4 | 319 | const struct cred *cred; |
472e2594 | 320 | struct inode *inode; |
863a3c6c AA |
321 | struct nfs4_layoutcommit_args args; |
322 | struct nfs4_layoutcommit_res res; | |
323 | }; | |
324 | ||
cbe82603 | 325 | struct nfs4_layoutreturn_args { |
62ae082d | 326 | struct nfs4_sequence_args seq_args; |
a56aaa02 | 327 | struct pnfs_layout_hdr *layout; |
cbe82603 | 328 | struct inode *inode; |
15eb67c1 | 329 | struct pnfs_layout_range range; |
cbe82603 | 330 | nfs4_stateid stateid; |
a56aaa02 | 331 | __u32 layout_type; |
4d796d75 | 332 | struct nfs4_xdr_opaque_data *ld_private; |
cbe82603 BH |
333 | }; |
334 | ||
335 | struct nfs4_layoutreturn_res { | |
336 | struct nfs4_sequence_res seq_res; | |
337 | u32 lrs_present; | |
338 | nfs4_stateid stateid; | |
339 | }; | |
340 | ||
341 | struct nfs4_layoutreturn { | |
342 | struct nfs4_layoutreturn_args args; | |
343 | struct nfs4_layoutreturn_res res; | |
a52458b4 | 344 | const struct cred *cred; |
cbe82603 | 345 | struct nfs_client *clp; |
5a0ec8ac | 346 | struct inode *inode; |
cbe82603 | 347 | int rpc_status; |
4d796d75 | 348 | struct nfs4_xdr_opaque_data ld_private; |
cbe82603 BH |
349 | }; |
350 | ||
be3a5d23 TM |
351 | #define PNFS_LAYOUTSTATS_MAXSIZE 256 |
352 | ||
353 | struct nfs42_layoutstat_args; | |
354 | struct nfs42_layoutstat_devinfo; | |
355 | typedef void (*layoutstats_encode_t)(struct xdr_stream *, | |
356 | struct nfs42_layoutstat_args *, | |
357 | struct nfs42_layoutstat_devinfo *); | |
358 | ||
359 | /* Per file per deviceid layoutstats */ | |
360 | struct nfs42_layoutstat_devinfo { | |
361 | struct nfs4_deviceid dev_id; | |
362 | __u64 offset; | |
363 | __u64 length; | |
364 | __u64 read_count; | |
365 | __u64 read_bytes; | |
366 | __u64 write_count; | |
367 | __u64 write_bytes; | |
368 | __u32 layout_type; | |
422c93c8 | 369 | struct nfs4_xdr_opaque_data ld_private; |
be3a5d23 TM |
370 | }; |
371 | ||
372 | struct nfs42_layoutstat_args { | |
373 | struct nfs4_sequence_args seq_args; | |
374 | struct nfs_fh *fh; | |
375 | struct inode *inode; | |
376 | nfs4_stateid stateid; | |
377 | int num_dev; | |
378 | struct nfs42_layoutstat_devinfo *devinfo; | |
379 | }; | |
380 | ||
381 | struct nfs42_layoutstat_res { | |
382 | struct nfs4_sequence_res seq_res; | |
383 | int num_dev; | |
384 | int rpc_status; | |
385 | }; | |
386 | ||
387 | struct nfs42_layoutstat_data { | |
388 | struct inode *inode; | |
389 | struct nfs42_layoutstat_args args; | |
390 | struct nfs42_layoutstat_res res; | |
3eb86093 TM |
391 | }; |
392 | ||
393 | struct nfs42_device_error { | |
394 | struct nfs4_deviceid dev_id; | |
395 | int status; | |
396 | enum nfs_opnum4 opnum; | |
397 | }; | |
398 | ||
399 | struct nfs42_layout_error { | |
400 | __u64 offset; | |
401 | __u64 length; | |
402 | nfs4_stateid stateid; | |
403 | struct nfs42_device_error errors[1]; | |
404 | }; | |
405 | ||
406 | #define NFS42_LAYOUTERROR_MAX 5 | |
407 | ||
408 | struct nfs42_layouterror_args { | |
409 | struct nfs4_sequence_args seq_args; | |
410 | struct inode *inode; | |
411 | unsigned int num_errors; | |
412 | struct nfs42_layout_error errors[NFS42_LAYOUTERROR_MAX]; | |
413 | }; | |
414 | ||
415 | struct nfs42_layouterror_res { | |
416 | struct nfs4_sequence_res seq_res; | |
417 | unsigned int num_errors; | |
418 | int rpc_status; | |
419 | }; | |
420 | ||
421 | struct nfs42_layouterror_data { | |
422 | struct nfs42_layouterror_args args; | |
423 | struct nfs42_layouterror_res res; | |
424 | struct inode *inode; | |
425 | struct pnfs_layout_segment *lseg; | |
be3a5d23 TM |
426 | }; |
427 | ||
36022770 PT |
428 | struct nfs42_clone_args { |
429 | struct nfs4_sequence_args seq_args; | |
430 | struct nfs_fh *src_fh; | |
431 | struct nfs_fh *dst_fh; | |
432 | nfs4_stateid src_stateid; | |
433 | nfs4_stateid dst_stateid; | |
434 | __u64 src_offset; | |
435 | __u64 dst_offset; | |
436 | __u64 count; | |
437 | const u32 *dst_bitmask; | |
438 | }; | |
439 | ||
440 | struct nfs42_clone_res { | |
441 | struct nfs4_sequence_res seq_res; | |
442 | unsigned int rpc_status; | |
443 | struct nfs_fattr *dst_fattr; | |
444 | const struct nfs_server *server; | |
445 | }; | |
446 | ||
95b72eb0 TM |
447 | struct stateowner_id { |
448 | __u64 create_time; | |
449 | __u32 uniquifier; | |
450 | }; | |
451 | ||
1da177e4 LT |
452 | /* |
453 | * Arguments to the open call. | |
454 | */ | |
455 | struct nfs_openargs { | |
62ae082d | 456 | struct nfs4_sequence_args seq_args; |
1da177e4 | 457 | const struct nfs_fh * fh; |
cee54fc9 | 458 | struct nfs_seqid * seqid; |
1da177e4 | 459 | int open_flags; |
dc0b027d | 460 | fmode_t fmode; |
6ae37339 | 461 | u32 share_access; |
6168f62c | 462 | u32 access; |
1da177e4 | 463 | __u64 clientid; |
95b72eb0 | 464 | struct stateowner_id id; |
1da177e4 | 465 | union { |
d77d76ff | 466 | struct { |
5334c5bd | 467 | struct iattr * attrs; /* UNCHECKED, GUARDED, EXCLUSIVE4_1 */ |
d77d76ff TM |
468 | nfs4_verifier verifier; /* EXCLUSIVE */ |
469 | }; | |
1da177e4 | 470 | nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */ |
bd7bf9d5 | 471 | fmode_t delegation_type; /* CLAIM_PREVIOUS */ |
1da177e4 LT |
472 | } u; |
473 | const struct qstr * name; | |
474 | const struct nfs_server *server; /* Needed for ID mapping */ | |
475 | const u32 * bitmask; | |
1549210f | 476 | const u32 * open_bitmap; |
2a606188 | 477 | enum open_claim_type4 claim; |
549b19cc | 478 | enum createmode4 createmode; |
e058f70b | 479 | const struct nfs4_label *label; |
dff25ddb | 480 | umode_t umask; |
56f487f8 | 481 | struct nfs4_layoutget_args *lg_args; |
1da177e4 LT |
482 | }; |
483 | ||
484 | struct nfs_openres { | |
62ae082d | 485 | struct nfs4_sequence_res seq_res; |
1da177e4 LT |
486 | nfs4_stateid stateid; |
487 | struct nfs_fh fh; | |
488 | struct nfs4_change_info cinfo; | |
489 | __u32 rflags; | |
490 | struct nfs_fattr * f_attr; | |
c1d51931 | 491 | struct nfs_seqid * seqid; |
1da177e4 | 492 | const struct nfs_server *server; |
bd7bf9d5 | 493 | fmode_t delegation_type; |
1da177e4 | 494 | nfs4_stateid delegation; |
7d160a6c | 495 | unsigned long pagemod_limit; |
1da177e4 | 496 | __u32 do_recall; |
aa53ed54 | 497 | __u32 attrset[NFS4_BITMAP_SIZE]; |
6926afd1 TM |
498 | struct nfs4_string *owner; |
499 | struct nfs4_string *group_owner; | |
ae2bb032 | 500 | __u32 access_request; |
6168f62c WAA |
501 | __u32 access_supported; |
502 | __u32 access_result; | |
56f487f8 | 503 | struct nfs4_layoutget_res *lg_res; |
1da177e4 LT |
504 | }; |
505 | ||
506 | /* | |
507 | * Arguments to the open_confirm call. | |
508 | */ | |
509 | struct nfs_open_confirmargs { | |
17ead6c8 | 510 | struct nfs4_sequence_args seq_args; |
1da177e4 | 511 | const struct nfs_fh * fh; |
cdd4e68b | 512 | nfs4_stateid * stateid; |
cee54fc9 | 513 | struct nfs_seqid * seqid; |
1da177e4 LT |
514 | }; |
515 | ||
516 | struct nfs_open_confirmres { | |
17ead6c8 | 517 | struct nfs4_sequence_res seq_res; |
1da177e4 | 518 | nfs4_stateid stateid; |
c1d51931 | 519 | struct nfs_seqid * seqid; |
1da177e4 LT |
520 | }; |
521 | ||
522 | /* | |
523 | * Arguments to the close call. | |
524 | */ | |
525 | struct nfs_closeargs { | |
62ae082d | 526 | struct nfs4_sequence_args seq_args; |
1da177e4 | 527 | struct nfs_fh * fh; |
566fcec6 | 528 | nfs4_stateid stateid; |
cee54fc9 | 529 | struct nfs_seqid * seqid; |
dc0b027d | 530 | fmode_t fmode; |
6ae37339 | 531 | u32 share_access; |
332d1a03 TM |
532 | const u32 * bitmask; |
533 | u32 bitmask_store[NFS_BITMASK_SZ]; | |
cf805165 | 534 | struct nfs4_layoutreturn_args *lr_args; |
1da177e4 LT |
535 | }; |
536 | ||
537 | struct nfs_closeres { | |
62ae082d | 538 | struct nfs4_sequence_res seq_res; |
1da177e4 | 539 | nfs4_stateid stateid; |
516a6af6 | 540 | struct nfs_fattr * fattr; |
c1d51931 | 541 | struct nfs_seqid * seqid; |
516a6af6 | 542 | const struct nfs_server *server; |
cf805165 TM |
543 | struct nfs4_layoutreturn_res *lr_res; |
544 | int lr_ret; | |
1da177e4 LT |
545 | }; |
546 | /* | |
547 | * * Arguments to the lock,lockt, and locku call. | |
548 | * */ | |
549 | struct nfs_lowner { | |
911d1aaf | 550 | __u64 clientid; |
9f958ab8 | 551 | __u64 id; |
d035c36c | 552 | dev_t s_dev; |
1da177e4 LT |
553 | }; |
554 | ||
911d1aaf | 555 | struct nfs_lock_args { |
62ae082d | 556 | struct nfs4_sequence_args seq_args; |
911d1aaf TM |
557 | struct nfs_fh * fh; |
558 | struct file_lock * fl; | |
cee54fc9 | 559 | struct nfs_seqid * lock_seqid; |
425c1d4e | 560 | nfs4_stateid lock_stateid; |
06735b34 | 561 | struct nfs_seqid * open_seqid; |
425c1d4e | 562 | nfs4_stateid open_stateid; |
911d1aaf TM |
563 | struct nfs_lowner lock_owner; |
564 | unsigned char block : 1; | |
565 | unsigned char reclaim : 1; | |
c69899a1 | 566 | unsigned char new_lock : 1; |
911d1aaf TM |
567 | unsigned char new_lock_owner : 1; |
568 | }; | |
569 | ||
570 | struct nfs_lock_res { | |
62ae082d | 571 | struct nfs4_sequence_res seq_res; |
c1d51931 TM |
572 | nfs4_stateid stateid; |
573 | struct nfs_seqid * lock_seqid; | |
574 | struct nfs_seqid * open_seqid; | |
1da177e4 LT |
575 | }; |
576 | ||
911d1aaf | 577 | struct nfs_locku_args { |
62ae082d | 578 | struct nfs4_sequence_args seq_args; |
911d1aaf TM |
579 | struct nfs_fh * fh; |
580 | struct file_lock * fl; | |
cee54fc9 | 581 | struct nfs_seqid * seqid; |
425c1d4e | 582 | nfs4_stateid stateid; |
1da177e4 LT |
583 | }; |
584 | ||
911d1aaf | 585 | struct nfs_locku_res { |
62ae082d | 586 | struct nfs4_sequence_res seq_res; |
c1d51931 TM |
587 | nfs4_stateid stateid; |
588 | struct nfs_seqid * seqid; | |
1da177e4 LT |
589 | }; |
590 | ||
911d1aaf | 591 | struct nfs_lockt_args { |
62ae082d | 592 | struct nfs4_sequence_args seq_args; |
911d1aaf TM |
593 | struct nfs_fh * fh; |
594 | struct file_lock * fl; | |
595 | struct nfs_lowner lock_owner; | |
1da177e4 LT |
596 | }; |
597 | ||
911d1aaf | 598 | struct nfs_lockt_res { |
9ff71c3a | 599 | struct nfs4_sequence_res seq_res; |
62ae082d | 600 | struct file_lock * denied; /* LOCK, LOCKT failed */ |
1da177e4 LT |
601 | }; |
602 | ||
d3c7b7cc | 603 | struct nfs_release_lockowner_args { |
b7e63a10 | 604 | struct nfs4_sequence_args seq_args; |
d3c7b7cc TM |
605 | struct nfs_lowner lock_owner; |
606 | }; | |
607 | ||
b7e63a10 TM |
608 | struct nfs_release_lockowner_res { |
609 | struct nfs4_sequence_res seq_res; | |
610 | }; | |
611 | ||
1da177e4 | 612 | struct nfs4_delegreturnargs { |
62ae082d | 613 | struct nfs4_sequence_args seq_args; |
1da177e4 LT |
614 | const struct nfs_fh *fhandle; |
615 | const nfs4_stateid *stateid; | |
332d1a03 TM |
616 | const u32 *bitmask; |
617 | u32 bitmask_store[NFS_BITMASK_SZ]; | |
586f1c39 | 618 | struct nfs4_layoutreturn_args *lr_args; |
fa178f29 TM |
619 | }; |
620 | ||
621 | struct nfs4_delegreturnres { | |
62ae082d | 622 | struct nfs4_sequence_res seq_res; |
fa178f29 | 623 | struct nfs_fattr * fattr; |
516285eb | 624 | struct nfs_server *server; |
586f1c39 TM |
625 | struct nfs4_layoutreturn_res *lr_res; |
626 | int lr_ret; | |
1da177e4 LT |
627 | }; |
628 | ||
1da177e4 LT |
629 | /* |
630 | * Arguments to the write call. | |
631 | */ | |
2f2c63bc TM |
632 | struct nfs_write_verifier { |
633 | char data[8]; | |
634 | }; | |
635 | ||
1da177e4 | 636 | struct nfs_writeverf { |
2f2c63bc | 637 | struct nfs_write_verifier verifier; |
1da177e4 | 638 | enum nfs3_stable_how committed; |
1da177e4 LT |
639 | }; |
640 | ||
3c6b899c AS |
641 | /* |
642 | * Arguments shared by the read and write call. | |
643 | */ | |
644 | struct nfs_pgio_args { | |
645 | struct nfs4_sequence_args seq_args; | |
646 | struct nfs_fh * fh; | |
647 | struct nfs_open_context *context; | |
648 | struct nfs_lock_context *lock_context; | |
649 | nfs4_stateid stateid; | |
650 | __u64 offset; | |
651 | __u32 count; | |
652 | unsigned int pgbase; | |
653 | struct page ** pages; | |
28d52235 TM |
654 | union { |
655 | unsigned int replen; /* used by read */ | |
656 | struct { | |
332d1a03 TM |
657 | const u32 * bitmask; /* used by write */ |
658 | u32 bitmask_store[NFS_BITMASK_SZ]; /* used by write */ | |
28d52235 TM |
659 | enum nfs3_stable_how stable; /* used by write */ |
660 | }; | |
661 | }; | |
3c6b899c AS |
662 | }; |
663 | ||
9137bdf3 AS |
664 | struct nfs_pgio_res { |
665 | struct nfs4_sequence_res seq_res; | |
666 | struct nfs_fattr * fattr; | |
c5675526 | 667 | __u64 count; |
aabff4dd | 668 | __u32 op_status; |
28d52235 TM |
669 | union { |
670 | struct { | |
671 | unsigned int replen; /* used by read */ | |
672 | int eof; /* used by read */ | |
fbd2a05f | 673 | void * scratch; /* used by read */ |
28d52235 TM |
674 | }; |
675 | struct { | |
676 | struct nfs_writeverf * verf; /* used by write */ | |
677 | const struct nfs_server *server; /* used by write */ | |
678 | }; | |
679 | }; | |
9137bdf3 AS |
680 | }; |
681 | ||
0b7c0153 FI |
682 | /* |
683 | * Arguments to the commit call. | |
684 | */ | |
685 | struct nfs_commitargs { | |
62ae082d | 686 | struct nfs4_sequence_args seq_args; |
0b7c0153 FI |
687 | struct nfs_fh *fh; |
688 | __u64 offset; | |
689 | __u32 count; | |
690 | const u32 *bitmask; | |
0b7c0153 FI |
691 | }; |
692 | ||
693 | struct nfs_commitres { | |
62ae082d | 694 | struct nfs4_sequence_res seq_res; |
aabff4dd | 695 | __u32 op_status; |
0b7c0153 FI |
696 | struct nfs_fattr *fattr; |
697 | struct nfs_writeverf *verf; | |
698 | const struct nfs_server *server; | |
0b7c0153 FI |
699 | }; |
700 | ||
4fdc17b2 TM |
701 | /* |
702 | * Common arguments to the unlink call | |
703 | */ | |
704 | struct nfs_removeargs { | |
62ae082d | 705 | struct nfs4_sequence_args seq_args; |
4fdc17b2 TM |
706 | const struct nfs_fh *fh; |
707 | struct qstr name; | |
4fdc17b2 TM |
708 | }; |
709 | ||
710 | struct nfs_removeres { | |
62ae082d | 711 | struct nfs4_sequence_res seq_res; |
516285eb | 712 | struct nfs_server *server; |
d346890b | 713 | struct nfs_fattr *dir_attr; |
4fdc17b2 | 714 | struct nfs4_change_info cinfo; |
4fdc17b2 TM |
715 | }; |
716 | ||
920769f0 JL |
717 | /* |
718 | * Common arguments to the rename call | |
719 | */ | |
720 | struct nfs_renameargs { | |
62ae082d | 721 | struct nfs4_sequence_args seq_args; |
920769f0 JL |
722 | const struct nfs_fh *old_dir; |
723 | const struct nfs_fh *new_dir; | |
724 | const struct qstr *old_name; | |
725 | const struct qstr *new_name; | |
920769f0 JL |
726 | }; |
727 | ||
e8582a8b | 728 | struct nfs_renameres { |
62ae082d | 729 | struct nfs4_sequence_res seq_res; |
516285eb | 730 | struct nfs_server *server; |
e8582a8b JL |
731 | struct nfs4_change_info old_cinfo; |
732 | struct nfs_fattr *old_fattr; | |
733 | struct nfs4_change_info new_cinfo; | |
734 | struct nfs_fattr *new_fattr; | |
e8582a8b JL |
735 | }; |
736 | ||
a3f73c27 | 737 | /* parsed sec= options */ |
4d4b69dd | 738 | #define NFS_AUTH_INFO_MAX_FLAVORS 12 /* see fs/nfs/super.c */ |
a3f73c27 WAA |
739 | struct nfs_auth_info { |
740 | unsigned int flavor_len; | |
4d4b69dd | 741 | rpc_authflavor_t flavors[NFS_AUTH_INFO_MAX_FLAVORS]; |
a3f73c27 WAA |
742 | }; |
743 | ||
1da177e4 LT |
744 | /* |
745 | * Argument struct for decode_entry function | |
746 | */ | |
747 | struct nfs_entry { | |
748 | __u64 ino; | |
0adf85b4 | 749 | __u64 cookie; |
1da177e4 LT |
750 | const char * name; |
751 | unsigned int len; | |
752 | int eof; | |
753 | struct nfs_fh * fh; | |
754 | struct nfs_fattr * fattr; | |
0b26a0bf | 755 | unsigned char d_type; |
573c4e1e | 756 | struct nfs_server * server; |
1da177e4 LT |
757 | }; |
758 | ||
82e22a5e TM |
759 | struct nfs_readdir_arg { |
760 | struct dentry *dentry; | |
761 | const struct cred *cred; | |
762 | __be32 *verf; | |
763 | u64 cookie; | |
764 | struct page **pages; | |
765 | unsigned int page_len; | |
766 | bool plus; | |
767 | }; | |
768 | ||
769 | struct nfs_readdir_res { | |
770 | __be32 *verf; | |
771 | }; | |
772 | ||
1da177e4 LT |
773 | /* |
774 | * The following types are for NFSv2 only. | |
775 | */ | |
776 | struct nfs_sattrargs { | |
777 | struct nfs_fh * fh; | |
778 | struct iattr * sattr; | |
779 | }; | |
780 | ||
781 | struct nfs_diropargs { | |
782 | struct nfs_fh * fh; | |
783 | const char * name; | |
784 | unsigned int len; | |
785 | }; | |
786 | ||
787 | struct nfs_createargs { | |
788 | struct nfs_fh * fh; | |
789 | const char * name; | |
790 | unsigned int len; | |
791 | struct iattr * sattr; | |
792 | }; | |
793 | ||
1da177e4 | 794 | struct nfs_setattrargs { |
62ae082d | 795 | struct nfs4_sequence_args seq_args; |
1da177e4 LT |
796 | struct nfs_fh * fh; |
797 | nfs4_stateid stateid; | |
798 | struct iattr * iap; | |
799 | const struct nfs_server * server; /* Needed for name mapping */ | |
800 | const u32 * bitmask; | |
e058f70b | 801 | const struct nfs4_label *label; |
1da177e4 LT |
802 | }; |
803 | ||
7b8b44eb TM |
804 | enum nfs4_acl_type { |
805 | NFS4ACL_NONE = 0, | |
806 | NFS4ACL_ACL, | |
807 | NFS4ACL_DACL, | |
808 | NFS4ACL_SACL, | |
809 | }; | |
810 | ||
23ec6965 | 811 | struct nfs_setaclargs { |
62ae082d | 812 | struct nfs4_sequence_args seq_args; |
23ec6965 | 813 | struct nfs_fh * fh; |
db145db0 | 814 | enum nfs4_acl_type acl_type; |
23ec6965 | 815 | size_t acl_len; |
23ec6965 BF |
816 | struct page ** acl_pages; |
817 | }; | |
818 | ||
73c403a9 BH |
819 | struct nfs_setaclres { |
820 | struct nfs4_sequence_res seq_res; | |
821 | }; | |
822 | ||
029d105e | 823 | struct nfs_getaclargs { |
62ae082d | 824 | struct nfs4_sequence_args seq_args; |
029d105e | 825 | struct nfs_fh * fh; |
db145db0 | 826 | enum nfs4_acl_type acl_type; |
029d105e | 827 | size_t acl_len; |
029d105e BF |
828 | struct page ** acl_pages; |
829 | }; | |
830 | ||
bf118a34 | 831 | /* getxattr ACL interface flags */ |
1f1ea6c2 | 832 | #define NFS4_ACL_TRUNC 0x0001 /* ACL was truncated */ |
663c79b3 | 833 | struct nfs_getaclres { |
62ae082d | 834 | struct nfs4_sequence_res seq_res; |
db145db0 | 835 | enum nfs4_acl_type acl_type; |
663c79b3 | 836 | size_t acl_len; |
bf118a34 AA |
837 | size_t acl_data_offset; |
838 | int acl_flags; | |
331818f1 | 839 | struct page * acl_scratch; |
663c79b3 BH |
840 | }; |
841 | ||
1da177e4 | 842 | struct nfs_setattrres { |
62ae082d | 843 | struct nfs4_sequence_res seq_res; |
1da177e4 LT |
844 | struct nfs_fattr * fattr; |
845 | const struct nfs_server * server; | |
846 | }; | |
847 | ||
848 | struct nfs_linkargs { | |
849 | struct nfs_fh * fromfh; | |
850 | struct nfs_fh * tofh; | |
851 | const char * toname; | |
852 | unsigned int tolen; | |
853 | }; | |
854 | ||
855 | struct nfs_symlinkargs { | |
856 | struct nfs_fh * fromfh; | |
857 | const char * fromname; | |
858 | unsigned int fromlen; | |
94a6d753 CL |
859 | struct page ** pages; |
860 | unsigned int pathlen; | |
1da177e4 LT |
861 | struct iattr * sattr; |
862 | }; | |
863 | ||
864 | struct nfs_readdirargs { | |
865 | struct nfs_fh * fh; | |
866 | __u32 cookie; | |
867 | unsigned int count; | |
868 | struct page ** pages; | |
869 | }; | |
870 | ||
b7fa0554 AG |
871 | struct nfs3_getaclargs { |
872 | struct nfs_fh * fh; | |
873 | int mask; | |
874 | struct page ** pages; | |
875 | }; | |
876 | ||
877 | struct nfs3_setaclargs { | |
878 | struct inode * inode; | |
879 | int mask; | |
880 | struct posix_acl * acl_access; | |
881 | struct posix_acl * acl_default; | |
ae46141f TM |
882 | size_t len; |
883 | unsigned int npages; | |
b7fa0554 AG |
884 | struct page ** pages; |
885 | }; | |
886 | ||
1da177e4 LT |
887 | struct nfs_diropok { |
888 | struct nfs_fh * fh; | |
889 | struct nfs_fattr * fattr; | |
890 | }; | |
891 | ||
892 | struct nfs_readlinkargs { | |
893 | struct nfs_fh * fh; | |
894 | unsigned int pgbase; | |
895 | unsigned int pglen; | |
896 | struct page ** pages; | |
897 | }; | |
898 | ||
899 | struct nfs3_sattrargs { | |
900 | struct nfs_fh * fh; | |
901 | struct iattr * sattr; | |
902 | unsigned int guard; | |
6430b323 | 903 | struct timespec64 guardtime; |
1da177e4 LT |
904 | }; |
905 | ||
906 | struct nfs3_diropargs { | |
907 | struct nfs_fh * fh; | |
908 | const char * name; | |
909 | unsigned int len; | |
910 | }; | |
911 | ||
912 | struct nfs3_accessargs { | |
913 | struct nfs_fh * fh; | |
914 | __u32 access; | |
915 | }; | |
916 | ||
917 | struct nfs3_createargs { | |
918 | struct nfs_fh * fh; | |
919 | const char * name; | |
920 | unsigned int len; | |
921 | struct iattr * sattr; | |
922 | enum nfs3_createmode createmode; | |
bc4785cd | 923 | __be32 verifier[2]; |
1da177e4 LT |
924 | }; |
925 | ||
926 | struct nfs3_mkdirargs { | |
927 | struct nfs_fh * fh; | |
928 | const char * name; | |
929 | unsigned int len; | |
930 | struct iattr * sattr; | |
931 | }; | |
932 | ||
933 | struct nfs3_symlinkargs { | |
934 | struct nfs_fh * fromfh; | |
935 | const char * fromname; | |
936 | unsigned int fromlen; | |
94a6d753 CL |
937 | struct page ** pages; |
938 | unsigned int pathlen; | |
1da177e4 LT |
939 | struct iattr * sattr; |
940 | }; | |
941 | ||
942 | struct nfs3_mknodargs { | |
943 | struct nfs_fh * fh; | |
944 | const char * name; | |
945 | unsigned int len; | |
946 | enum nfs3_ftype type; | |
947 | struct iattr * sattr; | |
948 | dev_t rdev; | |
949 | }; | |
950 | ||
1da177e4 LT |
951 | struct nfs3_linkargs { |
952 | struct nfs_fh * fromfh; | |
953 | struct nfs_fh * tofh; | |
954 | const char * toname; | |
955 | unsigned int tolen; | |
956 | }; | |
957 | ||
958 | struct nfs3_readdirargs { | |
959 | struct nfs_fh * fh; | |
960 | __u64 cookie; | |
bc4785cd | 961 | __be32 verf[2]; |
a7a3b1e9 | 962 | bool plus; |
1da177e4 LT |
963 | unsigned int count; |
964 | struct page ** pages; | |
965 | }; | |
966 | ||
967 | struct nfs3_diropres { | |
968 | struct nfs_fattr * dir_attr; | |
969 | struct nfs_fh * fh; | |
970 | struct nfs_fattr * fattr; | |
971 | }; | |
972 | ||
973 | struct nfs3_accessres { | |
974 | struct nfs_fattr * fattr; | |
975 | __u32 access; | |
976 | }; | |
977 | ||
978 | struct nfs3_readlinkargs { | |
979 | struct nfs_fh * fh; | |
980 | unsigned int pgbase; | |
981 | unsigned int pglen; | |
982 | struct page ** pages; | |
983 | }; | |
984 | ||
1da177e4 LT |
985 | struct nfs3_linkres { |
986 | struct nfs_fattr * dir_attr; | |
987 | struct nfs_fattr * fattr; | |
988 | }; | |
989 | ||
990 | struct nfs3_readdirres { | |
991 | struct nfs_fattr * dir_attr; | |
bc4785cd | 992 | __be32 * verf; |
a7a3b1e9 | 993 | bool plus; |
1da177e4 LT |
994 | }; |
995 | ||
b7fa0554 AG |
996 | struct nfs3_getaclres { |
997 | struct nfs_fattr * fattr; | |
998 | int mask; | |
999 | unsigned int acl_access_count; | |
1000 | unsigned int acl_default_count; | |
1001 | struct posix_acl * acl_access; | |
1002 | struct posix_acl * acl_default; | |
1003 | }; | |
1004 | ||
89d77c8f | 1005 | #if IS_ENABLED(CONFIG_NFS_V4) |
1da177e4 LT |
1006 | |
1007 | typedef u64 clientid4; | |
1008 | ||
1009 | struct nfs4_accessargs { | |
62ae082d | 1010 | struct nfs4_sequence_args seq_args; |
1da177e4 | 1011 | const struct nfs_fh * fh; |
76b32999 | 1012 | const u32 * bitmask; |
1da177e4 LT |
1013 | u32 access; |
1014 | }; | |
1015 | ||
1016 | struct nfs4_accessres { | |
62ae082d | 1017 | struct nfs4_sequence_res seq_res; |
76b32999 TM |
1018 | const struct nfs_server * server; |
1019 | struct nfs_fattr * fattr; | |
1da177e4 LT |
1020 | u32 supported; |
1021 | u32 access; | |
1022 | }; | |
1023 | ||
1024 | struct nfs4_create_arg { | |
62ae082d | 1025 | struct nfs4_sequence_args seq_args; |
1da177e4 LT |
1026 | u32 ftype; |
1027 | union { | |
94a6d753 CL |
1028 | struct { |
1029 | struct page ** pages; | |
1030 | unsigned int len; | |
1031 | } symlink; /* NF4LNK */ | |
1da177e4 LT |
1032 | struct { |
1033 | u32 specdata1; | |
1034 | u32 specdata2; | |
1035 | } device; /* NF4BLK, NF4CHR */ | |
1036 | } u; | |
1037 | const struct qstr * name; | |
1038 | const struct nfs_server * server; | |
1039 | const struct iattr * attrs; | |
1040 | const struct nfs_fh * dir_fh; | |
1041 | const u32 * bitmask; | |
e058f70b | 1042 | const struct nfs4_label *label; |
dff25ddb | 1043 | umode_t umask; |
1da177e4 LT |
1044 | }; |
1045 | ||
1046 | struct nfs4_create_res { | |
62ae082d | 1047 | struct nfs4_sequence_res seq_res; |
1da177e4 LT |
1048 | const struct nfs_server * server; |
1049 | struct nfs_fh * fh; | |
1050 | struct nfs_fattr * fattr; | |
1051 | struct nfs4_change_info dir_cinfo; | |
1052 | }; | |
1053 | ||
1054 | struct nfs4_fsinfo_arg { | |
62ae082d | 1055 | struct nfs4_sequence_args seq_args; |
1da177e4 LT |
1056 | const struct nfs_fh * fh; |
1057 | const u32 * bitmask; | |
1058 | }; | |
1059 | ||
3dda5e43 | 1060 | struct nfs4_fsinfo_res { |
3dda5e43 | 1061 | struct nfs4_sequence_res seq_res; |
62ae082d | 1062 | struct nfs_fsinfo *fsinfo; |
3dda5e43 BH |
1063 | }; |
1064 | ||
1da177e4 | 1065 | struct nfs4_getattr_arg { |
62ae082d | 1066 | struct nfs4_sequence_args seq_args; |
1da177e4 LT |
1067 | const struct nfs_fh * fh; |
1068 | const u32 * bitmask; | |
1069 | }; | |
1070 | ||
1071 | struct nfs4_getattr_res { | |
62ae082d | 1072 | struct nfs4_sequence_res seq_res; |
1da177e4 LT |
1073 | const struct nfs_server * server; |
1074 | struct nfs_fattr * fattr; | |
1075 | }; | |
1076 | ||
1077 | struct nfs4_link_arg { | |
62ae082d | 1078 | struct nfs4_sequence_args seq_args; |
1da177e4 LT |
1079 | const struct nfs_fh * fh; |
1080 | const struct nfs_fh * dir_fh; | |
1081 | const struct qstr * name; | |
91ba2eee TM |
1082 | const u32 * bitmask; |
1083 | }; | |
1084 | ||
1085 | struct nfs4_link_res { | |
62ae082d | 1086 | struct nfs4_sequence_res seq_res; |
91ba2eee TM |
1087 | const struct nfs_server * server; |
1088 | struct nfs_fattr * fattr; | |
1089 | struct nfs4_change_info cinfo; | |
1090 | struct nfs_fattr * dir_attr; | |
1da177e4 LT |
1091 | }; |
1092 | ||
1093 | struct nfs4_lookup_arg { | |
62ae082d | 1094 | struct nfs4_sequence_args seq_args; |
1da177e4 LT |
1095 | const struct nfs_fh * dir_fh; |
1096 | const struct qstr * name; | |
1097 | const u32 * bitmask; | |
1098 | }; | |
1099 | ||
1100 | struct nfs4_lookup_res { | |
62ae082d | 1101 | struct nfs4_sequence_res seq_res; |
1da177e4 LT |
1102 | const struct nfs_server * server; |
1103 | struct nfs_fattr * fattr; | |
1104 | struct nfs_fh * fh; | |
1105 | }; | |
1106 | ||
5b5faaf6 JL |
1107 | struct nfs4_lookupp_arg { |
1108 | struct nfs4_sequence_args seq_args; | |
1109 | const struct nfs_fh *fh; | |
1110 | const u32 *bitmask; | |
1111 | }; | |
1112 | ||
1113 | struct nfs4_lookupp_res { | |
1114 | struct nfs4_sequence_res seq_res; | |
1115 | const struct nfs_server *server; | |
1116 | struct nfs_fattr *fattr; | |
1117 | struct nfs_fh *fh; | |
5b5faaf6 JL |
1118 | }; |
1119 | ||
1da177e4 | 1120 | struct nfs4_lookup_root_arg { |
9ff71c3a | 1121 | struct nfs4_sequence_args seq_args; |
62ae082d | 1122 | const u32 * bitmask; |
1da177e4 LT |
1123 | }; |
1124 | ||
1125 | struct nfs4_pathconf_arg { | |
62ae082d | 1126 | struct nfs4_sequence_args seq_args; |
1da177e4 LT |
1127 | const struct nfs_fh * fh; |
1128 | const u32 * bitmask; | |
1129 | }; | |
1130 | ||
d45b2989 | 1131 | struct nfs4_pathconf_res { |
d45b2989 | 1132 | struct nfs4_sequence_res seq_res; |
62ae082d | 1133 | struct nfs_pathconf *pathconf; |
d45b2989 BH |
1134 | }; |
1135 | ||
1da177e4 | 1136 | struct nfs4_readdir_arg { |
62ae082d | 1137 | struct nfs4_sequence_args seq_args; |
1da177e4 LT |
1138 | const struct nfs_fh * fh; |
1139 | u64 cookie; | |
1140 | nfs4_verifier verifier; | |
1141 | u32 count; | |
1142 | struct page ** pages; /* zero-copy data */ | |
1143 | unsigned int pgbase; /* zero-copy data */ | |
1144 | const u32 * bitmask; | |
a7a3b1e9 | 1145 | bool plus; |
1da177e4 LT |
1146 | }; |
1147 | ||
1148 | struct nfs4_readdir_res { | |
62ae082d | 1149 | struct nfs4_sequence_res seq_res; |
1da177e4 LT |
1150 | nfs4_verifier verifier; |
1151 | unsigned int pgbase; | |
1152 | }; | |
1153 | ||
1154 | struct nfs4_readlink { | |
62ae082d | 1155 | struct nfs4_sequence_args seq_args; |
1da177e4 LT |
1156 | const struct nfs_fh * fh; |
1157 | unsigned int pgbase; | |
1158 | unsigned int pglen; /* zero-copy data */ | |
1159 | struct page ** pages; /* zero-copy data */ | |
1160 | }; | |
1161 | ||
f50c7000 BH |
1162 | struct nfs4_readlink_res { |
1163 | struct nfs4_sequence_res seq_res; | |
1164 | }; | |
1165 | ||
1da177e4 | 1166 | struct nfs4_setclientid { |
cc38bac3 | 1167 | const nfs4_verifier * sc_verifier; |
cc38bac3 | 1168 | u32 sc_prog; |
1da177e4 | 1169 | unsigned int sc_netid_len; |
d1ce02e1 | 1170 | char sc_netid[RPCBIND_MAXNETIDLEN + 1]; |
1da177e4 | 1171 | unsigned int sc_uaddr_len; |
d1ce02e1 | 1172 | char sc_uaddr[RPCBIND_MAXUADDRLEN + 1]; |
3a6bb738 | 1173 | struct nfs_client *sc_clnt; |
f11b2a1c | 1174 | struct rpc_cred *sc_cred; |
1da177e4 LT |
1175 | }; |
1176 | ||
bb8b27e5 TM |
1177 | struct nfs4_setclientid_res { |
1178 | u64 clientid; | |
1179 | nfs4_verifier confirm; | |
1180 | }; | |
1181 | ||
1da177e4 | 1182 | struct nfs4_statfs_arg { |
62ae082d | 1183 | struct nfs4_sequence_args seq_args; |
1da177e4 LT |
1184 | const struct nfs_fh * fh; |
1185 | const u32 * bitmask; | |
1186 | }; | |
1187 | ||
24ad148a | 1188 | struct nfs4_statfs_res { |
24ad148a | 1189 | struct nfs4_sequence_res seq_res; |
62ae082d | 1190 | struct nfs_fsstat *fsstat; |
24ad148a BH |
1191 | }; |
1192 | ||
43652ad5 | 1193 | struct nfs4_server_caps_arg { |
43652ad5 | 1194 | struct nfs4_sequence_args seq_args; |
62ae082d | 1195 | struct nfs_fh *fhandle; |
8c61282f | 1196 | const u32 * bitmask; |
43652ad5 BH |
1197 | }; |
1198 | ||
1da177e4 | 1199 | struct nfs4_server_caps_res { |
62ae082d | 1200 | struct nfs4_sequence_res seq_res; |
dae100c2 | 1201 | u32 attr_bitmask[3]; |
8c61282f | 1202 | u32 exclcreat_bitmask[3]; |
1da177e4 LT |
1203 | u32 acl_bitmask; |
1204 | u32 has_links; | |
1205 | u32 has_symlinks; | |
264e6351 | 1206 | u32 fh_expire_type; |
1ab5be4a TM |
1207 | u32 case_insensitive; |
1208 | u32 case_preserving; | |
1da177e4 LT |
1209 | }; |
1210 | ||
7aaa0b3b MN |
1211 | #define NFS4_PATHNAME_MAXCOMPONENTS 512 |
1212 | struct nfs4_pathname { | |
1213 | unsigned int ncomponents; | |
1214 | struct nfs4_string components[NFS4_PATHNAME_MAXCOMPONENTS]; | |
1215 | }; | |
1216 | ||
1217 | #define NFS4_FS_LOCATION_MAXSERVERS 10 | |
1218 | struct nfs4_fs_location { | |
1219 | unsigned int nservers; | |
1220 | struct nfs4_string servers[NFS4_FS_LOCATION_MAXSERVERS]; | |
1221 | struct nfs4_pathname rootpath; | |
1222 | }; | |
1223 | ||
1224 | #define NFS4_FS_LOCATIONS_MAXENTRIES 10 | |
1225 | struct nfs4_fs_locations { | |
c3ed2227 | 1226 | struct nfs_fattr *fattr; |
683b57b4 | 1227 | const struct nfs_server *server; |
7aaa0b3b | 1228 | struct nfs4_pathname fs_path; |
683b57b4 | 1229 | int nlocations; |
7aaa0b3b | 1230 | struct nfs4_fs_location locations[NFS4_FS_LOCATIONS_MAXENTRIES]; |
683b57b4 TM |
1231 | }; |
1232 | ||
1233 | struct nfs4_fs_locations_arg { | |
62ae082d | 1234 | struct nfs4_sequence_args seq_args; |
683b57b4 | 1235 | const struct nfs_fh *dir_fh; |
b03d735b | 1236 | const struct nfs_fh *fh; |
683b57b4 TM |
1237 | const struct qstr *name; |
1238 | struct page *page; | |
1239 | const u32 *bitmask; | |
b03d735b CL |
1240 | clientid4 clientid; |
1241 | unsigned char migration:1, renew:1; | |
683b57b4 TM |
1242 | }; |
1243 | ||
22958463 | 1244 | struct nfs4_fs_locations_res { |
22958463 | 1245 | struct nfs4_sequence_res seq_res; |
62ae082d | 1246 | struct nfs4_fs_locations *fs_locations; |
b03d735b | 1247 | unsigned char migration:1, renew:1; |
22958463 BH |
1248 | }; |
1249 | ||
fb15b26f CL |
1250 | struct nfs4_secinfo4 { |
1251 | u32 flavor; | |
1252 | struct rpcsec_gss_info flavor_info; | |
5a5ea0d4 BS |
1253 | }; |
1254 | ||
1255 | struct nfs4_secinfo_flavors { | |
fb15b26f | 1256 | unsigned int num_flavors; |
1ad8dd93 | 1257 | struct nfs4_secinfo4 flavors[]; |
5a5ea0d4 BS |
1258 | }; |
1259 | ||
1260 | struct nfs4_secinfo_arg { | |
62ae082d | 1261 | struct nfs4_sequence_args seq_args; |
5a5ea0d4 BS |
1262 | const struct nfs_fh *dir_fh; |
1263 | const struct qstr *name; | |
5a5ea0d4 BS |
1264 | }; |
1265 | ||
1266 | struct nfs4_secinfo_res { | |
5a5ea0d4 | 1267 | struct nfs4_sequence_res seq_res; |
62ae082d | 1268 | struct nfs4_secinfo_flavors *flavors; |
5a5ea0d4 BS |
1269 | }; |
1270 | ||
44c99933 CL |
1271 | struct nfs4_fsid_present_arg { |
1272 | struct nfs4_sequence_args seq_args; | |
1273 | const struct nfs_fh *fh; | |
1274 | clientid4 clientid; | |
1275 | unsigned char renew:1; | |
1276 | }; | |
1277 | ||
1278 | struct nfs4_fsid_present_res { | |
1279 | struct nfs4_sequence_res seq_res; | |
1280 | struct nfs_fh *fh; | |
1281 | unsigned char renew:1; | |
1282 | }; | |
1283 | ||
1da177e4 LT |
1284 | #endif /* CONFIG_NFS_V4 */ |
1285 | ||
99fe60d0 BH |
1286 | struct nfstime4 { |
1287 | u64 seconds; | |
1288 | u32 nseconds; | |
1289 | }; | |
1290 | ||
1291 | #ifdef CONFIG_NFS_V4_1 | |
ea2cf228 FI |
1292 | |
1293 | struct pnfs_commit_bucket { | |
1294 | struct list_head written; | |
1295 | struct list_head committing; | |
c84bea59 | 1296 | struct pnfs_layout_segment *lseg; |
5002c586 | 1297 | struct nfs_writeverf direct_verf; |
ea2cf228 FI |
1298 | }; |
1299 | ||
d7242c46 TM |
1300 | struct pnfs_commit_array { |
1301 | struct list_head cinfo_list; | |
1302 | struct list_head lseg_list; | |
1303 | struct pnfs_layout_segment *lseg; | |
1304 | struct rcu_head rcu; | |
a9901899 | 1305 | refcount_t refcount; |
d7242c46 TM |
1306 | unsigned int nbuckets; |
1307 | struct pnfs_commit_bucket buckets[]; | |
1308 | }; | |
1309 | ||
ea2cf228 | 1310 | struct pnfs_ds_commit_info { |
c21e7168 | 1311 | struct list_head commits; |
d7242c46 TM |
1312 | unsigned int nwritten; |
1313 | unsigned int ncommitting; | |
9c455a8c | 1314 | const struct pnfs_commit_ops *ops; |
ea2cf228 FI |
1315 | }; |
1316 | ||
2031cd1a WAA |
1317 | struct nfs41_state_protection { |
1318 | u32 how; | |
1319 | struct nfs4_op_map enforce; | |
1320 | struct nfs4_op_map allow; | |
1321 | }; | |
1322 | ||
99fe60d0 BH |
1323 | struct nfs41_exchange_id_args { |
1324 | struct nfs_client *client; | |
fd40559c | 1325 | nfs4_verifier verifier; |
99fe60d0 | 1326 | u32 flags; |
2031cd1a | 1327 | struct nfs41_state_protection state_protect; |
99fe60d0 BH |
1328 | }; |
1329 | ||
acdeb69d | 1330 | struct nfs41_server_owner { |
99fe60d0 BH |
1331 | uint64_t minor_id; |
1332 | uint32_t major_id_sz; | |
1333 | char major_id[NFS4_OPAQUE_LIMIT]; | |
1334 | }; | |
1335 | ||
79d4e1f0 | 1336 | struct nfs41_server_scope { |
99fe60d0 BH |
1337 | uint32_t server_scope_sz; |
1338 | char server_scope[NFS4_OPAQUE_LIMIT]; | |
1339 | }; | |
1340 | ||
7d2ed9ac WAA |
1341 | struct nfs41_impl_id { |
1342 | char domain[NFS4_OPAQUE_LIMIT + 1]; | |
1343 | char name[NFS4_OPAQUE_LIMIT + 1]; | |
1344 | struct nfstime4 date; | |
1345 | }; | |
1346 | ||
dff58530 | 1347 | #define MAX_BIND_CONN_TO_SESSION_RETRIES 3 |
71a097c6 TM |
1348 | struct nfs41_bind_conn_to_session_args { |
1349 | struct nfs_client *client; | |
1350 | struct nfs4_sessionid sessionid; | |
1351 | u32 dir; | |
1352 | bool use_conn_in_rdma_mode; | |
dff58530 | 1353 | int retries; |
71a097c6 TM |
1354 | }; |
1355 | ||
7c44f1ae | 1356 | struct nfs41_bind_conn_to_session_res { |
71a097c6 | 1357 | struct nfs4_sessionid sessionid; |
7c44f1ae WAA |
1358 | u32 dir; |
1359 | bool use_conn_in_rdma_mode; | |
1360 | }; | |
1361 | ||
99fe60d0 | 1362 | struct nfs41_exchange_id_res { |
32b01310 TM |
1363 | u64 clientid; |
1364 | u32 seqid; | |
99fe60d0 | 1365 | u32 flags; |
acdeb69d | 1366 | struct nfs41_server_owner *server_owner; |
79d4e1f0 | 1367 | struct nfs41_server_scope *server_scope; |
7d2ed9ac | 1368 | struct nfs41_impl_id *impl_id; |
2031cd1a | 1369 | struct nfs41_state_protection state_protect; |
99fe60d0 | 1370 | }; |
fc931582 AA |
1371 | |
1372 | struct nfs41_create_session_args { | |
1373 | struct nfs_client *client; | |
79969dd1 TM |
1374 | u64 clientid; |
1375 | uint32_t seqid; | |
fc931582 AA |
1376 | uint32_t flags; |
1377 | uint32_t cb_program; | |
1378 | struct nfs4_channel_attrs fc_attrs; /* Fore Channel */ | |
1379 | struct nfs4_channel_attrs bc_attrs; /* Back Channel */ | |
1380 | }; | |
1381 | ||
1382 | struct nfs41_create_session_res { | |
79969dd1 TM |
1383 | struct nfs4_sessionid sessionid; |
1384 | uint32_t seqid; | |
1385 | uint32_t flags; | |
1386 | struct nfs4_channel_attrs fc_attrs; /* Fore Channel */ | |
1387 | struct nfs4_channel_attrs bc_attrs; /* Back Channel */ | |
fc931582 | 1388 | }; |
18019753 RL |
1389 | |
1390 | struct nfs41_reclaim_complete_args { | |
62ae082d | 1391 | struct nfs4_sequence_args seq_args; |
18019753 RL |
1392 | /* In the future extend to include curr_fh for use with migration */ |
1393 | unsigned char one_fs:1; | |
18019753 RL |
1394 | }; |
1395 | ||
1396 | struct nfs41_reclaim_complete_res { | |
1397 | struct nfs4_sequence_res seq_res; | |
1398 | }; | |
fca78d6d BS |
1399 | |
1400 | #define SECINFO_STYLE_CURRENT_FH 0 | |
1401 | #define SECINFO_STYLE_PARENT 1 | |
1402 | struct nfs41_secinfo_no_name_args { | |
fca78d6d | 1403 | struct nfs4_sequence_args seq_args; |
62ae082d | 1404 | int style; |
fca78d6d BS |
1405 | }; |
1406 | ||
7d974794 | 1407 | struct nfs41_test_stateid_args { |
7d974794 | 1408 | struct nfs4_sequence_args seq_args; |
62ae082d | 1409 | nfs4_stateid *stateid; |
7d974794 BS |
1410 | }; |
1411 | ||
1412 | struct nfs41_test_stateid_res { | |
7d974794 | 1413 | struct nfs4_sequence_res seq_res; |
62ae082d | 1414 | unsigned int status; |
7d974794 BS |
1415 | }; |
1416 | ||
9aeda35f | 1417 | struct nfs41_free_stateid_args { |
9aeda35f | 1418 | struct nfs4_sequence_args seq_args; |
7c1d5fae | 1419 | nfs4_stateid stateid; |
9aeda35f BS |
1420 | }; |
1421 | ||
1422 | struct nfs41_free_stateid_res { | |
9aeda35f | 1423 | struct nfs4_sequence_res seq_res; |
62ae082d | 1424 | unsigned int status; |
9aeda35f BS |
1425 | }; |
1426 | ||
4f97615d TM |
1427 | #else |
1428 | ||
1429 | struct pnfs_ds_commit_info { | |
1430 | }; | |
1431 | ||
99fe60d0 BH |
1432 | #endif /* CONFIG_NFS_V4_1 */ |
1433 | ||
1c6dcbe5 | 1434 | #ifdef CONFIG_NFS_V4_2 |
f4ac1674 AS |
1435 | struct nfs42_falloc_args { |
1436 | struct nfs4_sequence_args seq_args; | |
1437 | ||
1438 | struct nfs_fh *falloc_fh; | |
1439 | nfs4_stateid falloc_stateid; | |
1440 | u64 falloc_offset; | |
1441 | u64 falloc_length; | |
9a51940b | 1442 | const u32 *falloc_bitmask; |
f4ac1674 AS |
1443 | }; |
1444 | ||
1445 | struct nfs42_falloc_res { | |
1446 | struct nfs4_sequence_res seq_res; | |
1447 | unsigned int status; | |
9a51940b AS |
1448 | |
1449 | struct nfs_fattr *falloc_fattr; | |
1450 | const struct nfs_server *falloc_server; | |
f4ac1674 AS |
1451 | }; |
1452 | ||
2e72448b AS |
1453 | struct nfs42_copy_args { |
1454 | struct nfs4_sequence_args seq_args; | |
1455 | ||
1456 | struct nfs_fh *src_fh; | |
1457 | nfs4_stateid src_stateid; | |
1458 | u64 src_pos; | |
1459 | ||
1460 | struct nfs_fh *dst_fh; | |
1461 | nfs4_stateid dst_stateid; | |
1462 | u64 dst_pos; | |
1463 | ||
1464 | u64 count; | |
62164f31 | 1465 | bool sync; |
1d38f3f0 | 1466 | struct nl4_server *cp_src; |
2e72448b AS |
1467 | }; |
1468 | ||
1469 | struct nfs42_write_res { | |
67aa7444 | 1470 | nfs4_stateid stateid; |
2e72448b AS |
1471 | u64 count; |
1472 | struct nfs_writeverf verifier; | |
1473 | }; | |
1474 | ||
1475 | struct nfs42_copy_res { | |
1476 | struct nfs4_sequence_res seq_res; | |
1477 | struct nfs42_write_res write_res; | |
1478 | bool consecutive; | |
1479 | bool synchronous; | |
e0926934 | 1480 | struct nfs_commitres commit_res; |
2e72448b AS |
1481 | }; |
1482 | ||
cb95deea OK |
1483 | struct nfs42_offload_status_args { |
1484 | struct nfs4_sequence_args osa_seq_args; | |
1485 | struct nfs_fh *osa_src_fh; | |
1486 | nfs4_stateid osa_stateid; | |
1487 | }; | |
1488 | ||
1489 | struct nfs42_offload_status_res { | |
1490 | struct nfs4_sequence_res osr_seq_res; | |
1491 | uint64_t osr_count; | |
1492 | int osr_status; | |
1493 | }; | |
1494 | ||
0491567b OK |
1495 | struct nfs42_copy_notify_args { |
1496 | struct nfs4_sequence_args cna_seq_args; | |
1497 | ||
1498 | struct nfs_fh *cna_src_fh; | |
1499 | nfs4_stateid cna_src_stateid; | |
1500 | struct nl4_server cna_dst; | |
1501 | }; | |
1502 | ||
1503 | struct nfs42_copy_notify_res { | |
1504 | struct nfs4_sequence_res cnr_seq_res; | |
1505 | ||
1506 | struct nfstime4 cnr_lease_time; | |
1507 | nfs4_stateid cnr_stateid; | |
1508 | struct nl4_server cnr_src; | |
1509 | }; | |
1510 | ||
1c6dcbe5 AS |
1511 | struct nfs42_seek_args { |
1512 | struct nfs4_sequence_args seq_args; | |
1513 | ||
1514 | struct nfs_fh *sa_fh; | |
1515 | nfs4_stateid sa_stateid; | |
1516 | u64 sa_offset; | |
1517 | u32 sa_what; | |
1518 | }; | |
1519 | ||
1520 | struct nfs42_seek_res { | |
1521 | struct nfs4_sequence_res seq_res; | |
1522 | unsigned int status; | |
1523 | ||
1524 | u32 sr_eof; | |
1525 | u64 sr_offset; | |
1526 | }; | |
3e1f0212 FL |
1527 | |
1528 | struct nfs42_setxattrargs { | |
1529 | struct nfs4_sequence_args seq_args; | |
1530 | struct nfs_fh *fh; | |
1531 | const char *xattr_name; | |
1532 | u32 xattr_flags; | |
1533 | size_t xattr_len; | |
1534 | struct page **xattr_pages; | |
1535 | }; | |
1536 | ||
1537 | struct nfs42_setxattrres { | |
1538 | struct nfs4_sequence_res seq_res; | |
1539 | struct nfs4_change_info cinfo; | |
1540 | }; | |
1541 | ||
1542 | struct nfs42_getxattrargs { | |
1543 | struct nfs4_sequence_args seq_args; | |
1544 | struct nfs_fh *fh; | |
1545 | const char *xattr_name; | |
1546 | size_t xattr_len; | |
1547 | struct page **xattr_pages; | |
1548 | }; | |
1549 | ||
1550 | struct nfs42_getxattrres { | |
1551 | struct nfs4_sequence_res seq_res; | |
1552 | size_t xattr_len; | |
1553 | }; | |
1554 | ||
1555 | struct nfs42_listxattrsargs { | |
1556 | struct nfs4_sequence_args seq_args; | |
1557 | struct nfs_fh *fh; | |
1558 | u32 count; | |
1559 | u64 cookie; | |
1560 | struct page **xattr_pages; | |
1561 | }; | |
1562 | ||
1563 | struct nfs42_listxattrsres { | |
1564 | struct nfs4_sequence_res seq_res; | |
1565 | struct page *scratch; | |
1566 | void *xattr_buf; | |
1567 | size_t xattr_len; | |
1568 | u64 cookie; | |
1569 | bool eof; | |
1570 | size_t copied; | |
1571 | }; | |
1572 | ||
1573 | struct nfs42_removexattrargs { | |
1574 | struct nfs4_sequence_args seq_args; | |
1575 | struct nfs_fh *fh; | |
1576 | const char *xattr_name; | |
1577 | }; | |
1578 | ||
1579 | struct nfs42_removexattrres { | |
1580 | struct nfs4_sequence_res seq_res; | |
1581 | struct nfs4_change_info cinfo; | |
1582 | }; | |
1583 | ||
1584 | #endif /* CONFIG_NFS_V4_2 */ | |
1c6dcbe5 | 1585 | |
1da177e4 LT |
1586 | struct nfs_page; |
1587 | ||
40859d7e CL |
1588 | #define NFS_PAGEVEC_SIZE (8U) |
1589 | ||
30dd374f FI |
1590 | struct nfs_page_array { |
1591 | struct page **pagevec; | |
1592 | unsigned int npages; /* Max length of pagevec */ | |
1593 | struct page *page_array[NFS_PAGEVEC_SIZE]; | |
1594 | }; | |
1595 | ||
4db6e0b7 FI |
1596 | /* used as flag bits in nfs_pgio_header */ |
1597 | enum { | |
1598 | NFS_IOHDR_ERROR = 0, | |
1599 | NFS_IOHDR_EOF, | |
1600 | NFS_IOHDR_REDO, | |
37e9ed22 | 1601 | NFS_IOHDR_STAT, |
42f86b44 TM |
1602 | NFS_IOHDR_RESEND_PNFS, |
1603 | NFS_IOHDR_RESEND_MDS, | |
69d96651 | 1604 | NFS_IOHDR_UNSTABLE_WRITES, |
4db6e0b7 FI |
1605 | }; |
1606 | ||
919e3bd9 | 1607 | struct nfs_io_completion; |
cd841605 FI |
1608 | struct nfs_pgio_header { |
1609 | struct inode *inode; | |
a52458b4 | 1610 | const struct cred *cred; |
cd841605 FI |
1611 | struct list_head pages; |
1612 | struct nfs_page *req; | |
f79d06f5 | 1613 | struct nfs_writeverf verf; /* Used for writes */ |
fbe77c30 | 1614 | fmode_t rw_mode; |
cd841605 | 1615 | struct pnfs_layout_segment *lseg; |
4db6e0b7 | 1616 | loff_t io_start; |
cd841605 | 1617 | const struct rpc_call_ops *mds_ops; |
4db6e0b7 | 1618 | void (*release) (struct nfs_pgio_header *hdr); |
061ae2ed | 1619 | const struct nfs_pgio_completion_ops *completion_ops; |
4a0de55c | 1620 | const struct nfs_rw_ops *rw_ops; |
919e3bd9 | 1621 | struct nfs_io_completion *io_completion; |
584aa810 | 1622 | struct nfs_direct_req *dreq; |
000dbe0b DW |
1623 | #ifdef CONFIG_NFS_FSCACHE |
1624 | void *netfs; | |
1625 | #endif | |
1c6c4b74 | 1626 | |
cd841605 | 1627 | int pnfs_error; |
4db6e0b7 | 1628 | int error; /* merge with pnfs_error */ |
1c6c4b74 | 1629 | unsigned int good_bytes; /* boundary of good data */ |
4db6e0b7 | 1630 | unsigned long flags; |
d45f60c6 WAA |
1631 | |
1632 | /* | |
1633 | * rpc data | |
1634 | */ | |
1635 | struct rpc_task task; | |
1636 | struct nfs_fattr fattr; | |
d45f60c6 WAA |
1637 | struct nfs_pgio_args args; /* argument struct */ |
1638 | struct nfs_pgio_res res; /* result struct */ | |
1639 | unsigned long timestamp; /* For lease renewal */ | |
1640 | int (*pgio_done_cb)(struct rpc_task *, struct nfs_pgio_header *); | |
1641 | __u64 mds_offset; /* Filelayout dense stripe */ | |
1642 | struct nfs_page_array page_array; | |
1643 | struct nfs_client *ds_clp; /* pNFS data server */ | |
c754e137 TM |
1644 | u32 ds_commit_idx; /* ds index if ds_clp is set */ |
1645 | u32 pgio_mirror_idx;/* mirror index in pgio layer */ | |
cd841605 FI |
1646 | }; |
1647 | ||
ea2cf228 FI |
1648 | struct nfs_mds_commit_info { |
1649 | atomic_t rpcs_out; | |
5cb953d4 | 1650 | atomic_long_t ncommit; |
ea2cf228 FI |
1651 | struct list_head list; |
1652 | }; | |
1653 | ||
b20135d0 | 1654 | struct nfs_commit_info; |
f453a54a FI |
1655 | struct nfs_commit_data; |
1656 | struct nfs_inode; | |
1657 | struct nfs_commit_completion_ops { | |
f453a54a | 1658 | void (*completion) (struct nfs_commit_data *data); |
b20135d0 | 1659 | void (*resched_write) (struct nfs_commit_info *, struct nfs_page *); |
f453a54a FI |
1660 | }; |
1661 | ||
ea2cf228 | 1662 | struct nfs_commit_info { |
fe238e60 | 1663 | struct inode *inode; /* Needed for inode->i_lock */ |
ea2cf228 FI |
1664 | struct nfs_mds_commit_info *mds; |
1665 | struct pnfs_ds_commit_info *ds; | |
b359f9d0 | 1666 | struct nfs_direct_req *dreq; /* O_DIRECT request */ |
f453a54a | 1667 | const struct nfs_commit_completion_ops *completion_ops; |
ea2cf228 FI |
1668 | }; |
1669 | ||
0b7c0153 FI |
1670 | struct nfs_commit_data { |
1671 | struct rpc_task task; | |
1672 | struct inode *inode; | |
a52458b4 | 1673 | const struct cred *cred; |
0b7c0153 FI |
1674 | struct nfs_fattr fattr; |
1675 | struct nfs_writeverf verf; | |
1676 | struct list_head pages; /* Coalesced requests we wish to flush */ | |
1677 | struct list_head list; /* lists of struct nfs_write_data */ | |
1678 | struct nfs_direct_req *dreq; /* O_DIRECT request */ | |
1679 | struct nfs_commitargs args; /* argument struct */ | |
1680 | struct nfs_commitres res; /* result struct */ | |
1681 | struct nfs_open_context *context; | |
1682 | struct pnfs_layout_segment *lseg; | |
1683 | struct nfs_client *ds_clp; /* pNFS data server */ | |
1684 | int ds_commit_index; | |
378520b8 | 1685 | loff_t lwb; |
0b7c0153 | 1686 | const struct rpc_call_ops *mds_ops; |
f453a54a | 1687 | const struct nfs_commit_completion_ops *completion_ops; |
0b7c0153 | 1688 | int (*commit_done_cb) (struct rpc_task *task, struct nfs_commit_data *data); |
37e9ed22 | 1689 | unsigned long flags; |
0b7c0153 FI |
1690 | }; |
1691 | ||
061ae2ed | 1692 | struct nfs_pgio_completion_ops { |
df3accb8 | 1693 | void (*error_cleanup)(struct list_head *head, int); |
584aa810 | 1694 | void (*init_hdr)(struct nfs_pgio_header *hdr); |
061ae2ed | 1695 | void (*completion)(struct nfs_pgio_header *hdr); |
dc602dd7 | 1696 | void (*reschedule_io)(struct nfs_pgio_header *hdr); |
061ae2ed FI |
1697 | }; |
1698 | ||
34e137cc | 1699 | struct nfs_unlinkdata { |
34e137cc BS |
1700 | struct nfs_removeargs args; |
1701 | struct nfs_removeres res; | |
884be175 AV |
1702 | struct dentry *dentry; |
1703 | wait_queue_head_t wq; | |
a52458b4 | 1704 | const struct cred *cred; |
34e137cc | 1705 | struct nfs_fattr dir_attr; |
8478eaa1 | 1706 | long timeout; |
34e137cc BS |
1707 | }; |
1708 | ||
c6bfa1a1 BS |
1709 | struct nfs_renamedata { |
1710 | struct nfs_renameargs args; | |
1711 | struct nfs_renameres res; | |
88dee0cc | 1712 | struct rpc_task task; |
a52458b4 | 1713 | const struct cred *cred; |
c6bfa1a1 BS |
1714 | struct inode *old_dir; |
1715 | struct dentry *old_dentry; | |
1716 | struct nfs_fattr old_fattr; | |
1717 | struct inode *new_dir; | |
1718 | struct dentry *new_dentry; | |
1719 | struct nfs_fattr new_fattr; | |
96f9d8c0 | 1720 | void (*complete)(struct rpc_task *, struct nfs_renamedata *); |
8478eaa1 | 1721 | long timeout; |
818a8dbe | 1722 | bool cancelled; |
c6bfa1a1 BS |
1723 | }; |
1724 | ||
1da177e4 | 1725 | struct nfs_access_entry; |
45a52a02 | 1726 | struct nfs_client; |
e0dca7a0 | 1727 | struct rpc_timeout; |
ff9099f2 BS |
1728 | struct nfs_subversion; |
1729 | struct nfs_mount_info; | |
6663ee7f | 1730 | struct nfs_client_initdata; |
1abb5088 | 1731 | struct nfs_pageio_descriptor; |
f2aedb71 | 1732 | struct fs_context; |
1da177e4 LT |
1733 | |
1734 | /* | |
1735 | * RPC procedure vector for NFSv2/NFSv3 demuxing | |
1736 | */ | |
1737 | struct nfs_rpc_ops { | |
c0e07cb6 | 1738 | u32 version; /* Protocol version */ |
f786aa90 | 1739 | const struct dentry_operations *dentry_ops; |
c5ef1c42 AV |
1740 | const struct inode_operations *dir_inode_ops; |
1741 | const struct inode_operations *file_inode_ops; | |
1788ea6e | 1742 | const struct file_operations *file_ops; |
b1ece737 | 1743 | const struct nlmclnt_operations *nlmclnt_ops; |
1da177e4 LT |
1744 | |
1745 | int (*getroot) (struct nfs_server *, struct nfs_fh *, | |
1746 | struct nfs_fsinfo *); | |
f2aedb71 DH |
1747 | int (*submount) (struct fs_context *, struct nfs_server *); |
1748 | int (*try_get_tree) (struct fs_context *); | |
1da177e4 | 1749 | int (*getattr) (struct nfs_server *, struct nfs_fh *, |
2ef61e0e | 1750 | struct nfs_fattr *, struct inode *); |
1da177e4 LT |
1751 | int (*setattr) (struct dentry *, struct nfs_fattr *, |
1752 | struct iattr *); | |
f7b37b8b | 1753 | int (*lookup) (struct inode *, struct dentry *, |
9558a007 | 1754 | struct nfs_fh *, struct nfs_fattr *); |
5b5faaf6 | 1755 | int (*lookupp) (struct inode *, struct nfs_fh *, |
ba4bc8dc | 1756 | struct nfs_fattr *); |
73fbb3fa | 1757 | int (*access) (struct inode *, struct nfs_access_entry *, const struct cred *); |
1da177e4 LT |
1758 | int (*readlink)(struct inode *, struct page *, unsigned int, |
1759 | unsigned int); | |
1da177e4 | 1760 | int (*create) (struct inode *, struct dentry *, |
8867fe58 | 1761 | struct iattr *, int); |
912678db | 1762 | int (*remove) (struct inode *, struct dentry *); |
ed7e9ad0 | 1763 | void (*unlink_setup) (struct rpc_message *, struct dentry *, struct inode *); |
34e137cc | 1764 | void (*unlink_rpc_prepare) (struct rpc_task *, struct nfs_unlinkdata *); |
e4eff1a6 | 1765 | int (*unlink_done) (struct rpc_task *, struct inode *); |
f2c2c552 TM |
1766 | void (*rename_setup) (struct rpc_message *msg, |
1767 | struct dentry *old_dentry, | |
1768 | struct dentry *new_dentry); | |
c6bfa1a1 | 1769 | void (*rename_rpc_prepare)(struct rpc_task *task, struct nfs_renamedata *); |
d3d4152a | 1770 | int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir); |
beffb8fe | 1771 | int (*link) (struct inode *, struct inode *, const struct qstr *); |
94a6d753 CL |
1772 | int (*symlink) (struct inode *, struct dentry *, struct page *, |
1773 | unsigned int, struct iattr *); | |
1da177e4 | 1774 | int (*mkdir) (struct inode *, struct dentry *, struct iattr *); |
beffb8fe | 1775 | int (*rmdir) (struct inode *, const struct qstr *); |
82e22a5e | 1776 | int (*readdir) (struct nfs_readdir_arg *, struct nfs_readdir_res *); |
1da177e4 LT |
1777 | int (*mknod) (struct inode *, struct dentry *, struct iattr *, |
1778 | dev_t); | |
1779 | int (*statfs) (struct nfs_server *, struct nfs_fh *, | |
1780 | struct nfs_fsstat *); | |
1781 | int (*fsinfo) (struct nfs_server *, struct nfs_fh *, | |
1782 | struct nfs_fsinfo *); | |
1783 | int (*pathconf) (struct nfs_server *, struct nfs_fh *, | |
1784 | struct nfs_pathconf *); | |
e9326dca | 1785 | int (*set_capabilities)(struct nfs_server *, struct nfs_fh *); |
a7a3b1e9 | 1786 | int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, bool); |
d45f60c6 WAA |
1787 | int (*pgio_rpc_prepare)(struct rpc_task *, |
1788 | struct nfs_pgio_header *); | |
1789 | void (*read_setup)(struct nfs_pgio_header *, struct rpc_message *); | |
1790 | int (*read_done)(struct rpc_task *, struct nfs_pgio_header *); | |
fb91fb0e AS |
1791 | void (*write_setup)(struct nfs_pgio_header *, struct rpc_message *, |
1792 | struct rpc_clnt **); | |
d45f60c6 | 1793 | int (*write_done)(struct rpc_task *, struct nfs_pgio_header *); |
e9ae1ee2 AS |
1794 | void (*commit_setup) (struct nfs_commit_data *, struct rpc_message *, |
1795 | struct rpc_clnt **); | |
0b7c0153 FI |
1796 | void (*commit_rpc_prepare)(struct rpc_task *, struct nfs_commit_data *); |
1797 | int (*commit_done) (struct rpc_task *, struct nfs_commit_data *); | |
1da177e4 | 1798 | int (*lock)(struct file *, int, struct file_lock *); |
2116271a | 1799 | int (*lock_check_bounds)(const struct file_lock *); |
ada70d94 | 1800 | void (*clear_acl_cache)(struct inode *); |
7fe5c398 | 1801 | void (*close_context)(struct nfs_open_context *ctx, int); |
2b484297 TM |
1802 | struct inode * (*open_context) (struct inode *dir, |
1803 | struct nfs_open_context *ctx, | |
1804 | int open_flags, | |
5bc2afc2 TM |
1805 | struct iattr *iattr, |
1806 | int *); | |
011e2a7f | 1807 | int (*have_delegation)(struct inode *, fmode_t); |
6663ee7f | 1808 | struct nfs_client *(*alloc_client) (const struct nfs_client_initdata *); |
5c6e5b60 TM |
1809 | struct nfs_client *(*init_client) (struct nfs_client *, |
1810 | const struct nfs_client_initdata *); | |
cdb7eced | 1811 | void (*free_client) (struct nfs_client *); |
62a55d08 | 1812 | struct nfs_server *(*create_server)(struct fs_context *); |
1179acc6 BS |
1813 | struct nfs_server *(*clone_server)(struct nfs_server *, struct nfs_fh *, |
1814 | struct nfs_fattr *, rpc_authflavor_t); | |
1976b2b3 | 1815 | int (*discover_trunking)(struct nfs_server *, struct nfs_fh *); |
4dc73c67 N |
1816 | void (*enable_swap)(struct inode *inode); |
1817 | void (*disable_swap)(struct inode *inode); | |
1da177e4 LT |
1818 | }; |
1819 | ||
1820 | /* | |
1821 | * NFS_CALL(getattr, inode, (fattr)); | |
1822 | * into | |
1823 | * NFS_PROTO(inode)->getattr(fattr); | |
1824 | */ | |
1825 | #define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args | |
1826 | ||
1827 | /* | |
1828 | * Function vectors etc. for the NFS client | |
1829 | */ | |
509de811 DH |
1830 | extern const struct nfs_rpc_ops nfs_v2_clientops; |
1831 | extern const struct nfs_rpc_ops nfs_v3_clientops; | |
1832 | extern const struct nfs_rpc_ops nfs_v4_clientops; | |
a613fa16 TM |
1833 | extern const struct rpc_version nfs_version2; |
1834 | extern const struct rpc_version nfs_version3; | |
1835 | extern const struct rpc_version nfs_version4; | |
1da177e4 | 1836 | |
a613fa16 TM |
1837 | extern const struct rpc_version nfsacl_version3; |
1838 | extern const struct rpc_program nfsacl_program; | |
b7fa0554 | 1839 | |
1da177e4 | 1840 | #endif |