Merge tag 'sched_ext-for-6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tj...
[linux-2.6-block.git] / include / linux / nfs_xdr.h
CommitLineData
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
20struct nfs4_string {
21 unsigned int len;
22 char *data;
23};
24
8b4bdcf8
TM
25struct 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 */
33static 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
38struct 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 47struct 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 */
139struct 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
160struct 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
170struct 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
178struct 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
184struct nfs4_change_info {
185 u32 atomic;
186 u64 before;
187 u64 after;
188};
189
cee54fc9 190struct nfs_seqid;
9ff71c3a 191
557134a3
AA
192/* nfs41 sessions channel attributes */
193struct 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 201struct nfs4_slot;
9ff71c3a 202struct 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
208struct 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
217struct nfs4_get_lease_time_args {
218 struct nfs4_sequence_args la_seq_args;
219};
220
221struct 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
226struct xdr_stream;
227struct nfs4_xdr_opaque_data;
228
229struct 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
235struct 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
242struct nfs4_layoutdriver_data {
35124a09
WAA
243 struct page **pages;
244 __u32 pglen;
b1f69b75 245 __u32 len;
b1f69b75
AA
246};
247
248struct pnfs_layout_range {
249 u32 iomode;
250 u64 offset;
251 u64 length;
252};
253
254struct 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
266struct 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
276struct 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
284struct 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
290struct 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 296struct 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
308struct 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
315struct 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 325struct 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
335struct nfs4_layoutreturn_res {
336 struct nfs4_sequence_res seq_res;
337 u32 lrs_present;
338 nfs4_stateid stateid;
339};
340
341struct 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
353struct nfs42_layoutstat_args;
354struct nfs42_layoutstat_devinfo;
355typedef void (*layoutstats_encode_t)(struct xdr_stream *,
356 struct nfs42_layoutstat_args *,
357 struct nfs42_layoutstat_devinfo *);
358
359/* Per file per deviceid layoutstats */
360struct 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
372struct 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
381struct nfs42_layoutstat_res {
382 struct nfs4_sequence_res seq_res;
383 int num_dev;
384 int rpc_status;
385};
386
387struct nfs42_layoutstat_data {
388 struct inode *inode;
389 struct nfs42_layoutstat_args args;
390 struct nfs42_layoutstat_res res;
3eb86093
TM
391};
392
393struct nfs42_device_error {
394 struct nfs4_deviceid dev_id;
395 int status;
396 enum nfs_opnum4 opnum;
397};
398
399struct 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
408struct 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
415struct nfs42_layouterror_res {
416 struct nfs4_sequence_res seq_res;
417 unsigned int num_errors;
418 int rpc_status;
419};
420
421struct 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
428struct 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
440struct 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
447struct stateowner_id {
448 __u64 create_time;
449 __u32 uniquifier;
450};
451
82062051
TM
452struct nfs4_open_delegation {
453 __u32 open_delegation_type;
454 union {
455 struct {
456 fmode_t type;
457 __u32 do_recall;
458 nfs4_stateid stateid;
459 unsigned long pagemod_limit;
460 };
461 struct {
462 __u32 why_no_delegation;
463 __u32 will_notify;
464 };
465 };
466};
467
1da177e4
LT
468/*
469 * Arguments to the open call.
470 */
471struct nfs_openargs {
62ae082d 472 struct nfs4_sequence_args seq_args;
1da177e4 473 const struct nfs_fh * fh;
cee54fc9 474 struct nfs_seqid * seqid;
1da177e4 475 int open_flags;
dc0b027d 476 fmode_t fmode;
6ae37339 477 u32 share_access;
6168f62c 478 u32 access;
1da177e4 479 __u64 clientid;
95b72eb0 480 struct stateowner_id id;
1da177e4 481 union {
d77d76ff 482 struct {
5334c5bd 483 struct iattr * attrs; /* UNCHECKED, GUARDED, EXCLUSIVE4_1 */
d77d76ff
TM
484 nfs4_verifier verifier; /* EXCLUSIVE */
485 };
1da177e4 486 nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */
86e1c54d 487 __u32 delegation_type; /* CLAIM_PREVIOUS */
1da177e4
LT
488 } u;
489 const struct qstr * name;
490 const struct nfs_server *server; /* Needed for ID mapping */
491 const u32 * bitmask;
1549210f 492 const u32 * open_bitmap;
2a606188 493 enum open_claim_type4 claim;
549b19cc 494 enum createmode4 createmode;
e058f70b 495 const struct nfs4_label *label;
dff25ddb 496 umode_t umask;
56f487f8 497 struct nfs4_layoutget_args *lg_args;
1da177e4
LT
498};
499
500struct nfs_openres {
62ae082d 501 struct nfs4_sequence_res seq_res;
1da177e4
LT
502 nfs4_stateid stateid;
503 struct nfs_fh fh;
504 struct nfs4_change_info cinfo;
505 __u32 rflags;
506 struct nfs_fattr * f_attr;
c1d51931 507 struct nfs_seqid * seqid;
1da177e4 508 const struct nfs_server *server;
aa53ed54 509 __u32 attrset[NFS4_BITMAP_SIZE];
6926afd1
TM
510 struct nfs4_string *owner;
511 struct nfs4_string *group_owner;
82062051 512 struct nfs4_open_delegation delegation;
ae2bb032 513 __u32 access_request;
6168f62c
WAA
514 __u32 access_supported;
515 __u32 access_result;
56f487f8 516 struct nfs4_layoutget_res *lg_res;
1da177e4
LT
517};
518
519/*
520 * Arguments to the open_confirm call.
521 */
522struct nfs_open_confirmargs {
17ead6c8 523 struct nfs4_sequence_args seq_args;
1da177e4 524 const struct nfs_fh * fh;
cdd4e68b 525 nfs4_stateid * stateid;
cee54fc9 526 struct nfs_seqid * seqid;
1da177e4
LT
527};
528
529struct nfs_open_confirmres {
17ead6c8 530 struct nfs4_sequence_res seq_res;
1da177e4 531 nfs4_stateid stateid;
c1d51931 532 struct nfs_seqid * seqid;
1da177e4
LT
533};
534
535/*
536 * Arguments to the close call.
537 */
538struct nfs_closeargs {
62ae082d 539 struct nfs4_sequence_args seq_args;
1da177e4 540 struct nfs_fh * fh;
566fcec6 541 nfs4_stateid stateid;
cee54fc9 542 struct nfs_seqid * seqid;
dc0b027d 543 fmode_t fmode;
6ae37339 544 u32 share_access;
332d1a03
TM
545 const u32 * bitmask;
546 u32 bitmask_store[NFS_BITMASK_SZ];
cf805165 547 struct nfs4_layoutreturn_args *lr_args;
1da177e4
LT
548};
549
550struct nfs_closeres {
62ae082d 551 struct nfs4_sequence_res seq_res;
1da177e4 552 nfs4_stateid stateid;
516a6af6 553 struct nfs_fattr * fattr;
c1d51931 554 struct nfs_seqid * seqid;
516a6af6 555 const struct nfs_server *server;
cf805165
TM
556 struct nfs4_layoutreturn_res *lr_res;
557 int lr_ret;
1da177e4
LT
558};
559/*
560 * * Arguments to the lock,lockt, and locku call.
561 * */
562struct nfs_lowner {
911d1aaf 563 __u64 clientid;
9f958ab8 564 __u64 id;
d035c36c 565 dev_t s_dev;
1da177e4
LT
566};
567
911d1aaf 568struct nfs_lock_args {
62ae082d 569 struct nfs4_sequence_args seq_args;
911d1aaf
TM
570 struct nfs_fh * fh;
571 struct file_lock * fl;
cee54fc9 572 struct nfs_seqid * lock_seqid;
425c1d4e 573 nfs4_stateid lock_stateid;
06735b34 574 struct nfs_seqid * open_seqid;
425c1d4e 575 nfs4_stateid open_stateid;
911d1aaf
TM
576 struct nfs_lowner lock_owner;
577 unsigned char block : 1;
578 unsigned char reclaim : 1;
c69899a1 579 unsigned char new_lock : 1;
911d1aaf
TM
580 unsigned char new_lock_owner : 1;
581};
582
583struct nfs_lock_res {
62ae082d 584 struct nfs4_sequence_res seq_res;
c1d51931
TM
585 nfs4_stateid stateid;
586 struct nfs_seqid * lock_seqid;
587 struct nfs_seqid * open_seqid;
1da177e4
LT
588};
589
911d1aaf 590struct nfs_locku_args {
62ae082d 591 struct nfs4_sequence_args seq_args;
911d1aaf
TM
592 struct nfs_fh * fh;
593 struct file_lock * fl;
cee54fc9 594 struct nfs_seqid * seqid;
425c1d4e 595 nfs4_stateid stateid;
1da177e4
LT
596};
597
911d1aaf 598struct nfs_locku_res {
62ae082d 599 struct nfs4_sequence_res seq_res;
c1d51931
TM
600 nfs4_stateid stateid;
601 struct nfs_seqid * seqid;
1da177e4
LT
602};
603
911d1aaf 604struct nfs_lockt_args {
62ae082d 605 struct nfs4_sequence_args seq_args;
911d1aaf
TM
606 struct nfs_fh * fh;
607 struct file_lock * fl;
608 struct nfs_lowner lock_owner;
1da177e4
LT
609};
610
911d1aaf 611struct nfs_lockt_res {
9ff71c3a 612 struct nfs4_sequence_res seq_res;
62ae082d 613 struct file_lock * denied; /* LOCK, LOCKT failed */
1da177e4
LT
614};
615
d3c7b7cc 616struct nfs_release_lockowner_args {
b7e63a10 617 struct nfs4_sequence_args seq_args;
d3c7b7cc
TM
618 struct nfs_lowner lock_owner;
619};
620
b7e63a10
TM
621struct nfs_release_lockowner_res {
622 struct nfs4_sequence_res seq_res;
623};
624
90f9ae74
TM
625struct nfs4_delegattr {
626 struct timespec64 atime;
627 struct timespec64 mtime;
628 bool atime_set;
629 bool mtime_set;
630};
631
1da177e4 632struct nfs4_delegreturnargs {
62ae082d 633 struct nfs4_sequence_args seq_args;
1da177e4
LT
634 const struct nfs_fh *fhandle;
635 const nfs4_stateid *stateid;
332d1a03
TM
636 const u32 *bitmask;
637 u32 bitmask_store[NFS_BITMASK_SZ];
586f1c39 638 struct nfs4_layoutreturn_args *lr_args;
90f9ae74 639 struct nfs4_delegattr *sattr_args;
fa178f29
TM
640};
641
642struct nfs4_delegreturnres {
62ae082d 643 struct nfs4_sequence_res seq_res;
fa178f29 644 struct nfs_fattr * fattr;
516285eb 645 struct nfs_server *server;
586f1c39
TM
646 struct nfs4_layoutreturn_res *lr_res;
647 int lr_ret;
90f9ae74
TM
648 bool sattr_res;
649 int sattr_ret;
1da177e4
LT
650};
651
1da177e4
LT
652/*
653 * Arguments to the write call.
654 */
2f2c63bc
TM
655struct nfs_write_verifier {
656 char data[8];
657};
658
1da177e4 659struct nfs_writeverf {
2f2c63bc 660 struct nfs_write_verifier verifier;
1da177e4 661 enum nfs3_stable_how committed;
1da177e4
LT
662};
663
3c6b899c
AS
664/*
665 * Arguments shared by the read and write call.
666 */
667struct nfs_pgio_args {
668 struct nfs4_sequence_args seq_args;
669 struct nfs_fh * fh;
670 struct nfs_open_context *context;
671 struct nfs_lock_context *lock_context;
672 nfs4_stateid stateid;
673 __u64 offset;
674 __u32 count;
675 unsigned int pgbase;
676 struct page ** pages;
28d52235
TM
677 union {
678 unsigned int replen; /* used by read */
679 struct {
332d1a03
TM
680 const u32 * bitmask; /* used by write */
681 u32 bitmask_store[NFS_BITMASK_SZ]; /* used by write */
28d52235
TM
682 enum nfs3_stable_how stable; /* used by write */
683 };
684 };
3c6b899c
AS
685};
686
9137bdf3
AS
687struct nfs_pgio_res {
688 struct nfs4_sequence_res seq_res;
689 struct nfs_fattr * fattr;
c5675526 690 __u64 count;
aabff4dd 691 __u32 op_status;
28d52235
TM
692 union {
693 struct {
694 unsigned int replen; /* used by read */
695 int eof; /* used by read */
fbd2a05f 696 void * scratch; /* used by read */
28d52235
TM
697 };
698 struct {
699 struct nfs_writeverf * verf; /* used by write */
700 const struct nfs_server *server; /* used by write */
701 };
702 };
9137bdf3
AS
703};
704
0b7c0153
FI
705/*
706 * Arguments to the commit call.
707 */
708struct nfs_commitargs {
62ae082d 709 struct nfs4_sequence_args seq_args;
0b7c0153
FI
710 struct nfs_fh *fh;
711 __u64 offset;
712 __u32 count;
713 const u32 *bitmask;
0b7c0153
FI
714};
715
716struct nfs_commitres {
62ae082d 717 struct nfs4_sequence_res seq_res;
aabff4dd 718 __u32 op_status;
0b7c0153
FI
719 struct nfs_fattr *fattr;
720 struct nfs_writeverf *verf;
721 const struct nfs_server *server;
0b7c0153
FI
722};
723
4fdc17b2
TM
724/*
725 * Common arguments to the unlink call
726 */
727struct nfs_removeargs {
62ae082d 728 struct nfs4_sequence_args seq_args;
4fdc17b2
TM
729 const struct nfs_fh *fh;
730 struct qstr name;
4fdc17b2
TM
731};
732
733struct nfs_removeres {
62ae082d 734 struct nfs4_sequence_res seq_res;
516285eb 735 struct nfs_server *server;
d346890b 736 struct nfs_fattr *dir_attr;
4fdc17b2 737 struct nfs4_change_info cinfo;
4fdc17b2
TM
738};
739
920769f0
JL
740/*
741 * Common arguments to the rename call
742 */
743struct nfs_renameargs {
62ae082d 744 struct nfs4_sequence_args seq_args;
920769f0
JL
745 const struct nfs_fh *old_dir;
746 const struct nfs_fh *new_dir;
747 const struct qstr *old_name;
748 const struct qstr *new_name;
920769f0
JL
749};
750
e8582a8b 751struct nfs_renameres {
62ae082d 752 struct nfs4_sequence_res seq_res;
516285eb 753 struct nfs_server *server;
e8582a8b
JL
754 struct nfs4_change_info old_cinfo;
755 struct nfs_fattr *old_fattr;
756 struct nfs4_change_info new_cinfo;
757 struct nfs_fattr *new_fattr;
e8582a8b
JL
758};
759
a3f73c27 760/* parsed sec= options */
4d4b69dd 761#define NFS_AUTH_INFO_MAX_FLAVORS 12 /* see fs/nfs/super.c */
a3f73c27
WAA
762struct nfs_auth_info {
763 unsigned int flavor_len;
4d4b69dd 764 rpc_authflavor_t flavors[NFS_AUTH_INFO_MAX_FLAVORS];
a3f73c27
WAA
765};
766
1da177e4
LT
767/*
768 * Argument struct for decode_entry function
769 */
770struct nfs_entry {
771 __u64 ino;
0adf85b4 772 __u64 cookie;
1da177e4
LT
773 const char * name;
774 unsigned int len;
775 int eof;
776 struct nfs_fh * fh;
777 struct nfs_fattr * fattr;
0b26a0bf 778 unsigned char d_type;
573c4e1e 779 struct nfs_server * server;
1da177e4
LT
780};
781
82e22a5e
TM
782struct nfs_readdir_arg {
783 struct dentry *dentry;
784 const struct cred *cred;
785 __be32 *verf;
786 u64 cookie;
787 struct page **pages;
788 unsigned int page_len;
789 bool plus;
790};
791
792struct nfs_readdir_res {
793 __be32 *verf;
794};
795
1da177e4
LT
796/*
797 * The following types are for NFSv2 only.
798 */
799struct nfs_sattrargs {
800 struct nfs_fh * fh;
801 struct iattr * sattr;
802};
803
804struct nfs_diropargs {
805 struct nfs_fh * fh;
806 const char * name;
807 unsigned int len;
808};
809
810struct nfs_createargs {
811 struct nfs_fh * fh;
812 const char * name;
813 unsigned int len;
814 struct iattr * sattr;
815};
816
1da177e4 817struct nfs_setattrargs {
62ae082d 818 struct nfs4_sequence_args seq_args;
1da177e4
LT
819 struct nfs_fh * fh;
820 nfs4_stateid stateid;
821 struct iattr * iap;
822 const struct nfs_server * server; /* Needed for name mapping */
823 const u32 * bitmask;
e058f70b 824 const struct nfs4_label *label;
1da177e4
LT
825};
826
7b8b44eb
TM
827enum nfs4_acl_type {
828 NFS4ACL_NONE = 0,
829 NFS4ACL_ACL,
830 NFS4ACL_DACL,
831 NFS4ACL_SACL,
832};
833
23ec6965 834struct nfs_setaclargs {
62ae082d 835 struct nfs4_sequence_args seq_args;
23ec6965 836 struct nfs_fh * fh;
db145db0 837 enum nfs4_acl_type acl_type;
23ec6965 838 size_t acl_len;
23ec6965
BF
839 struct page ** acl_pages;
840};
841
73c403a9
BH
842struct nfs_setaclres {
843 struct nfs4_sequence_res seq_res;
844};
845
029d105e 846struct nfs_getaclargs {
62ae082d 847 struct nfs4_sequence_args seq_args;
029d105e 848 struct nfs_fh * fh;
db145db0 849 enum nfs4_acl_type acl_type;
029d105e 850 size_t acl_len;
029d105e
BF
851 struct page ** acl_pages;
852};
853
bf118a34 854/* getxattr ACL interface flags */
1f1ea6c2 855#define NFS4_ACL_TRUNC 0x0001 /* ACL was truncated */
663c79b3 856struct nfs_getaclres {
62ae082d 857 struct nfs4_sequence_res seq_res;
db145db0 858 enum nfs4_acl_type acl_type;
663c79b3 859 size_t acl_len;
bf118a34
AA
860 size_t acl_data_offset;
861 int acl_flags;
331818f1 862 struct page * acl_scratch;
663c79b3
BH
863};
864
1da177e4 865struct nfs_setattrres {
62ae082d 866 struct nfs4_sequence_res seq_res;
1da177e4
LT
867 struct nfs_fattr * fattr;
868 const struct nfs_server * server;
869};
870
871struct nfs_linkargs {
872 struct nfs_fh * fromfh;
873 struct nfs_fh * tofh;
874 const char * toname;
875 unsigned int tolen;
876};
877
878struct nfs_symlinkargs {
879 struct nfs_fh * fromfh;
880 const char * fromname;
881 unsigned int fromlen;
94a6d753
CL
882 struct page ** pages;
883 unsigned int pathlen;
1da177e4
LT
884 struct iattr * sattr;
885};
886
887struct nfs_readdirargs {
888 struct nfs_fh * fh;
889 __u32 cookie;
890 unsigned int count;
891 struct page ** pages;
892};
893
b7fa0554
AG
894struct nfs3_getaclargs {
895 struct nfs_fh * fh;
896 int mask;
897 struct page ** pages;
898};
899
900struct nfs3_setaclargs {
901 struct inode * inode;
902 int mask;
903 struct posix_acl * acl_access;
904 struct posix_acl * acl_default;
ae46141f
TM
905 size_t len;
906 unsigned int npages;
b7fa0554
AG
907 struct page ** pages;
908};
909
1da177e4
LT
910struct nfs_diropok {
911 struct nfs_fh * fh;
912 struct nfs_fattr * fattr;
913};
914
915struct nfs_readlinkargs {
916 struct nfs_fh * fh;
917 unsigned int pgbase;
918 unsigned int pglen;
919 struct page ** pages;
920};
921
922struct nfs3_sattrargs {
923 struct nfs_fh * fh;
924 struct iattr * sattr;
925 unsigned int guard;
6430b323 926 struct timespec64 guardtime;
1da177e4
LT
927};
928
929struct nfs3_diropargs {
930 struct nfs_fh * fh;
931 const char * name;
932 unsigned int len;
933};
934
935struct nfs3_accessargs {
936 struct nfs_fh * fh;
937 __u32 access;
938};
939
940struct nfs3_createargs {
941 struct nfs_fh * fh;
942 const char * name;
943 unsigned int len;
944 struct iattr * sattr;
945 enum nfs3_createmode createmode;
bc4785cd 946 __be32 verifier[2];
1da177e4
LT
947};
948
949struct nfs3_mkdirargs {
950 struct nfs_fh * fh;
951 const char * name;
952 unsigned int len;
953 struct iattr * sattr;
954};
955
956struct nfs3_symlinkargs {
957 struct nfs_fh * fromfh;
958 const char * fromname;
959 unsigned int fromlen;
94a6d753
CL
960 struct page ** pages;
961 unsigned int pathlen;
1da177e4
LT
962 struct iattr * sattr;
963};
964
965struct nfs3_mknodargs {
966 struct nfs_fh * fh;
967 const char * name;
968 unsigned int len;
969 enum nfs3_ftype type;
970 struct iattr * sattr;
971 dev_t rdev;
972};
973
1da177e4
LT
974struct nfs3_linkargs {
975 struct nfs_fh * fromfh;
976 struct nfs_fh * tofh;
977 const char * toname;
978 unsigned int tolen;
979};
980
981struct nfs3_readdirargs {
982 struct nfs_fh * fh;
983 __u64 cookie;
bc4785cd 984 __be32 verf[2];
a7a3b1e9 985 bool plus;
1da177e4
LT
986 unsigned int count;
987 struct page ** pages;
988};
989
990struct nfs3_diropres {
991 struct nfs_fattr * dir_attr;
992 struct nfs_fh * fh;
993 struct nfs_fattr * fattr;
994};
995
996struct nfs3_accessres {
997 struct nfs_fattr * fattr;
998 __u32 access;
999};
1000
1001struct nfs3_readlinkargs {
1002 struct nfs_fh * fh;
1003 unsigned int pgbase;
1004 unsigned int pglen;
1005 struct page ** pages;
1006};
1007
1da177e4
LT
1008struct nfs3_linkres {
1009 struct nfs_fattr * dir_attr;
1010 struct nfs_fattr * fattr;
1011};
1012
1013struct nfs3_readdirres {
1014 struct nfs_fattr * dir_attr;
bc4785cd 1015 __be32 * verf;
a7a3b1e9 1016 bool plus;
1da177e4
LT
1017};
1018
b7fa0554
AG
1019struct nfs3_getaclres {
1020 struct nfs_fattr * fattr;
1021 int mask;
1022 unsigned int acl_access_count;
1023 unsigned int acl_default_count;
1024 struct posix_acl * acl_access;
1025 struct posix_acl * acl_default;
1026};
1027
89d77c8f 1028#if IS_ENABLED(CONFIG_NFS_V4)
1da177e4
LT
1029
1030typedef u64 clientid4;
1031
1032struct nfs4_accessargs {
62ae082d 1033 struct nfs4_sequence_args seq_args;
1da177e4 1034 const struct nfs_fh * fh;
76b32999 1035 const u32 * bitmask;
1da177e4
LT
1036 u32 access;
1037};
1038
1039struct nfs4_accessres {
62ae082d 1040 struct nfs4_sequence_res seq_res;
76b32999
TM
1041 const struct nfs_server * server;
1042 struct nfs_fattr * fattr;
1da177e4
LT
1043 u32 supported;
1044 u32 access;
1045};
1046
1047struct nfs4_create_arg {
62ae082d 1048 struct nfs4_sequence_args seq_args;
1da177e4
LT
1049 u32 ftype;
1050 union {
94a6d753
CL
1051 struct {
1052 struct page ** pages;
1053 unsigned int len;
1054 } symlink; /* NF4LNK */
1da177e4
LT
1055 struct {
1056 u32 specdata1;
1057 u32 specdata2;
1058 } device; /* NF4BLK, NF4CHR */
1059 } u;
1060 const struct qstr * name;
1061 const struct nfs_server * server;
1062 const struct iattr * attrs;
1063 const struct nfs_fh * dir_fh;
1064 const u32 * bitmask;
e058f70b 1065 const struct nfs4_label *label;
dff25ddb 1066 umode_t umask;
1da177e4
LT
1067};
1068
1069struct nfs4_create_res {
62ae082d 1070 struct nfs4_sequence_res seq_res;
1da177e4
LT
1071 const struct nfs_server * server;
1072 struct nfs_fh * fh;
1073 struct nfs_fattr * fattr;
1074 struct nfs4_change_info dir_cinfo;
1075};
1076
1077struct nfs4_fsinfo_arg {
62ae082d 1078 struct nfs4_sequence_args seq_args;
1da177e4
LT
1079 const struct nfs_fh * fh;
1080 const u32 * bitmask;
1081};
1082
3dda5e43 1083struct nfs4_fsinfo_res {
3dda5e43 1084 struct nfs4_sequence_res seq_res;
62ae082d 1085 struct nfs_fsinfo *fsinfo;
3dda5e43
BH
1086};
1087
1da177e4 1088struct nfs4_getattr_arg {
62ae082d 1089 struct nfs4_sequence_args seq_args;
1da177e4
LT
1090 const struct nfs_fh * fh;
1091 const u32 * bitmask;
1092};
1093
1094struct nfs4_getattr_res {
62ae082d 1095 struct nfs4_sequence_res seq_res;
1da177e4
LT
1096 const struct nfs_server * server;
1097 struct nfs_fattr * fattr;
1098};
1099
1100struct nfs4_link_arg {
62ae082d 1101 struct nfs4_sequence_args seq_args;
1da177e4
LT
1102 const struct nfs_fh * fh;
1103 const struct nfs_fh * dir_fh;
1104 const struct qstr * name;
91ba2eee
TM
1105 const u32 * bitmask;
1106};
1107
1108struct nfs4_link_res {
62ae082d 1109 struct nfs4_sequence_res seq_res;
91ba2eee
TM
1110 const struct nfs_server * server;
1111 struct nfs_fattr * fattr;
1112 struct nfs4_change_info cinfo;
1113 struct nfs_fattr * dir_attr;
1da177e4
LT
1114};
1115
1116struct nfs4_lookup_arg {
62ae082d 1117 struct nfs4_sequence_args seq_args;
1da177e4
LT
1118 const struct nfs_fh * dir_fh;
1119 const struct qstr * name;
1120 const u32 * bitmask;
1121};
1122
1123struct nfs4_lookup_res {
62ae082d 1124 struct nfs4_sequence_res seq_res;
1da177e4
LT
1125 const struct nfs_server * server;
1126 struct nfs_fattr * fattr;
1127 struct nfs_fh * fh;
1128};
1129
5b5faaf6
JL
1130struct nfs4_lookupp_arg {
1131 struct nfs4_sequence_args seq_args;
1132 const struct nfs_fh *fh;
1133 const u32 *bitmask;
1134};
1135
1136struct nfs4_lookupp_res {
1137 struct nfs4_sequence_res seq_res;
1138 const struct nfs_server *server;
1139 struct nfs_fattr *fattr;
1140 struct nfs_fh *fh;
5b5faaf6
JL
1141};
1142
1da177e4 1143struct nfs4_lookup_root_arg {
9ff71c3a 1144 struct nfs4_sequence_args seq_args;
62ae082d 1145 const u32 * bitmask;
1da177e4
LT
1146};
1147
1148struct nfs4_pathconf_arg {
62ae082d 1149 struct nfs4_sequence_args seq_args;
1da177e4
LT
1150 const struct nfs_fh * fh;
1151 const u32 * bitmask;
1152};
1153
d45b2989 1154struct nfs4_pathconf_res {
d45b2989 1155 struct nfs4_sequence_res seq_res;
62ae082d 1156 struct nfs_pathconf *pathconf;
d45b2989
BH
1157};
1158
1da177e4 1159struct nfs4_readdir_arg {
62ae082d 1160 struct nfs4_sequence_args seq_args;
1da177e4
LT
1161 const struct nfs_fh * fh;
1162 u64 cookie;
1163 nfs4_verifier verifier;
1164 u32 count;
1165 struct page ** pages; /* zero-copy data */
1166 unsigned int pgbase; /* zero-copy data */
1167 const u32 * bitmask;
a7a3b1e9 1168 bool plus;
1da177e4
LT
1169};
1170
1171struct nfs4_readdir_res {
62ae082d 1172 struct nfs4_sequence_res seq_res;
1da177e4
LT
1173 nfs4_verifier verifier;
1174 unsigned int pgbase;
1175};
1176
1177struct nfs4_readlink {
62ae082d 1178 struct nfs4_sequence_args seq_args;
1da177e4
LT
1179 const struct nfs_fh * fh;
1180 unsigned int pgbase;
1181 unsigned int pglen; /* zero-copy data */
1182 struct page ** pages; /* zero-copy data */
1183};
1184
f50c7000
BH
1185struct nfs4_readlink_res {
1186 struct nfs4_sequence_res seq_res;
1187};
1188
1da177e4 1189struct nfs4_setclientid {
cc38bac3 1190 const nfs4_verifier * sc_verifier;
cc38bac3 1191 u32 sc_prog;
1da177e4 1192 unsigned int sc_netid_len;
d1ce02e1 1193 char sc_netid[RPCBIND_MAXNETIDLEN + 1];
1da177e4 1194 unsigned int sc_uaddr_len;
d1ce02e1 1195 char sc_uaddr[RPCBIND_MAXUADDRLEN + 1];
3a6bb738 1196 struct nfs_client *sc_clnt;
f11b2a1c 1197 struct rpc_cred *sc_cred;
1da177e4
LT
1198};
1199
bb8b27e5
TM
1200struct nfs4_setclientid_res {
1201 u64 clientid;
1202 nfs4_verifier confirm;
1203};
1204
1da177e4 1205struct nfs4_statfs_arg {
62ae082d 1206 struct nfs4_sequence_args seq_args;
1da177e4
LT
1207 const struct nfs_fh * fh;
1208 const u32 * bitmask;
1209};
1210
24ad148a 1211struct nfs4_statfs_res {
24ad148a 1212 struct nfs4_sequence_res seq_res;
62ae082d 1213 struct nfs_fsstat *fsstat;
24ad148a
BH
1214};
1215
707f13b3
TM
1216struct nfs4_open_caps {
1217 u32 oa_share_access[1];
1218 u32 oa_share_deny[1];
1219 u32 oa_share_access_want[1];
1220 u32 oa_open_claim[1];
1221 u32 oa_createmode[1];
1222};
1223
43652ad5 1224struct nfs4_server_caps_arg {
43652ad5 1225 struct nfs4_sequence_args seq_args;
62ae082d 1226 struct nfs_fh *fhandle;
8c61282f 1227 const u32 * bitmask;
43652ad5
BH
1228};
1229
1da177e4 1230struct nfs4_server_caps_res {
62ae082d 1231 struct nfs4_sequence_res seq_res;
dae100c2 1232 u32 attr_bitmask[3];
8c61282f 1233 u32 exclcreat_bitmask[3];
1da177e4
LT
1234 u32 acl_bitmask;
1235 u32 has_links;
1236 u32 has_symlinks;
264e6351 1237 u32 fh_expire_type;
1ab5be4a
TM
1238 u32 case_insensitive;
1239 u32 case_preserving;
707f13b3 1240 struct nfs4_open_caps open_caps;
1da177e4
LT
1241};
1242
7aaa0b3b
MN
1243#define NFS4_PATHNAME_MAXCOMPONENTS 512
1244struct nfs4_pathname {
1245 unsigned int ncomponents;
1246 struct nfs4_string components[NFS4_PATHNAME_MAXCOMPONENTS];
1247};
1248
1249#define NFS4_FS_LOCATION_MAXSERVERS 10
1250struct nfs4_fs_location {
1251 unsigned int nservers;
1252 struct nfs4_string servers[NFS4_FS_LOCATION_MAXSERVERS];
1253 struct nfs4_pathname rootpath;
1254};
1255
1256#define NFS4_FS_LOCATIONS_MAXENTRIES 10
1257struct nfs4_fs_locations {
c3ed2227 1258 struct nfs_fattr *fattr;
683b57b4 1259 const struct nfs_server *server;
7aaa0b3b 1260 struct nfs4_pathname fs_path;
683b57b4 1261 int nlocations;
7aaa0b3b 1262 struct nfs4_fs_location locations[NFS4_FS_LOCATIONS_MAXENTRIES];
683b57b4
TM
1263};
1264
1265struct nfs4_fs_locations_arg {
62ae082d 1266 struct nfs4_sequence_args seq_args;
683b57b4 1267 const struct nfs_fh *dir_fh;
b03d735b 1268 const struct nfs_fh *fh;
683b57b4
TM
1269 const struct qstr *name;
1270 struct page *page;
1271 const u32 *bitmask;
b03d735b
CL
1272 clientid4 clientid;
1273 unsigned char migration:1, renew:1;
683b57b4
TM
1274};
1275
22958463 1276struct nfs4_fs_locations_res {
22958463 1277 struct nfs4_sequence_res seq_res;
62ae082d 1278 struct nfs4_fs_locations *fs_locations;
b03d735b 1279 unsigned char migration:1, renew:1;
22958463
BH
1280};
1281
fb15b26f
CL
1282struct nfs4_secinfo4 {
1283 u32 flavor;
1284 struct rpcsec_gss_info flavor_info;
5a5ea0d4
BS
1285};
1286
1287struct nfs4_secinfo_flavors {
fb15b26f 1288 unsigned int num_flavors;
1ad8dd93 1289 struct nfs4_secinfo4 flavors[];
5a5ea0d4
BS
1290};
1291
1292struct nfs4_secinfo_arg {
62ae082d 1293 struct nfs4_sequence_args seq_args;
5a5ea0d4
BS
1294 const struct nfs_fh *dir_fh;
1295 const struct qstr *name;
5a5ea0d4
BS
1296};
1297
1298struct nfs4_secinfo_res {
5a5ea0d4 1299 struct nfs4_sequence_res seq_res;
62ae082d 1300 struct nfs4_secinfo_flavors *flavors;
5a5ea0d4
BS
1301};
1302
44c99933
CL
1303struct nfs4_fsid_present_arg {
1304 struct nfs4_sequence_args seq_args;
1305 const struct nfs_fh *fh;
1306 clientid4 clientid;
1307 unsigned char renew:1;
1308};
1309
1310struct nfs4_fsid_present_res {
1311 struct nfs4_sequence_res seq_res;
1312 struct nfs_fh *fh;
1313 unsigned char renew:1;
1314};
1315
1da177e4
LT
1316#endif /* CONFIG_NFS_V4 */
1317
99fe60d0
BH
1318struct nfstime4 {
1319 u64 seconds;
1320 u32 nseconds;
1321};
1322
1323#ifdef CONFIG_NFS_V4_1
ea2cf228
FI
1324
1325struct pnfs_commit_bucket {
1326 struct list_head written;
1327 struct list_head committing;
c84bea59 1328 struct pnfs_layout_segment *lseg;
5002c586 1329 struct nfs_writeverf direct_verf;
ea2cf228
FI
1330};
1331
d7242c46
TM
1332struct pnfs_commit_array {
1333 struct list_head cinfo_list;
1334 struct list_head lseg_list;
1335 struct pnfs_layout_segment *lseg;
1336 struct rcu_head rcu;
a9901899 1337 refcount_t refcount;
d7242c46
TM
1338 unsigned int nbuckets;
1339 struct pnfs_commit_bucket buckets[];
1340};
1341
ea2cf228 1342struct pnfs_ds_commit_info {
c21e7168 1343 struct list_head commits;
d7242c46
TM
1344 unsigned int nwritten;
1345 unsigned int ncommitting;
9c455a8c 1346 const struct pnfs_commit_ops *ops;
ea2cf228
FI
1347};
1348
2031cd1a
WAA
1349struct nfs41_state_protection {
1350 u32 how;
1351 struct nfs4_op_map enforce;
1352 struct nfs4_op_map allow;
1353};
1354
99fe60d0
BH
1355struct nfs41_exchange_id_args {
1356 struct nfs_client *client;
fd40559c 1357 nfs4_verifier verifier;
99fe60d0 1358 u32 flags;
2031cd1a 1359 struct nfs41_state_protection state_protect;
99fe60d0
BH
1360};
1361
acdeb69d 1362struct nfs41_server_owner {
99fe60d0
BH
1363 uint64_t minor_id;
1364 uint32_t major_id_sz;
1365 char major_id[NFS4_OPAQUE_LIMIT];
1366};
1367
79d4e1f0 1368struct nfs41_server_scope {
99fe60d0
BH
1369 uint32_t server_scope_sz;
1370 char server_scope[NFS4_OPAQUE_LIMIT];
1371};
1372
7d2ed9ac
WAA
1373struct nfs41_impl_id {
1374 char domain[NFS4_OPAQUE_LIMIT + 1];
1375 char name[NFS4_OPAQUE_LIMIT + 1];
1376 struct nfstime4 date;
1377};
1378
dff58530 1379#define MAX_BIND_CONN_TO_SESSION_RETRIES 3
71a097c6
TM
1380struct nfs41_bind_conn_to_session_args {
1381 struct nfs_client *client;
1382 struct nfs4_sessionid sessionid;
1383 u32 dir;
1384 bool use_conn_in_rdma_mode;
dff58530 1385 int retries;
71a097c6
TM
1386};
1387
7c44f1ae 1388struct nfs41_bind_conn_to_session_res {
71a097c6 1389 struct nfs4_sessionid sessionid;
7c44f1ae
WAA
1390 u32 dir;
1391 bool use_conn_in_rdma_mode;
1392};
1393
99fe60d0 1394struct nfs41_exchange_id_res {
32b01310
TM
1395 u64 clientid;
1396 u32 seqid;
99fe60d0 1397 u32 flags;
acdeb69d 1398 struct nfs41_server_owner *server_owner;
79d4e1f0 1399 struct nfs41_server_scope *server_scope;
7d2ed9ac 1400 struct nfs41_impl_id *impl_id;
2031cd1a 1401 struct nfs41_state_protection state_protect;
99fe60d0 1402};
fc931582
AA
1403
1404struct nfs41_create_session_args {
1405 struct nfs_client *client;
79969dd1
TM
1406 u64 clientid;
1407 uint32_t seqid;
fc931582
AA
1408 uint32_t flags;
1409 uint32_t cb_program;
1410 struct nfs4_channel_attrs fc_attrs; /* Fore Channel */
1411 struct nfs4_channel_attrs bc_attrs; /* Back Channel */
1412};
1413
1414struct nfs41_create_session_res {
79969dd1
TM
1415 struct nfs4_sessionid sessionid;
1416 uint32_t seqid;
1417 uint32_t flags;
1418 struct nfs4_channel_attrs fc_attrs; /* Fore Channel */
1419 struct nfs4_channel_attrs bc_attrs; /* Back Channel */
fc931582 1420};
18019753
RL
1421
1422struct nfs41_reclaim_complete_args {
62ae082d 1423 struct nfs4_sequence_args seq_args;
18019753
RL
1424 /* In the future extend to include curr_fh for use with migration */
1425 unsigned char one_fs:1;
18019753
RL
1426};
1427
1428struct nfs41_reclaim_complete_res {
1429 struct nfs4_sequence_res seq_res;
1430};
fca78d6d
BS
1431
1432#define SECINFO_STYLE_CURRENT_FH 0
1433#define SECINFO_STYLE_PARENT 1
1434struct nfs41_secinfo_no_name_args {
fca78d6d 1435 struct nfs4_sequence_args seq_args;
62ae082d 1436 int style;
fca78d6d
BS
1437};
1438
7d974794 1439struct nfs41_test_stateid_args {
7d974794 1440 struct nfs4_sequence_args seq_args;
924cf3c9 1441 nfs4_stateid stateid;
7d974794
BS
1442};
1443
1444struct nfs41_test_stateid_res {
7d974794 1445 struct nfs4_sequence_res seq_res;
62ae082d 1446 unsigned int status;
7d974794
BS
1447};
1448
9aeda35f 1449struct nfs41_free_stateid_args {
9aeda35f 1450 struct nfs4_sequence_args seq_args;
7c1d5fae 1451 nfs4_stateid stateid;
9aeda35f
BS
1452};
1453
1454struct nfs41_free_stateid_res {
9aeda35f 1455 struct nfs4_sequence_res seq_res;
62ae082d 1456 unsigned int status;
9aeda35f
BS
1457};
1458
4f97615d
TM
1459#else
1460
1461struct pnfs_ds_commit_info {
1462};
1463
99fe60d0
BH
1464#endif /* CONFIG_NFS_V4_1 */
1465
1c6dcbe5 1466#ifdef CONFIG_NFS_V4_2
f4ac1674
AS
1467struct nfs42_falloc_args {
1468 struct nfs4_sequence_args seq_args;
1469
1470 struct nfs_fh *falloc_fh;
1471 nfs4_stateid falloc_stateid;
1472 u64 falloc_offset;
1473 u64 falloc_length;
9a51940b 1474 const u32 *falloc_bitmask;
f4ac1674
AS
1475};
1476
1477struct nfs42_falloc_res {
1478 struct nfs4_sequence_res seq_res;
1479 unsigned int status;
9a51940b
AS
1480
1481 struct nfs_fattr *falloc_fattr;
1482 const struct nfs_server *falloc_server;
f4ac1674
AS
1483};
1484
2e72448b
AS
1485struct nfs42_copy_args {
1486 struct nfs4_sequence_args seq_args;
1487
1488 struct nfs_fh *src_fh;
1489 nfs4_stateid src_stateid;
1490 u64 src_pos;
1491
1492 struct nfs_fh *dst_fh;
1493 nfs4_stateid dst_stateid;
1494 u64 dst_pos;
1495
1496 u64 count;
62164f31 1497 bool sync;
1d38f3f0 1498 struct nl4_server *cp_src;
2e72448b
AS
1499};
1500
1501struct nfs42_write_res {
67aa7444 1502 nfs4_stateid stateid;
2e72448b
AS
1503 u64 count;
1504 struct nfs_writeverf verifier;
1505};
1506
1507struct nfs42_copy_res {
1508 struct nfs4_sequence_res seq_res;
1509 struct nfs42_write_res write_res;
1510 bool consecutive;
1511 bool synchronous;
e0926934 1512 struct nfs_commitres commit_res;
2e72448b
AS
1513};
1514
cb95deea
OK
1515struct nfs42_offload_status_args {
1516 struct nfs4_sequence_args osa_seq_args;
1517 struct nfs_fh *osa_src_fh;
1518 nfs4_stateid osa_stateid;
1519};
1520
1521struct nfs42_offload_status_res {
1522 struct nfs4_sequence_res osr_seq_res;
1523 uint64_t osr_count;
1524 int osr_status;
1525};
1526
0491567b
OK
1527struct nfs42_copy_notify_args {
1528 struct nfs4_sequence_args cna_seq_args;
1529
1530 struct nfs_fh *cna_src_fh;
1531 nfs4_stateid cna_src_stateid;
1532 struct nl4_server cna_dst;
1533};
1534
1535struct nfs42_copy_notify_res {
1536 struct nfs4_sequence_res cnr_seq_res;
1537
1538 struct nfstime4 cnr_lease_time;
1539 nfs4_stateid cnr_stateid;
1540 struct nl4_server cnr_src;
1541};
1542
1c6dcbe5
AS
1543struct nfs42_seek_args {
1544 struct nfs4_sequence_args seq_args;
1545
1546 struct nfs_fh *sa_fh;
1547 nfs4_stateid sa_stateid;
1548 u64 sa_offset;
1549 u32 sa_what;
1550};
1551
1552struct nfs42_seek_res {
1553 struct nfs4_sequence_res seq_res;
1554 unsigned int status;
1555
1556 u32 sr_eof;
1557 u64 sr_offset;
1558};
3e1f0212
FL
1559
1560struct nfs42_setxattrargs {
1561 struct nfs4_sequence_args seq_args;
1562 struct nfs_fh *fh;
86e2e1f6 1563 const u32 *bitmask;
3e1f0212
FL
1564 const char *xattr_name;
1565 u32 xattr_flags;
1566 size_t xattr_len;
1567 struct page **xattr_pages;
1568};
1569
1570struct nfs42_setxattrres {
1571 struct nfs4_sequence_res seq_res;
1572 struct nfs4_change_info cinfo;
86e2e1f6
AS
1573 struct nfs_fattr *fattr;
1574 const struct nfs_server *server;
3e1f0212
FL
1575};
1576
1577struct nfs42_getxattrargs {
1578 struct nfs4_sequence_args seq_args;
1579 struct nfs_fh *fh;
1580 const char *xattr_name;
1581 size_t xattr_len;
1582 struct page **xattr_pages;
1583};
1584
1585struct nfs42_getxattrres {
1586 struct nfs4_sequence_res seq_res;
1587 size_t xattr_len;
1588};
1589
1590struct nfs42_listxattrsargs {
1591 struct nfs4_sequence_args seq_args;
1592 struct nfs_fh *fh;
1593 u32 count;
1594 u64 cookie;
1595 struct page **xattr_pages;
1596};
1597
1598struct nfs42_listxattrsres {
1599 struct nfs4_sequence_res seq_res;
1600 struct page *scratch;
1601 void *xattr_buf;
1602 size_t xattr_len;
1603 u64 cookie;
1604 bool eof;
1605 size_t copied;
1606};
1607
1608struct nfs42_removexattrargs {
1609 struct nfs4_sequence_args seq_args;
1610 struct nfs_fh *fh;
1611 const char *xattr_name;
1612};
1613
1614struct nfs42_removexattrres {
1615 struct nfs4_sequence_res seq_res;
1616 struct nfs4_change_info cinfo;
1617};
1618
1619#endif /* CONFIG_NFS_V4_2 */
1c6dcbe5 1620
1da177e4
LT
1621struct nfs_page;
1622
40859d7e
CL
1623#define NFS_PAGEVEC_SIZE (8U)
1624
30dd374f
FI
1625struct nfs_page_array {
1626 struct page **pagevec;
1627 unsigned int npages; /* Max length of pagevec */
1628 struct page *page_array[NFS_PAGEVEC_SIZE];
1629};
1630
4db6e0b7
FI
1631/* used as flag bits in nfs_pgio_header */
1632enum {
1633 NFS_IOHDR_ERROR = 0,
1634 NFS_IOHDR_EOF,
1635 NFS_IOHDR_REDO,
37e9ed22 1636 NFS_IOHDR_STAT,
42f86b44
TM
1637 NFS_IOHDR_RESEND_PNFS,
1638 NFS_IOHDR_RESEND_MDS,
69d96651 1639 NFS_IOHDR_UNSTABLE_WRITES,
4db6e0b7
FI
1640};
1641
919e3bd9 1642struct nfs_io_completion;
cd841605
FI
1643struct nfs_pgio_header {
1644 struct inode *inode;
a52458b4 1645 const struct cred *cred;
cd841605
FI
1646 struct list_head pages;
1647 struct nfs_page *req;
f79d06f5 1648 struct nfs_writeverf verf; /* Used for writes */
fbe77c30 1649 fmode_t rw_mode;
cd841605 1650 struct pnfs_layout_segment *lseg;
4db6e0b7 1651 loff_t io_start;
cd841605 1652 const struct rpc_call_ops *mds_ops;
4db6e0b7 1653 void (*release) (struct nfs_pgio_header *hdr);
061ae2ed 1654 const struct nfs_pgio_completion_ops *completion_ops;
4a0de55c 1655 const struct nfs_rw_ops *rw_ops;
919e3bd9 1656 struct nfs_io_completion *io_completion;
584aa810 1657 struct nfs_direct_req *dreq;
000dbe0b
DW
1658#ifdef CONFIG_NFS_FSCACHE
1659 void *netfs;
1660#endif
1c6c4b74 1661
cd841605 1662 int pnfs_error;
4db6e0b7 1663 int error; /* merge with pnfs_error */
1c6c4b74 1664 unsigned int good_bytes; /* boundary of good data */
4db6e0b7 1665 unsigned long flags;
d45f60c6
WAA
1666
1667 /*
1668 * rpc data
1669 */
1670 struct rpc_task task;
1671 struct nfs_fattr fattr;
d45f60c6
WAA
1672 struct nfs_pgio_args args; /* argument struct */
1673 struct nfs_pgio_res res; /* result struct */
1674 unsigned long timestamp; /* For lease renewal */
1675 int (*pgio_done_cb)(struct rpc_task *, struct nfs_pgio_header *);
1676 __u64 mds_offset; /* Filelayout dense stripe */
1677 struct nfs_page_array page_array;
1678 struct nfs_client *ds_clp; /* pNFS data server */
c754e137
TM
1679 u32 ds_commit_idx; /* ds index if ds_clp is set */
1680 u32 pgio_mirror_idx;/* mirror index in pgio layer */
cd841605
FI
1681};
1682
ea2cf228
FI
1683struct nfs_mds_commit_info {
1684 atomic_t rpcs_out;
5cb953d4 1685 atomic_long_t ncommit;
ea2cf228
FI
1686 struct list_head list;
1687};
1688
b20135d0 1689struct nfs_commit_info;
f453a54a
FI
1690struct nfs_commit_data;
1691struct nfs_inode;
1692struct nfs_commit_completion_ops {
f453a54a 1693 void (*completion) (struct nfs_commit_data *data);
b20135d0 1694 void (*resched_write) (struct nfs_commit_info *, struct nfs_page *);
f453a54a
FI
1695};
1696
ea2cf228 1697struct nfs_commit_info {
fe238e60 1698 struct inode *inode; /* Needed for inode->i_lock */
ea2cf228
FI
1699 struct nfs_mds_commit_info *mds;
1700 struct pnfs_ds_commit_info *ds;
b359f9d0 1701 struct nfs_direct_req *dreq; /* O_DIRECT request */
f453a54a 1702 const struct nfs_commit_completion_ops *completion_ops;
ea2cf228
FI
1703};
1704
0b7c0153
FI
1705struct nfs_commit_data {
1706 struct rpc_task task;
1707 struct inode *inode;
a52458b4 1708 const struct cred *cred;
0b7c0153
FI
1709 struct nfs_fattr fattr;
1710 struct nfs_writeverf verf;
1711 struct list_head pages; /* Coalesced requests we wish to flush */
1712 struct list_head list; /* lists of struct nfs_write_data */
1713 struct nfs_direct_req *dreq; /* O_DIRECT request */
1714 struct nfs_commitargs args; /* argument struct */
1715 struct nfs_commitres res; /* result struct */
1716 struct nfs_open_context *context;
1717 struct pnfs_layout_segment *lseg;
1718 struct nfs_client *ds_clp; /* pNFS data server */
1719 int ds_commit_index;
378520b8 1720 loff_t lwb;
0b7c0153 1721 const struct rpc_call_ops *mds_ops;
f453a54a 1722 const struct nfs_commit_completion_ops *completion_ops;
0b7c0153 1723 int (*commit_done_cb) (struct rpc_task *task, struct nfs_commit_data *data);
37e9ed22 1724 unsigned long flags;
0b7c0153
FI
1725};
1726
061ae2ed 1727struct nfs_pgio_completion_ops {
df3accb8 1728 void (*error_cleanup)(struct list_head *head, int);
584aa810 1729 void (*init_hdr)(struct nfs_pgio_header *hdr);
061ae2ed 1730 void (*completion)(struct nfs_pgio_header *hdr);
dc602dd7 1731 void (*reschedule_io)(struct nfs_pgio_header *hdr);
061ae2ed
FI
1732};
1733
34e137cc 1734struct nfs_unlinkdata {
34e137cc
BS
1735 struct nfs_removeargs args;
1736 struct nfs_removeres res;
884be175
AV
1737 struct dentry *dentry;
1738 wait_queue_head_t wq;
a52458b4 1739 const struct cred *cred;
34e137cc 1740 struct nfs_fattr dir_attr;
8478eaa1 1741 long timeout;
34e137cc
BS
1742};
1743
c6bfa1a1
BS
1744struct nfs_renamedata {
1745 struct nfs_renameargs args;
1746 struct nfs_renameres res;
88dee0cc 1747 struct rpc_task task;
a52458b4 1748 const struct cred *cred;
c6bfa1a1
BS
1749 struct inode *old_dir;
1750 struct dentry *old_dentry;
1751 struct nfs_fattr old_fattr;
1752 struct inode *new_dir;
1753 struct dentry *new_dentry;
1754 struct nfs_fattr new_fattr;
96f9d8c0 1755 void (*complete)(struct rpc_task *, struct nfs_renamedata *);
8478eaa1 1756 long timeout;
818a8dbe 1757 bool cancelled;
c6bfa1a1
BS
1758};
1759
1da177e4 1760struct nfs_access_entry;
45a52a02 1761struct nfs_client;
e0dca7a0 1762struct rpc_timeout;
ff9099f2
BS
1763struct nfs_subversion;
1764struct nfs_mount_info;
6663ee7f 1765struct nfs_client_initdata;
1abb5088 1766struct nfs_pageio_descriptor;
f2aedb71 1767struct fs_context;
1da177e4
LT
1768
1769/*
1770 * RPC procedure vector for NFSv2/NFSv3 demuxing
1771 */
1772struct nfs_rpc_ops {
c0e07cb6 1773 u32 version; /* Protocol version */
f786aa90 1774 const struct dentry_operations *dentry_ops;
c5ef1c42
AV
1775 const struct inode_operations *dir_inode_ops;
1776 const struct inode_operations *file_inode_ops;
1788ea6e 1777 const struct file_operations *file_ops;
b1ece737 1778 const struct nlmclnt_operations *nlmclnt_ops;
1da177e4
LT
1779
1780 int (*getroot) (struct nfs_server *, struct nfs_fh *,
1781 struct nfs_fsinfo *);
f2aedb71
DH
1782 int (*submount) (struct fs_context *, struct nfs_server *);
1783 int (*try_get_tree) (struct fs_context *);
1da177e4 1784 int (*getattr) (struct nfs_server *, struct nfs_fh *,
2ef61e0e 1785 struct nfs_fattr *, struct inode *);
1da177e4
LT
1786 int (*setattr) (struct dentry *, struct nfs_fattr *,
1787 struct iattr *);
f7b37b8b 1788 int (*lookup) (struct inode *, struct dentry *,
9558a007 1789 struct nfs_fh *, struct nfs_fattr *);
5b5faaf6 1790 int (*lookupp) (struct inode *, struct nfs_fh *,
ba4bc8dc 1791 struct nfs_fattr *);
73fbb3fa 1792 int (*access) (struct inode *, struct nfs_access_entry *, const struct cred *);
1da177e4
LT
1793 int (*readlink)(struct inode *, struct page *, unsigned int,
1794 unsigned int);
1da177e4 1795 int (*create) (struct inode *, struct dentry *,
8867fe58 1796 struct iattr *, int);
912678db 1797 int (*remove) (struct inode *, struct dentry *);
ed7e9ad0 1798 void (*unlink_setup) (struct rpc_message *, struct dentry *, struct inode *);
34e137cc 1799 void (*unlink_rpc_prepare) (struct rpc_task *, struct nfs_unlinkdata *);
e4eff1a6 1800 int (*unlink_done) (struct rpc_task *, struct inode *);
f2c2c552
TM
1801 void (*rename_setup) (struct rpc_message *msg,
1802 struct dentry *old_dentry,
1803 struct dentry *new_dentry);
c6bfa1a1 1804 void (*rename_rpc_prepare)(struct rpc_task *task, struct nfs_renamedata *);
d3d4152a 1805 int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir);
beffb8fe 1806 int (*link) (struct inode *, struct inode *, const struct qstr *);
f003a717 1807 int (*symlink) (struct inode *, struct dentry *, struct folio *,
94a6d753 1808 unsigned int, struct iattr *);
1da177e4 1809 int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
beffb8fe 1810 int (*rmdir) (struct inode *, const struct qstr *);
82e22a5e 1811 int (*readdir) (struct nfs_readdir_arg *, struct nfs_readdir_res *);
1da177e4
LT
1812 int (*mknod) (struct inode *, struct dentry *, struct iattr *,
1813 dev_t);
1814 int (*statfs) (struct nfs_server *, struct nfs_fh *,
1815 struct nfs_fsstat *);
1816 int (*fsinfo) (struct nfs_server *, struct nfs_fh *,
1817 struct nfs_fsinfo *);
1818 int (*pathconf) (struct nfs_server *, struct nfs_fh *,
1819 struct nfs_pathconf *);
e9326dca 1820 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
a7a3b1e9 1821 int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, bool);
d45f60c6
WAA
1822 int (*pgio_rpc_prepare)(struct rpc_task *,
1823 struct nfs_pgio_header *);
1824 void (*read_setup)(struct nfs_pgio_header *, struct rpc_message *);
1825 int (*read_done)(struct rpc_task *, struct nfs_pgio_header *);
fb91fb0e
AS
1826 void (*write_setup)(struct nfs_pgio_header *, struct rpc_message *,
1827 struct rpc_clnt **);
d45f60c6 1828 int (*write_done)(struct rpc_task *, struct nfs_pgio_header *);
e9ae1ee2
AS
1829 void (*commit_setup) (struct nfs_commit_data *, struct rpc_message *,
1830 struct rpc_clnt **);
0b7c0153
FI
1831 void (*commit_rpc_prepare)(struct rpc_task *, struct nfs_commit_data *);
1832 int (*commit_done) (struct rpc_task *, struct nfs_commit_data *);
1da177e4 1833 int (*lock)(struct file *, int, struct file_lock *);
2116271a 1834 int (*lock_check_bounds)(const struct file_lock *);
ada70d94 1835 void (*clear_acl_cache)(struct inode *);
7fe5c398 1836 void (*close_context)(struct nfs_open_context *ctx, int);
2b484297
TM
1837 struct inode * (*open_context) (struct inode *dir,
1838 struct nfs_open_context *ctx,
1839 int open_flags,
5bc2afc2
TM
1840 struct iattr *iattr,
1841 int *);
4201916f 1842 int (*have_delegation)(struct inode *, fmode_t, int);
adb4b42d 1843 int (*return_delegation)(struct inode *);
6663ee7f 1844 struct nfs_client *(*alloc_client) (const struct nfs_client_initdata *);
5c6e5b60
TM
1845 struct nfs_client *(*init_client) (struct nfs_client *,
1846 const struct nfs_client_initdata *);
cdb7eced 1847 void (*free_client) (struct nfs_client *);
62a55d08 1848 struct nfs_server *(*create_server)(struct fs_context *);
1179acc6
BS
1849 struct nfs_server *(*clone_server)(struct nfs_server *, struct nfs_fh *,
1850 struct nfs_fattr *, rpc_authflavor_t);
1976b2b3 1851 int (*discover_trunking)(struct nfs_server *, struct nfs_fh *);
4dc73c67
N
1852 void (*enable_swap)(struct inode *inode);
1853 void (*disable_swap)(struct inode *inode);
1da177e4
LT
1854};
1855
1da177e4
LT
1856/*
1857 * Function vectors etc. for the NFS client
1858 */
509de811
DH
1859extern const struct nfs_rpc_ops nfs_v2_clientops;
1860extern const struct nfs_rpc_ops nfs_v3_clientops;
1861extern const struct nfs_rpc_ops nfs_v4_clientops;
a613fa16
TM
1862extern const struct rpc_version nfs_version2;
1863extern const struct rpc_version nfs_version3;
1864extern const struct rpc_version nfs_version4;
1da177e4 1865
a613fa16
TM
1866extern const struct rpc_version nfsacl_version3;
1867extern const struct rpc_program nfsacl_program;
b7fa0554 1868
1da177e4 1869#endif