blob: adbbeae9ce5b482fa6bb960e253916d236d944c3 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#ifndef _LINUX_NFS_XDR_H
3#define _LINUX_NFS_XDR_H
4
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +00005#include <linux/nfsacl.h>
Bryan Schumaker5a5ea0d2011-03-24 17:12:29 +00006#include <linux/sunrpc/gss_api.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07007
Chuck Lever40859d72005-11-30 18:09:02 -05008/*
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
Trond Myklebust6926afd12012-01-07 13:22:46 -050018struct nfs4_string {
19 unsigned int len;
20 char *data;
21};
22
Trond Myklebust8b4bdcf2006-06-09 09:34:19 -040023struct nfs_fsid {
24 uint64_t major;
25 uint64_t minor;
Linus Torvalds1da177e2005-04-16 15:20:36 -070026};
27
Trond Myklebust8b4bdcf2006-06-09 09:34:19 -040028/*
29 * Helper for checking equality between 2 fsids.
30 */
31static inline int nfs_fsid_equal(const struct nfs_fsid *a, const struct nfs_fsid *b)
32{
33 return a->major == b->major && a->minor == b->minor;
34}
35
Andy Adamson88034c32012-05-23 05:02:34 -040036struct nfs4_threshold {
37 __u32 bm;
38 __u32 l_type;
39 __u64 rd_sz;
40 __u64 wr_sz;
41 __u64 rd_io_sz;
42 __u64 wr_io_sz;
43};
44
Linus Torvalds1da177e2005-04-16 15:20:36 -070045struct nfs_fattr {
Trond Myklebust9e6e70f2009-03-11 14:10:24 -040046 unsigned int valid; /* which fields are valid */
Trond Myklebustbca79472009-03-11 14:10:26 -040047 umode_t mode;
Linus Torvalds1da177e2005-04-16 15:20:36 -070048 __u32 nlink;
Eric W. Biederman54f834c2013-02-01 14:16:29 -080049 kuid_t uid;
50 kgid_t gid;
Richard Kennedy9fa8d662008-08-26 16:23:20 +010051 dev_t rdev;
Linus Torvalds1da177e2005-04-16 15:20:36 -070052 __u64 size;
53 union {
54 struct {
55 __u32 blocksize;
56 __u32 blocks;
57 } nfs2;
58 struct {
59 __u64 used;
60 } nfs3;
61 } du;
Trond Myklebust8b4bdcf2006-06-09 09:34:19 -040062 struct nfs_fsid fsid;
Linus Torvalds1da177e2005-04-16 15:20:36 -070063 __u64 fileid;
Trond Myklebust28331a42011-04-27 13:47:52 -040064 __u64 mounted_on_fileid;
Trond Myklebuste86d5a02019-10-04 16:38:56 -040065 struct timespec64 atime;
66 struct timespec64 mtime;
67 struct timespec64 ctime;
Linus Torvalds1da177e2005-04-16 15:20:36 -070068 __u64 change_attr; /* NFSv4 change attribute */
69 __u64 pre_change_attr;/* pre-op NFSv4 change attribute */
Trond Myklebust1ca277d2009-03-11 14:10:25 -040070 __u64 pre_size; /* pre_op_attr.size */
Trond Myklebuste86d5a02019-10-04 16:38:56 -040071 struct timespec64 pre_mtime; /* pre_op_attr.mtime */
72 struct timespec64 pre_ctime; /* pre_op_attr.ctime */
Trond Myklebust33801142005-10-27 22:12:39 -040073 unsigned long time_start;
Trond Myklebust4704f0e2008-10-14 19:16:07 -040074 unsigned long gencount;
Trond Myklebust6926afd12012-01-07 13:22:46 -050075 struct nfs4_string *owner_name;
76 struct nfs4_string *group_name;
Andy Adamson88034c32012-05-23 05:02:34 -040077 struct nfs4_threshold *mdsthreshold; /* pNFS threshold hints */
Linus Torvalds1da177e2005-04-16 15:20:36 -070078};
79
Trond Myklebust9e6e70f2009-03-11 14:10:24 -040080#define NFS_ATTR_FATTR_TYPE (1U << 0)
81#define NFS_ATTR_FATTR_MODE (1U << 1)
82#define NFS_ATTR_FATTR_NLINK (1U << 2)
83#define NFS_ATTR_FATTR_OWNER (1U << 3)
84#define NFS_ATTR_FATTR_GROUP (1U << 4)
85#define NFS_ATTR_FATTR_RDEV (1U << 5)
86#define NFS_ATTR_FATTR_SIZE (1U << 6)
87#define NFS_ATTR_FATTR_PRESIZE (1U << 7)
88#define NFS_ATTR_FATTR_BLOCKS_USED (1U << 8)
89#define NFS_ATTR_FATTR_SPACE_USED (1U << 9)
90#define NFS_ATTR_FATTR_FSID (1U << 10)
91#define NFS_ATTR_FATTR_FILEID (1U << 11)
92#define NFS_ATTR_FATTR_ATIME (1U << 12)
93#define NFS_ATTR_FATTR_MTIME (1U << 13)
94#define NFS_ATTR_FATTR_CTIME (1U << 14)
95#define NFS_ATTR_FATTR_PREMTIME (1U << 15)
96#define NFS_ATTR_FATTR_PRECTIME (1U << 16)
97#define NFS_ATTR_FATTR_CHANGE (1U << 17)
98#define NFS_ATTR_FATTR_PRECHANGE (1U << 18)
Chuck Lever81934dd2012-03-01 17:01:57 -050099#define NFS_ATTR_FATTR_V4_LOCATIONS (1U << 19)
100#define NFS_ATTR_FATTR_V4_REFERRAL (1U << 20)
101#define NFS_ATTR_FATTR_MOUNTPOINT (1U << 21)
102#define NFS_ATTR_FATTR_MOUNTED_ON_FILEID (1U << 22)
103#define NFS_ATTR_FATTR_OWNER_NAME (1U << 23)
104#define NFS_ATTR_FATTR_GROUP_NAME (1U << 24)
David Quigleye64a4212013-05-22 12:50:39 -0400105#define NFS_ATTR_FATTR_V4_SECURITY_LABEL (1U << 25)
Trond Myklebust9e6e70f2009-03-11 14:10:24 -0400106
107#define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \
108 | NFS_ATTR_FATTR_MODE \
109 | NFS_ATTR_FATTR_NLINK \
110 | NFS_ATTR_FATTR_OWNER \
111 | NFS_ATTR_FATTR_GROUP \
112 | NFS_ATTR_FATTR_RDEV \
113 | NFS_ATTR_FATTR_SIZE \
114 | NFS_ATTR_FATTR_FSID \
115 | NFS_ATTR_FATTR_FILEID \
116 | NFS_ATTR_FATTR_ATIME \
117 | NFS_ATTR_FATTR_MTIME \
Trond Myklebust3a1556e2012-04-27 13:48:18 -0400118 | NFS_ATTR_FATTR_CTIME \
119 | NFS_ATTR_FATTR_CHANGE)
Trond Myklebust9e6e70f2009-03-11 14:10:24 -0400120#define NFS_ATTR_FATTR_V2 (NFS_ATTR_FATTR \
121 | NFS_ATTR_FATTR_BLOCKS_USED)
122#define NFS_ATTR_FATTR_V3 (NFS_ATTR_FATTR \
123 | NFS_ATTR_FATTR_SPACE_USED)
124#define NFS_ATTR_FATTR_V4 (NFS_ATTR_FATTR \
David Quigleye64a4212013-05-22 12:50:39 -0400125 | NFS_ATTR_FATTR_SPACE_USED \
126 | NFS_ATTR_FATTR_V4_SECURITY_LABEL)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700127
128/*
Jeff Layton3132e492016-08-10 15:58:24 -0400129 * Maximal number of supported layout drivers.
130 */
131#define NFS_MAX_LAYOUT_TYPES 8
132
133/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700134 * Info on the file system
135 */
136struct nfs_fsinfo {
137 struct nfs_fattr *fattr; /* Post-op attributes */
138 __u32 rtmax; /* max. read transfer size */
139 __u32 rtpref; /* pref. read transfer size */
140 __u32 rtmult; /* reads should be multiple of this */
141 __u32 wtmax; /* max. write transfer size */
142 __u32 wtpref; /* pref. write transfer size */
143 __u32 wtmult; /* writes should be multiple of this */
144 __u32 dtpref; /* pref. readdir transfer size */
145 __u64 maxfilesize;
Trond Myklebuste86d5a02019-10-04 16:38:56 -0400146 struct timespec64 time_delta; /* server time granularity */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700147 __u32 lease_time; /* in seconds */
Jeff Laytonca440c32016-09-15 14:40:49 -0400148 __u32 nlayouttypes; /* number of layouttypes */
Jeff Layton3132e492016-08-10 15:58:24 -0400149 __u32 layouttype[NFS_MAX_LAYOUT_TYPES]; /* supported pnfs layout driver */
Fred Isamandae100c2011-07-30 20:52:37 -0400150 __u32 blksize; /* preferred pnfs io block size */
Peng Tao2a92ee92015-09-26 02:24:37 +0800151 __u32 clone_blksize; /* granularity of a CLONE operation */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700152};
153
154struct nfs_fsstat {
155 struct nfs_fattr *fattr; /* Post-op attributes */
156 __u64 tbytes; /* total size in bytes */
157 __u64 fbytes; /* # of free bytes */
158 __u64 abytes; /* # of bytes available to user */
159 __u64 tfiles; /* # of files */
160 __u64 ffiles; /* # of free files */
161 __u64 afiles; /* # of files available to user */
162};
163
164struct nfs2_fsstat {
165 __u32 tsize; /* Server transfer size */
166 __u32 bsize; /* Filesystem block size */
167 __u32 blocks; /* No. of "bsize" blocks on filesystem */
168 __u32 bfree; /* No. of free "bsize" blocks */
169 __u32 bavail; /* No. of available "bsize" blocks */
170};
171
172struct nfs_pathconf {
173 struct nfs_fattr *fattr; /* Post-op attributes */
174 __u32 max_link; /* max # of hard links */
175 __u32 max_namelen; /* max name length */
176};
177
178struct nfs4_change_info {
179 u32 atomic;
180 u64 before;
181 u64 after;
182};
183
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700184struct nfs_seqid;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400185
Andy Adamson557134a2009-04-01 09:21:53 -0400186/* nfs41 sessions channel attributes */
187struct nfs4_channel_attrs {
Andy Adamson557134a2009-04-01 09:21:53 -0400188 u32 max_rqst_sz;
189 u32 max_resp_sz;
190 u32 max_resp_sz_cached;
191 u32 max_ops;
192 u32 max_reqs;
193};
194
Trond Myklebust76e697b2012-11-26 14:20:49 -0500195struct nfs4_slot;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400196struct nfs4_sequence_args {
Trond Myklebust2b2fa712012-11-16 12:58:36 -0500197 struct nfs4_slot *sa_slot;
Trond Myklebust8fe72ba2012-10-29 19:02:20 -0400198 u8 sa_cache_this : 1,
199 sa_privileged : 1;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400200};
201
202struct nfs4_sequence_res {
Benny Halevydfb4f3092010-09-24 09:17:01 -0400203 struct nfs4_slot *sr_slot; /* slot used to send request */
Trond Myklebust8e63b6a2012-12-15 15:21:52 -0500204 unsigned long sr_timestamp;
Andy Adamsonfbcd4ab2009-04-01 09:22:15 -0400205 int sr_status; /* sequence operation status */
Alexandros Batsakis0629e372009-12-05 13:46:14 -0500206 u32 sr_status_flags;
Trond Myklebustda0507b2012-11-20 18:10:30 -0500207 u32 sr_highest_slotid;
Trond Myklebust464ee9f2012-11-20 12:49:27 -0500208 u32 sr_target_highest_slotid;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400209};
210
Andy Adamson2050f0c2009-04-01 09:22:30 -0400211struct nfs4_get_lease_time_args {
212 struct nfs4_sequence_args la_seq_args;
213};
214
215struct nfs4_get_lease_time_res {
Andy Adamson2050f0c2009-04-01 09:22:30 -0400216 struct nfs4_sequence_res lr_seq_res;
Trond Myklebust62ae0822012-11-29 17:10:01 -0500217 struct nfs_fsinfo *lr_fsinfo;
Andy Adamson2050f0c2009-04-01 09:22:30 -0400218};
219
Trond Myklebustf8c3cf92016-10-20 10:12:45 -0400220struct xdr_stream;
221struct nfs4_xdr_opaque_data;
222
223struct nfs4_xdr_opaque_ops {
224 void (*encode)(struct xdr_stream *, const void *args,
225 const struct nfs4_xdr_opaque_data *);
226 void (*free)(struct nfs4_xdr_opaque_data *);
227};
228
229struct nfs4_xdr_opaque_data {
230 const struct nfs4_xdr_opaque_ops *ops;
231 void *data;
232};
233
Andy Adamsonb1f69b72010-10-20 00:18:03 -0400234#define PNFS_LAYOUT_MAXSIZE 4096
235
236struct nfs4_layoutdriver_data {
Weston Andros Adamson35124a02011-03-24 16:48:21 -0400237 struct page **pages;
238 __u32 pglen;
Andy Adamsonb1f69b72010-10-20 00:18:03 -0400239 __u32 len;
Andy Adamsonb1f69b72010-10-20 00:18:03 -0400240};
241
242struct pnfs_layout_range {
243 u32 iomode;
244 u64 offset;
245 u64 length;
246};
247
248struct nfs4_layoutget_args {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500249 struct nfs4_sequence_args seq_args;
Andy Adamsonb1f69b72010-10-20 00:18:03 -0400250 __u32 type;
251 struct pnfs_layout_range range;
252 __u64 minlength;
253 __u32 maxcount;
254 struct inode *inode;
255 struct nfs_open_context *ctx;
Fred Isamancf7d63f2011-01-06 11:36:25 +0000256 nfs4_stateid stateid;
Weston Andros Adamson35124a02011-03-24 16:48:21 -0400257 struct nfs4_layoutdriver_data layout;
Andy Adamsonb1f69b72010-10-20 00:18:03 -0400258};
259
260struct nfs4_layoutget_res {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500261 struct nfs4_sequence_res seq_res;
Fred Isaman808ba322016-10-04 15:02:21 -0400262 int status;
Andy Adamsonb1f69b72010-10-20 00:18:03 -0400263 __u32 return_on_close;
264 struct pnfs_layout_range range;
265 __u32 type;
266 nfs4_stateid stateid;
Weston Andros Adamson35124a02011-03-24 16:48:21 -0400267 struct nfs4_layoutdriver_data *layoutp;
Andy Adamsonb1f69b72010-10-20 00:18:03 -0400268};
269
270struct nfs4_layoutget {
271 struct nfs4_layoutget_args args;
272 struct nfs4_layoutget_res res;
NeilBrowna52458b2018-12-03 11:30:31 +1100273 const struct cred *cred;
Trond Myklebusta75b9df2011-05-11 18:00:51 -0400274 gfp_t gfp_flags;
Andy Adamsonb1f69b72010-10-20 00:18:03 -0400275};
276
277struct nfs4_getdeviceinfo_args {
Andy Adamsonb1f69b72010-10-20 00:18:03 -0400278 struct nfs4_sequence_args seq_args;
Trond Myklebust62ae0822012-11-29 17:10:01 -0500279 struct pnfs_device *pdev;
Trond Myklebust4e590802015-03-09 14:01:25 -0400280 __u32 notify_types;
Andy Adamsonb1f69b72010-10-20 00:18:03 -0400281};
282
283struct nfs4_getdeviceinfo_res {
Andy Adamsonb1f69b72010-10-20 00:18:03 -0400284 struct nfs4_sequence_res seq_res;
Trond Myklebust62ae0822012-11-29 17:10:01 -0500285 struct pnfs_device *pdev;
Trond Myklebust4e590802015-03-09 14:01:25 -0400286 __u32 notification;
Andy Adamsonb1f69b72010-10-20 00:18:03 -0400287};
288
Andy Adamson863a3c62011-03-23 13:27:54 +0000289struct nfs4_layoutcommit_args {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500290 struct nfs4_sequence_args seq_args;
Andy Adamson863a3c62011-03-23 13:27:54 +0000291 nfs4_stateid stateid;
292 __u64 lastbytewritten;
293 struct inode *inode;
294 const u32 *bitmask;
Christoph Hellwig5f919c92014-08-21 11:09:25 -0500295 size_t layoutupdate_len;
296 struct page *layoutupdate_page;
297 struct page **layoutupdate_pages;
Kinglong Meec8975702016-02-01 09:39:29 +0800298 __be32 *start_p;
Andy Adamson863a3c62011-03-23 13:27:54 +0000299};
300
301struct nfs4_layoutcommit_res {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500302 struct nfs4_sequence_res seq_res;
Andy Adamson863a3c62011-03-23 13:27:54 +0000303 struct nfs_fattr *fattr;
304 const struct nfs_server *server;
Andy Adamsondb29c082011-07-30 20:52:38 -0400305 int status;
Andy Adamson863a3c62011-03-23 13:27:54 +0000306};
307
308struct nfs4_layoutcommit_data {
309 struct rpc_task task;
310 struct nfs_fattr fattr;
Peng Taoa9bae562011-07-30 20:52:33 -0400311 struct list_head lseg_list;
NeilBrowna52458b2018-12-03 11:30:31 +1100312 const struct cred *cred;
Trond Myklebust472e2592015-02-05 16:50:30 -0500313 struct inode *inode;
Andy Adamson863a3c62011-03-23 13:27:54 +0000314 struct nfs4_layoutcommit_args args;
315 struct nfs4_layoutcommit_res res;
316};
317
Benny Halevycbe82602011-05-22 19:52:37 +0300318struct nfs4_layoutreturn_args {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500319 struct nfs4_sequence_args seq_args;
Trond Myklebusta56aaa02011-06-15 11:59:10 -0400320 struct pnfs_layout_hdr *layout;
Benny Halevycbe82602011-05-22 19:52:37 +0300321 struct inode *inode;
Peng Tao15eb67c2014-11-17 09:30:36 +0800322 struct pnfs_layout_range range;
Benny Halevycbe82602011-05-22 19:52:37 +0300323 nfs4_stateid stateid;
Trond Myklebusta56aaa02011-06-15 11:59:10 -0400324 __u32 layout_type;
Trond Myklebust4d796d72016-09-23 11:38:08 -0400325 struct nfs4_xdr_opaque_data *ld_private;
Benny Halevycbe82602011-05-22 19:52:37 +0300326};
327
328struct nfs4_layoutreturn_res {
329 struct nfs4_sequence_res seq_res;
330 u32 lrs_present;
331 nfs4_stateid stateid;
332};
333
334struct nfs4_layoutreturn {
335 struct nfs4_layoutreturn_args args;
336 struct nfs4_layoutreturn_res res;
NeilBrowna52458b2018-12-03 11:30:31 +1100337 const struct cred *cred;
Benny Halevycbe82602011-05-22 19:52:37 +0300338 struct nfs_client *clp;
Trond Myklebust5a0ec8ac2015-02-05 16:35:16 -0500339 struct inode *inode;
Benny Halevycbe82602011-05-22 19:52:37 +0300340 int rpc_status;
Trond Myklebust4d796d72016-09-23 11:38:08 -0400341 struct nfs4_xdr_opaque_data ld_private;
Benny Halevycbe82602011-05-22 19:52:37 +0300342};
343
Trond Myklebustbe3a5d22015-06-23 19:51:55 +0800344#define PNFS_LAYOUTSTATS_MAXSIZE 256
345
346struct nfs42_layoutstat_args;
347struct nfs42_layoutstat_devinfo;
348typedef void (*layoutstats_encode_t)(struct xdr_stream *,
349 struct nfs42_layoutstat_args *,
350 struct nfs42_layoutstat_devinfo *);
351
352/* Per file per deviceid layoutstats */
353struct nfs42_layoutstat_devinfo {
354 struct nfs4_deviceid dev_id;
355 __u64 offset;
356 __u64 length;
357 __u64 read_count;
358 __u64 read_bytes;
359 __u64 write_count;
360 __u64 write_bytes;
361 __u32 layout_type;
Trond Myklebust422c93c2016-10-06 17:53:20 -0400362 struct nfs4_xdr_opaque_data ld_private;
Trond Myklebustbe3a5d22015-06-23 19:51:55 +0800363};
364
365struct nfs42_layoutstat_args {
366 struct nfs4_sequence_args seq_args;
367 struct nfs_fh *fh;
368 struct inode *inode;
369 nfs4_stateid stateid;
370 int num_dev;
371 struct nfs42_layoutstat_devinfo *devinfo;
372};
373
374struct nfs42_layoutstat_res {
375 struct nfs4_sequence_res seq_res;
376 int num_dev;
377 int rpc_status;
378};
379
380struct nfs42_layoutstat_data {
381 struct inode *inode;
382 struct nfs42_layoutstat_args args;
383 struct nfs42_layoutstat_res res;
384};
385
Trond Myklebust3eb86092019-02-08 10:31:05 -0500386struct nfs42_device_error {
387 struct nfs4_deviceid dev_id;
388 int status;
389 enum nfs_opnum4 opnum;
390};
391
392struct nfs42_layout_error {
393 __u64 offset;
394 __u64 length;
395 nfs4_stateid stateid;
396 struct nfs42_device_error errors[1];
397};
398
399#define NFS42_LAYOUTERROR_MAX 5
400
401struct nfs42_layouterror_args {
402 struct nfs4_sequence_args seq_args;
403 struct inode *inode;
404 unsigned int num_errors;
405 struct nfs42_layout_error errors[NFS42_LAYOUTERROR_MAX];
406};
407
408struct nfs42_layouterror_res {
409 struct nfs4_sequence_res seq_res;
410 unsigned int num_errors;
411 int rpc_status;
412};
413
414struct nfs42_layouterror_data {
415 struct nfs42_layouterror_args args;
416 struct nfs42_layouterror_res res;
417 struct inode *inode;
418 struct pnfs_layout_segment *lseg;
419};
420
Peng Tao36022772015-09-26 02:24:34 +0800421struct nfs42_clone_args {
422 struct nfs4_sequence_args seq_args;
423 struct nfs_fh *src_fh;
424 struct nfs_fh *dst_fh;
425 nfs4_stateid src_stateid;
426 nfs4_stateid dst_stateid;
427 __u64 src_offset;
428 __u64 dst_offset;
429 __u64 count;
430 const u32 *dst_bitmask;
431};
432
433struct nfs42_clone_res {
434 struct nfs4_sequence_res seq_res;
435 unsigned int rpc_status;
436 struct nfs_fattr *dst_fattr;
437 const struct nfs_server *server;
438};
439
Trond Myklebust95b72eb2012-04-20 19:24:51 -0400440struct stateowner_id {
441 __u64 create_time;
442 __u32 uniquifier;
443};
444
Linus Torvalds1da177e2005-04-16 15:20:36 -0700445/*
446 * Arguments to the open call.
447 */
448struct nfs_openargs {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500449 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700450 const struct nfs_fh * fh;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700451 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700452 int open_flags;
Trond Myklebustdc0b0272008-12-23 15:21:56 -0500453 fmode_t fmode;
Trond Myklebust6ae37332015-01-30 14:21:14 -0500454 u32 share_access;
Weston Andros Adamson6168f622012-09-10 14:00:46 -0400455 u32 access;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700456 __u64 clientid;
Trond Myklebust95b72eb2012-04-20 19:24:51 -0400457 struct stateowner_id id;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700458 union {
Trond Myklebustd77d76f2010-06-16 09:52:27 -0400459 struct {
Kinglong Mee5334c5b2015-08-26 21:13:37 +0800460 struct iattr * attrs; /* UNCHECKED, GUARDED, EXCLUSIVE4_1 */
Trond Myklebustd77d76f2010-06-16 09:52:27 -0400461 nfs4_verifier verifier; /* EXCLUSIVE */
462 };
Linus Torvalds1da177e2005-04-16 15:20:36 -0700463 nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */
Trond Myklebustbd7bf9d2008-12-23 15:21:53 -0500464 fmode_t delegation_type; /* CLAIM_PREVIOUS */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700465 } u;
466 const struct qstr * name;
467 const struct nfs_server *server; /* Needed for ID mapping */
468 const u32 * bitmask;
Trond Myklebust1549210f2012-06-05 09:16:47 -0400469 const u32 * open_bitmap;
Trond Myklebust2a606182015-08-19 22:30:00 -0500470 enum open_claim_type4 claim;
Trond Myklebust549b19c2013-04-16 18:42:34 -0400471 enum createmode4 createmode;
Steve Dicksone058f702013-05-22 12:50:40 -0400472 const struct nfs4_label *label;
Andreas Gruenbacherdff25dd2016-12-02 22:53:30 -0500473 umode_t umask;
Fred Isaman56f487f2016-09-21 11:43:41 -0400474 struct nfs4_layoutget_args *lg_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700475};
476
477struct nfs_openres {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500478 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700479 nfs4_stateid stateid;
480 struct nfs_fh fh;
481 struct nfs4_change_info cinfo;
482 __u32 rflags;
483 struct nfs_fattr * f_attr;
Steve Dicksone058f702013-05-22 12:50:40 -0400484 struct nfs4_label *f_label;
Trond Myklebustc1d51932008-04-07 13:20:54 -0400485 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700486 const struct nfs_server *server;
Trond Myklebustbd7bf9d2008-12-23 15:21:53 -0500487 fmode_t delegation_type;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700488 nfs4_stateid delegation;
Trond Myklebust7d160a62015-09-05 19:06:57 -0400489 unsigned long pagemod_limit;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700490 __u32 do_recall;
Jeff Laytonaa53ed52007-06-05 14:49:03 -0400491 __u32 attrset[NFS4_BITMAP_SIZE];
Trond Myklebust6926afd12012-01-07 13:22:46 -0500492 struct nfs4_string *owner;
493 struct nfs4_string *group_owner;
Weston Andros Adamsonae2bb032012-10-02 14:49:52 -0700494 __u32 access_request;
Weston Andros Adamson6168f622012-09-10 14:00:46 -0400495 __u32 access_supported;
496 __u32 access_result;
Fred Isaman56f487f2016-09-21 11:43:41 -0400497 struct nfs4_layoutget_res *lg_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700498};
499
500/*
501 * Arguments to the open_confirm call.
502 */
503struct nfs_open_confirmargs {
Trond Myklebust17ead6c2014-02-01 14:53:23 -0500504 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700505 const struct nfs_fh * fh;
Trond Myklebustcdd4e682006-01-03 09:55:12 +0100506 nfs4_stateid * stateid;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700507 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700508};
509
510struct nfs_open_confirmres {
Trond Myklebust17ead6c2014-02-01 14:53:23 -0500511 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700512 nfs4_stateid stateid;
Trond Myklebustc1d51932008-04-07 13:20:54 -0400513 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700514};
515
516/*
517 * Arguments to the close call.
518 */
519struct nfs_closeargs {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500520 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700521 struct nfs_fh * fh;
Trond Myklebust566fcec2015-01-23 15:32:46 -0500522 nfs4_stateid stateid;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700523 struct nfs_seqid * seqid;
Trond Myklebustdc0b0272008-12-23 15:21:56 -0500524 fmode_t fmode;
Trond Myklebust6ae37332015-01-30 14:21:14 -0500525 u32 share_access;
Trond Myklebust516a6af2005-10-27 22:12:41 -0400526 const u32 * bitmask;
Trond Myklebustcf805162016-11-15 14:56:07 -0500527 struct nfs4_layoutreturn_args *lr_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700528};
529
530struct nfs_closeres {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500531 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700532 nfs4_stateid stateid;
Trond Myklebust516a6af2005-10-27 22:12:41 -0400533 struct nfs_fattr * fattr;
Trond Myklebustc1d51932008-04-07 13:20:54 -0400534 struct nfs_seqid * seqid;
Trond Myklebust516a6af2005-10-27 22:12:41 -0400535 const struct nfs_server *server;
Trond Myklebustcf805162016-11-15 14:56:07 -0500536 struct nfs4_layoutreturn_res *lr_res;
537 int lr_ret;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700538};
539/*
540 * * Arguments to the lock,lockt, and locku call.
541 * */
542struct nfs_lowner {
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100543 __u64 clientid;
Trond Myklebust9f958ab2007-07-02 13:58:33 -0400544 __u64 id;
Trond Myklebustd035c362010-12-21 10:45:27 -0500545 dev_t s_dev;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700546};
547
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100548struct nfs_lock_args {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500549 struct nfs4_sequence_args seq_args;
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100550 struct nfs_fh * fh;
551 struct file_lock * fl;
Trond Myklebust06735b32005-10-18 14:20:15 -0700552 struct nfs_seqid * lock_seqid;
Trond Myklebust425c1d42015-01-24 14:57:53 -0500553 nfs4_stateid lock_stateid;
Trond Myklebust06735b32005-10-18 14:20:15 -0700554 struct nfs_seqid * open_seqid;
Trond Myklebust425c1d42015-01-24 14:57:53 -0500555 nfs4_stateid open_stateid;
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100556 struct nfs_lowner lock_owner;
557 unsigned char block : 1;
558 unsigned char reclaim : 1;
Trond Myklebustc69899a2015-01-24 16:03:52 -0500559 unsigned char new_lock : 1;
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100560 unsigned char new_lock_owner : 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700561};
562
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100563struct nfs_lock_res {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500564 struct nfs4_sequence_res seq_res;
Trond Myklebustc1d51932008-04-07 13:20:54 -0400565 nfs4_stateid stateid;
566 struct nfs_seqid * lock_seqid;
567 struct nfs_seqid * open_seqid;
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100568};
569
570struct nfs_locku_args {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500571 struct nfs4_sequence_args seq_args;
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100572 struct nfs_fh * fh;
573 struct file_lock * fl;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700574 struct nfs_seqid * seqid;
Trond Myklebust425c1d42015-01-24 14:57:53 -0500575 nfs4_stateid stateid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700576};
577
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100578struct nfs_locku_res {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500579 struct nfs4_sequence_res seq_res;
Trond Myklebustc1d51932008-04-07 13:20:54 -0400580 nfs4_stateid stateid;
581 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700582};
583
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100584struct nfs_lockt_args {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500585 struct nfs4_sequence_args seq_args;
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100586 struct nfs_fh * fh;
587 struct file_lock * fl;
588 struct nfs_lowner lock_owner;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700589};
590
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100591struct nfs_lockt_res {
Benny Halevy9ff71c32009-04-01 09:21:52 -0400592 struct nfs4_sequence_res seq_res;
Trond Myklebust62ae0822012-11-29 17:10:01 -0500593 struct file_lock * denied; /* LOCK, LOCKT failed */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700594};
595
Trond Myklebustd3c7b7c2010-07-01 12:49:01 -0400596struct nfs_release_lockowner_args {
Trond Myklebustb7e63a12014-02-26 11:19:14 -0800597 struct nfs4_sequence_args seq_args;
Trond Myklebustd3c7b7c2010-07-01 12:49:01 -0400598 struct nfs_lowner lock_owner;
599};
600
Trond Myklebustb7e63a12014-02-26 11:19:14 -0800601struct nfs_release_lockowner_res {
602 struct nfs4_sequence_res seq_res;
603};
604
Linus Torvalds1da177e2005-04-16 15:20:36 -0700605struct nfs4_delegreturnargs {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500606 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700607 const struct nfs_fh *fhandle;
608 const nfs4_stateid *stateid;
Trond Myklebustfa178f22006-01-03 09:55:38 +0100609 const u32 * bitmask;
Trond Myklebust586f1c32016-11-15 15:03:33 -0500610 struct nfs4_layoutreturn_args *lr_args;
Trond Myklebustfa178f22006-01-03 09:55:38 +0100611};
612
613struct nfs4_delegreturnres {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500614 struct nfs4_sequence_res seq_res;
Trond Myklebustfa178f22006-01-03 09:55:38 +0100615 struct nfs_fattr * fattr;
Trond Myklebust516285eb2015-09-20 16:15:24 -0400616 struct nfs_server *server;
Trond Myklebust586f1c32016-11-15 15:03:33 -0500617 struct nfs4_layoutreturn_res *lr_res;
618 int lr_ret;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700619};
620
621/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700622 * Arguments to the write call.
623 */
Trond Myklebust2f2c63b2012-06-08 11:56:09 -0400624struct nfs_write_verifier {
625 char data[8];
626};
627
Linus Torvalds1da177e2005-04-16 15:20:36 -0700628struct nfs_writeverf {
Trond Myklebust2f2c63b2012-06-08 11:56:09 -0400629 struct nfs_write_verifier verifier;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700630 enum nfs3_stable_how committed;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700631};
632
Linus Torvalds1da177e2005-04-16 15:20:36 -0700633/*
Anna Schumaker3c6b8992014-05-06 09:12:24 -0400634 * Arguments shared by the read and write call.
635 */
636struct nfs_pgio_args {
637 struct nfs4_sequence_args seq_args;
638 struct nfs_fh * fh;
639 struct nfs_open_context *context;
640 struct nfs_lock_context *lock_context;
641 nfs4_stateid stateid;
642 __u64 offset;
643 __u32 count;
644 unsigned int pgbase;
645 struct page ** pages;
Trond Myklebust28d52232018-09-24 13:15:37 -0400646 union {
647 unsigned int replen; /* used by read */
648 struct {
649 const u32 * bitmask; /* used by write */
650 enum nfs3_stable_how stable; /* used by write */
651 };
652 };
Anna Schumaker3c6b8992014-05-06 09:12:24 -0400653};
654
Anna Schumaker9137bdf2014-05-06 09:12:25 -0400655struct nfs_pgio_res {
656 struct nfs4_sequence_res seq_res;
657 struct nfs_fattr * fattr;
658 __u32 count;
Peng Taoaabff4d2014-08-27 10:47:14 +0800659 __u32 op_status;
Trond Myklebust28d52232018-09-24 13:15:37 -0400660 union {
661 struct {
662 unsigned int replen; /* used by read */
663 int eof; /* used by read */
664 };
665 struct {
666 struct nfs_writeverf * verf; /* used by write */
667 const struct nfs_server *server; /* used by write */
668 };
669 };
Anna Schumaker9137bdf2014-05-06 09:12:25 -0400670};
671
Anna Schumaker3c6b8992014-05-06 09:12:24 -0400672/*
Fred Isaman0b7c0152012-04-20 14:47:39 -0400673 * Arguments to the commit call.
674 */
675struct nfs_commitargs {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500676 struct nfs4_sequence_args seq_args;
Fred Isaman0b7c0152012-04-20 14:47:39 -0400677 struct nfs_fh *fh;
678 __u64 offset;
679 __u32 count;
680 const u32 *bitmask;
Fred Isaman0b7c0152012-04-20 14:47:39 -0400681};
682
683struct nfs_commitres {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500684 struct nfs4_sequence_res seq_res;
Peng Taoaabff4d2014-08-27 10:47:14 +0800685 __u32 op_status;
Fred Isaman0b7c0152012-04-20 14:47:39 -0400686 struct nfs_fattr *fattr;
687 struct nfs_writeverf *verf;
688 const struct nfs_server *server;
Fred Isaman0b7c0152012-04-20 14:47:39 -0400689};
690
691/*
Trond Myklebust4fdc17b2007-07-14 15:39:57 -0400692 * Common arguments to the unlink call
693 */
694struct nfs_removeargs {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500695 struct nfs4_sequence_args seq_args;
Trond Myklebust4fdc17b2007-07-14 15:39:57 -0400696 const struct nfs_fh *fh;
697 struct qstr name;
Trond Myklebust4fdc17b2007-07-14 15:39:57 -0400698};
699
700struct nfs_removeres {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500701 struct nfs4_sequence_res seq_res;
Trond Myklebust516285eb2015-09-20 16:15:24 -0400702 struct nfs_server *server;
Trond Myklebustd3468902010-04-16 16:22:50 -0400703 struct nfs_fattr *dir_attr;
Trond Myklebust4fdc17b2007-07-14 15:39:57 -0400704 struct nfs4_change_info cinfo;
Trond Myklebust4fdc17b2007-07-14 15:39:57 -0400705};
706
707/*
Jeff Layton920769f2010-09-17 17:30:25 -0400708 * Common arguments to the rename call
709 */
710struct nfs_renameargs {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500711 struct nfs4_sequence_args seq_args;
Jeff Layton920769f2010-09-17 17:30:25 -0400712 const struct nfs_fh *old_dir;
713 const struct nfs_fh *new_dir;
714 const struct qstr *old_name;
715 const struct qstr *new_name;
Jeff Layton920769f2010-09-17 17:30:25 -0400716};
717
Jeff Laytone8582a82010-09-17 17:31:06 -0400718struct nfs_renameres {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500719 struct nfs4_sequence_res seq_res;
Trond Myklebust516285eb2015-09-20 16:15:24 -0400720 struct nfs_server *server;
Jeff Laytone8582a82010-09-17 17:31:06 -0400721 struct nfs4_change_info old_cinfo;
722 struct nfs_fattr *old_fattr;
723 struct nfs4_change_info new_cinfo;
724 struct nfs_fattr *new_fattr;
Jeff Laytone8582a82010-09-17 17:31:06 -0400725};
726
Weston Andros Adamsona3f73c22013-10-18 15:15:16 -0400727/* parsed sec= options */
Weston Andros Adamson4d4b69d2013-10-18 15:15:19 -0400728#define NFS_AUTH_INFO_MAX_FLAVORS 12 /* see fs/nfs/super.c */
Weston Andros Adamsona3f73c22013-10-18 15:15:16 -0400729struct nfs_auth_info {
730 unsigned int flavor_len;
Weston Andros Adamson4d4b69d2013-10-18 15:15:19 -0400731 rpc_authflavor_t flavors[NFS_AUTH_INFO_MAX_FLAVORS];
Weston Andros Adamsona3f73c22013-10-18 15:15:16 -0400732};
733
Jeff Layton920769f2010-09-17 17:30:25 -0400734/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700735 * Argument struct for decode_entry function
736 */
737struct nfs_entry {
738 __u64 ino;
739 __u64 cookie,
740 prev_cookie;
741 const char * name;
742 unsigned int len;
743 int eof;
744 struct nfs_fh * fh;
745 struct nfs_fattr * fattr;
Steve Dicksone058f702013-05-22 12:50:40 -0400746 struct nfs4_label *label;
Trond Myklebust0b26a0b2010-11-20 14:26:44 -0500747 unsigned char d_type;
Chuck Lever573c4e12010-12-14 14:58:11 +0000748 struct nfs_server * server;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700749};
750
751/*
752 * The following types are for NFSv2 only.
753 */
754struct nfs_sattrargs {
755 struct nfs_fh * fh;
756 struct iattr * sattr;
757};
758
759struct nfs_diropargs {
760 struct nfs_fh * fh;
761 const char * name;
762 unsigned int len;
763};
764
765struct nfs_createargs {
766 struct nfs_fh * fh;
767 const char * name;
768 unsigned int len;
769 struct iattr * sattr;
770};
771
Linus Torvalds1da177e2005-04-16 15:20:36 -0700772struct nfs_setattrargs {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500773 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700774 struct nfs_fh * fh;
775 nfs4_stateid stateid;
776 struct iattr * iap;
777 const struct nfs_server * server; /* Needed for name mapping */
778 const u32 * bitmask;
Steve Dicksone058f702013-05-22 12:50:40 -0400779 const struct nfs4_label *label;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700780};
781
J. Bruce Fields23ec6962005-06-22 17:16:22 +0000782struct nfs_setaclargs {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500783 struct nfs4_sequence_args seq_args;
J. Bruce Fields23ec6962005-06-22 17:16:22 +0000784 struct nfs_fh * fh;
785 size_t acl_len;
J. Bruce Fields23ec6962005-06-22 17:16:22 +0000786 struct page ** acl_pages;
787};
788
Benny Halevy73c403a2009-04-01 09:22:01 -0400789struct nfs_setaclres {
790 struct nfs4_sequence_res seq_res;
791};
792
J. Bruce Fields029d1052005-06-22 17:16:22 +0000793struct nfs_getaclargs {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500794 struct nfs4_sequence_args seq_args;
J. Bruce Fields029d1052005-06-22 17:16:22 +0000795 struct nfs_fh * fh;
796 size_t acl_len;
J. Bruce Fields029d1052005-06-22 17:16:22 +0000797 struct page ** acl_pages;
798};
799
Andy Adamsonbf118a32011-12-07 11:55:27 -0500800/* getxattr ACL interface flags */
Trond Myklebust1f1ea6c2012-08-26 11:44:43 -0700801#define NFS4_ACL_TRUNC 0x0001 /* ACL was truncated */
Benny Halevy663c79b2009-04-01 09:21:59 -0400802struct nfs_getaclres {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500803 struct nfs4_sequence_res seq_res;
Benny Halevy663c79b2009-04-01 09:21:59 -0400804 size_t acl_len;
Andy Adamsonbf118a32011-12-07 11:55:27 -0500805 size_t acl_data_offset;
806 int acl_flags;
Trond Myklebust331818f2012-02-03 18:30:53 -0500807 struct page * acl_scratch;
Benny Halevy663c79b2009-04-01 09:21:59 -0400808};
809
Linus Torvalds1da177e2005-04-16 15:20:36 -0700810struct nfs_setattrres {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500811 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700812 struct nfs_fattr * fattr;
Steve Dicksone058f702013-05-22 12:50:40 -0400813 struct nfs4_label *label;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700814 const struct nfs_server * server;
815};
816
817struct nfs_linkargs {
818 struct nfs_fh * fromfh;
819 struct nfs_fh * tofh;
820 const char * toname;
821 unsigned int tolen;
822};
823
824struct nfs_symlinkargs {
825 struct nfs_fh * fromfh;
826 const char * fromname;
827 unsigned int fromlen;
Chuck Lever94a6d752006-08-22 20:06:23 -0400828 struct page ** pages;
829 unsigned int pathlen;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700830 struct iattr * sattr;
831};
832
833struct nfs_readdirargs {
834 struct nfs_fh * fh;
835 __u32 cookie;
836 unsigned int count;
837 struct page ** pages;
838};
839
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +0000840struct nfs3_getaclargs {
841 struct nfs_fh * fh;
842 int mask;
843 struct page ** pages;
844};
845
846struct nfs3_setaclargs {
847 struct inode * inode;
848 int mask;
849 struct posix_acl * acl_access;
850 struct posix_acl * acl_default;
Trond Myklebustae46141f2009-03-10 20:33:18 -0400851 size_t len;
852 unsigned int npages;
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +0000853 struct page ** pages;
854};
855
Linus Torvalds1da177e2005-04-16 15:20:36 -0700856struct nfs_diropok {
857 struct nfs_fh * fh;
858 struct nfs_fattr * fattr;
859};
860
861struct nfs_readlinkargs {
862 struct nfs_fh * fh;
863 unsigned int pgbase;
864 unsigned int pglen;
865 struct page ** pages;
866};
867
868struct nfs3_sattrargs {
869 struct nfs_fh * fh;
870 struct iattr * sattr;
871 unsigned int guard;
Trond Myklebust6430b322019-10-04 17:00:02 -0400872 struct timespec64 guardtime;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700873};
874
875struct nfs3_diropargs {
876 struct nfs_fh * fh;
877 const char * name;
878 unsigned int len;
879};
880
881struct nfs3_accessargs {
882 struct nfs_fh * fh;
883 __u32 access;
884};
885
886struct nfs3_createargs {
887 struct nfs_fh * fh;
888 const char * name;
889 unsigned int len;
890 struct iattr * sattr;
891 enum nfs3_createmode createmode;
Al Virobc4785c2006-10-19 23:28:51 -0700892 __be32 verifier[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700893};
894
895struct nfs3_mkdirargs {
896 struct nfs_fh * fh;
897 const char * name;
898 unsigned int len;
899 struct iattr * sattr;
900};
901
902struct nfs3_symlinkargs {
903 struct nfs_fh * fromfh;
904 const char * fromname;
905 unsigned int fromlen;
Chuck Lever94a6d752006-08-22 20:06:23 -0400906 struct page ** pages;
907 unsigned int pathlen;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700908 struct iattr * sattr;
909};
910
911struct nfs3_mknodargs {
912 struct nfs_fh * fh;
913 const char * name;
914 unsigned int len;
915 enum nfs3_ftype type;
916 struct iattr * sattr;
917 dev_t rdev;
918};
919
Linus Torvalds1da177e2005-04-16 15:20:36 -0700920struct nfs3_linkargs {
921 struct nfs_fh * fromfh;
922 struct nfs_fh * tofh;
923 const char * toname;
924 unsigned int tolen;
925};
926
927struct nfs3_readdirargs {
928 struct nfs_fh * fh;
929 __u64 cookie;
Al Virobc4785c2006-10-19 23:28:51 -0700930 __be32 verf[2];
Benjamin Coddingtona7a3b1e2017-06-20 08:33:44 -0400931 bool plus;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700932 unsigned int count;
933 struct page ** pages;
934};
935
936struct nfs3_diropres {
937 struct nfs_fattr * dir_attr;
938 struct nfs_fh * fh;
939 struct nfs_fattr * fattr;
940};
941
942struct nfs3_accessres {
943 struct nfs_fattr * fattr;
944 __u32 access;
945};
946
947struct nfs3_readlinkargs {
948 struct nfs_fh * fh;
949 unsigned int pgbase;
950 unsigned int pglen;
951 struct page ** pages;
952};
953
Linus Torvalds1da177e2005-04-16 15:20:36 -0700954struct nfs3_linkres {
955 struct nfs_fattr * dir_attr;
956 struct nfs_fattr * fattr;
957};
958
959struct nfs3_readdirres {
960 struct nfs_fattr * dir_attr;
Al Virobc4785c2006-10-19 23:28:51 -0700961 __be32 * verf;
Benjamin Coddingtona7a3b1e2017-06-20 08:33:44 -0400962 bool plus;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700963};
964
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +0000965struct nfs3_getaclres {
966 struct nfs_fattr * fattr;
967 int mask;
968 unsigned int acl_access_count;
969 unsigned int acl_default_count;
970 struct posix_acl * acl_access;
971 struct posix_acl * acl_default;
972};
973
Bryan Schumaker89d77c82012-07-30 16:05:25 -0400974#if IS_ENABLED(CONFIG_NFS_V4)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700975
976typedef u64 clientid4;
977
978struct nfs4_accessargs {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500979 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700980 const struct nfs_fh * fh;
Trond Myklebust76b32992007-08-10 17:45:11 -0400981 const u32 * bitmask;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700982 u32 access;
983};
984
985struct nfs4_accessres {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500986 struct nfs4_sequence_res seq_res;
Trond Myklebust76b32992007-08-10 17:45:11 -0400987 const struct nfs_server * server;
988 struct nfs_fattr * fattr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700989 u32 supported;
990 u32 access;
991};
992
993struct nfs4_create_arg {
Trond Myklebust62ae0822012-11-29 17:10:01 -0500994 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700995 u32 ftype;
996 union {
Chuck Lever94a6d752006-08-22 20:06:23 -0400997 struct {
998 struct page ** pages;
999 unsigned int len;
1000 } symlink; /* NF4LNK */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001001 struct {
1002 u32 specdata1;
1003 u32 specdata2;
1004 } device; /* NF4BLK, NF4CHR */
1005 } u;
1006 const struct qstr * name;
1007 const struct nfs_server * server;
1008 const struct iattr * attrs;
1009 const struct nfs_fh * dir_fh;
1010 const u32 * bitmask;
Steve Dicksone058f702013-05-22 12:50:40 -04001011 const struct nfs4_label *label;
Andreas Gruenbacherdff25dd2016-12-02 22:53:30 -05001012 umode_t umask;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001013};
1014
1015struct nfs4_create_res {
Trond Myklebust62ae0822012-11-29 17:10:01 -05001016 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001017 const struct nfs_server * server;
1018 struct nfs_fh * fh;
1019 struct nfs_fattr * fattr;
Steve Dicksone058f702013-05-22 12:50:40 -04001020 struct nfs4_label *label;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001021 struct nfs4_change_info dir_cinfo;
1022};
1023
1024struct nfs4_fsinfo_arg {
Trond Myklebust62ae0822012-11-29 17:10:01 -05001025 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001026 const struct nfs_fh * fh;
1027 const u32 * bitmask;
1028};
1029
Benny Halevy3dda5e42009-04-01 09:21:57 -04001030struct nfs4_fsinfo_res {
Benny Halevy3dda5e42009-04-01 09:21:57 -04001031 struct nfs4_sequence_res seq_res;
Trond Myklebust62ae0822012-11-29 17:10:01 -05001032 struct nfs_fsinfo *fsinfo;
Benny Halevy3dda5e42009-04-01 09:21:57 -04001033};
1034
Linus Torvalds1da177e2005-04-16 15:20:36 -07001035struct nfs4_getattr_arg {
Trond Myklebust62ae0822012-11-29 17:10:01 -05001036 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001037 const struct nfs_fh * fh;
1038 const u32 * bitmask;
1039};
1040
1041struct nfs4_getattr_res {
Trond Myklebust62ae0822012-11-29 17:10:01 -05001042 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001043 const struct nfs_server * server;
1044 struct nfs_fattr * fattr;
Steve Dicksone058f702013-05-22 12:50:40 -04001045 struct nfs4_label *label;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001046};
1047
1048struct nfs4_link_arg {
Trond Myklebust62ae0822012-11-29 17:10:01 -05001049 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001050 const struct nfs_fh * fh;
1051 const struct nfs_fh * dir_fh;
1052 const struct qstr * name;
Trond Myklebust91ba2ee2005-10-27 22:12:42 -04001053 const u32 * bitmask;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001054};
1055
Trond Myklebust91ba2ee2005-10-27 22:12:42 -04001056struct nfs4_link_res {
Trond Myklebust62ae0822012-11-29 17:10:01 -05001057 struct nfs4_sequence_res seq_res;
Trond Myklebust91ba2ee2005-10-27 22:12:42 -04001058 const struct nfs_server * server;
1059 struct nfs_fattr * fattr;
Steve Dicksone058f702013-05-22 12:50:40 -04001060 struct nfs4_label *label;
Trond Myklebust91ba2ee2005-10-27 22:12:42 -04001061 struct nfs4_change_info cinfo;
1062 struct nfs_fattr * dir_attr;
1063};
1064
Linus Torvalds1da177e2005-04-16 15:20:36 -07001065struct nfs4_lookup_arg {
Trond Myklebust62ae0822012-11-29 17:10:01 -05001066 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001067 const struct nfs_fh * dir_fh;
1068 const struct qstr * name;
1069 const u32 * bitmask;
1070};
1071
1072struct nfs4_lookup_res {
Trond Myklebust62ae0822012-11-29 17:10:01 -05001073 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001074 const struct nfs_server * server;
1075 struct nfs_fattr * fattr;
1076 struct nfs_fh * fh;
Steve Dicksone058f702013-05-22 12:50:40 -04001077 struct nfs4_label *label;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001078};
1079
Jeff Layton5b5faaf2017-06-29 06:34:52 -07001080struct nfs4_lookupp_arg {
1081 struct nfs4_sequence_args seq_args;
1082 const struct nfs_fh *fh;
1083 const u32 *bitmask;
1084};
1085
1086struct nfs4_lookupp_res {
1087 struct nfs4_sequence_res seq_res;
1088 const struct nfs_server *server;
1089 struct nfs_fattr *fattr;
1090 struct nfs_fh *fh;
1091 struct nfs4_label *label;
1092};
1093
Linus Torvalds1da177e2005-04-16 15:20:36 -07001094struct nfs4_lookup_root_arg {
Benny Halevy9ff71c32009-04-01 09:21:52 -04001095 struct nfs4_sequence_args seq_args;
Trond Myklebust62ae0822012-11-29 17:10:01 -05001096 const u32 * bitmask;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001097};
1098
1099struct nfs4_pathconf_arg {
Trond Myklebust62ae0822012-11-29 17:10:01 -05001100 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001101 const struct nfs_fh * fh;
1102 const u32 * bitmask;
1103};
1104
Benny Halevyd45b2982009-04-01 09:21:58 -04001105struct nfs4_pathconf_res {
Benny Halevyd45b2982009-04-01 09:21:58 -04001106 struct nfs4_sequence_res seq_res;
Trond Myklebust62ae0822012-11-29 17:10:01 -05001107 struct nfs_pathconf *pathconf;
Benny Halevyd45b2982009-04-01 09:21:58 -04001108};
1109
Linus Torvalds1da177e2005-04-16 15:20:36 -07001110struct nfs4_readdir_arg {
Trond Myklebust62ae0822012-11-29 17:10:01 -05001111 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001112 const struct nfs_fh * fh;
1113 u64 cookie;
1114 nfs4_verifier verifier;
1115 u32 count;
1116 struct page ** pages; /* zero-copy data */
1117 unsigned int pgbase; /* zero-copy data */
1118 const u32 * bitmask;
Benjamin Coddingtona7a3b1e2017-06-20 08:33:44 -04001119 bool plus;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001120};
1121
1122struct nfs4_readdir_res {
Trond Myklebust62ae0822012-11-29 17:10:01 -05001123 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001124 nfs4_verifier verifier;
1125 unsigned int pgbase;
1126};
1127
1128struct nfs4_readlink {
Trond Myklebust62ae0822012-11-29 17:10:01 -05001129 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001130 const struct nfs_fh * fh;
1131 unsigned int pgbase;
1132 unsigned int pglen; /* zero-copy data */
1133 struct page ** pages; /* zero-copy data */
1134};
1135
Benny Halevyf50c7002009-04-01 09:21:55 -04001136struct nfs4_readlink_res {
1137 struct nfs4_sequence_res seq_res;
1138};
1139
Linus Torvalds1da177e2005-04-16 15:20:36 -07001140struct nfs4_setclientid {
Chuck Levercc38bac2007-12-10 14:56:54 -05001141 const nfs4_verifier * sc_verifier;
Chuck Levercc38bac2007-12-10 14:56:54 -05001142 u32 sc_prog;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001143 unsigned int sc_netid_len;
Chuck Leverd1ce02e2008-09-25 11:57:12 -04001144 char sc_netid[RPCBIND_MAXNETIDLEN + 1];
Linus Torvalds1da177e2005-04-16 15:20:36 -07001145 unsigned int sc_uaddr_len;
Chuck Leverd1ce02e2008-09-25 11:57:12 -04001146 char sc_uaddr[RPCBIND_MAXUADDRLEN + 1];
Jeff Layton3a6bb732015-06-09 19:43:57 -04001147 struct nfs_client *sc_clnt;
Jeff Laytonf11b2a12014-06-21 20:52:17 -04001148 struct rpc_cred *sc_cred;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001149};
1150
Trond Myklebustbb8b27e2010-04-16 16:43:06 -04001151struct nfs4_setclientid_res {
1152 u64 clientid;
1153 nfs4_verifier confirm;
1154};
1155
Linus Torvalds1da177e2005-04-16 15:20:36 -07001156struct nfs4_statfs_arg {
Trond Myklebust62ae0822012-11-29 17:10:01 -05001157 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001158 const struct nfs_fh * fh;
1159 const u32 * bitmask;
1160};
1161
Benny Halevy24ad1482009-04-01 09:21:56 -04001162struct nfs4_statfs_res {
Benny Halevy24ad1482009-04-01 09:21:56 -04001163 struct nfs4_sequence_res seq_res;
Trond Myklebust62ae0822012-11-29 17:10:01 -05001164 struct nfs_fsstat *fsstat;
Benny Halevy24ad1482009-04-01 09:21:56 -04001165};
1166
Benny Halevy43652ad2009-04-01 09:21:54 -04001167struct nfs4_server_caps_arg {
Benny Halevy43652ad2009-04-01 09:21:54 -04001168 struct nfs4_sequence_args seq_args;
Trond Myklebust62ae0822012-11-29 17:10:01 -05001169 struct nfs_fh *fhandle;
Kinglong Mee8c612822015-08-26 21:12:58 +08001170 const u32 * bitmask;
Benny Halevy43652ad2009-04-01 09:21:54 -04001171};
1172
Linus Torvalds1da177e2005-04-16 15:20:36 -07001173struct nfs4_server_caps_res {
Trond Myklebust62ae0822012-11-29 17:10:01 -05001174 struct nfs4_sequence_res seq_res;
Fred Isamandae100c2011-07-30 20:52:37 -04001175 u32 attr_bitmask[3];
Kinglong Mee8c612822015-08-26 21:12:58 +08001176 u32 exclcreat_bitmask[3];
Linus Torvalds1da177e2005-04-16 15:20:36 -07001177 u32 acl_bitmask;
1178 u32 has_links;
1179 u32 has_symlinks;
Chuck Lever264e6352012-03-01 17:02:05 -05001180 u32 fh_expire_type;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001181};
1182
Manoj Naik7aaa0b32006-06-09 09:34:23 -04001183#define NFS4_PATHNAME_MAXCOMPONENTS 512
1184struct nfs4_pathname {
1185 unsigned int ncomponents;
1186 struct nfs4_string components[NFS4_PATHNAME_MAXCOMPONENTS];
1187};
1188
1189#define NFS4_FS_LOCATION_MAXSERVERS 10
1190struct nfs4_fs_location {
1191 unsigned int nservers;
1192 struct nfs4_string servers[NFS4_FS_LOCATION_MAXSERVERS];
1193 struct nfs4_pathname rootpath;
1194};
1195
1196#define NFS4_FS_LOCATIONS_MAXENTRIES 10
1197struct nfs4_fs_locations {
Trond Myklebust683b57b2006-06-09 09:34:22 -04001198 struct nfs_fattr fattr;
1199 const struct nfs_server *server;
Manoj Naik7aaa0b32006-06-09 09:34:23 -04001200 struct nfs4_pathname fs_path;
Trond Myklebust683b57b2006-06-09 09:34:22 -04001201 int nlocations;
Manoj Naik7aaa0b32006-06-09 09:34:23 -04001202 struct nfs4_fs_location locations[NFS4_FS_LOCATIONS_MAXENTRIES];
Trond Myklebust683b57b2006-06-09 09:34:22 -04001203};
1204
1205struct nfs4_fs_locations_arg {
Trond Myklebust62ae0822012-11-29 17:10:01 -05001206 struct nfs4_sequence_args seq_args;
Trond Myklebust683b57b2006-06-09 09:34:22 -04001207 const struct nfs_fh *dir_fh;
Chuck Leverb03d7352013-10-17 14:12:50 -04001208 const struct nfs_fh *fh;
Trond Myklebust683b57b2006-06-09 09:34:22 -04001209 const struct qstr *name;
1210 struct page *page;
1211 const u32 *bitmask;
Chuck Leverb03d7352013-10-17 14:12:50 -04001212 clientid4 clientid;
1213 unsigned char migration:1, renew:1;
Trond Myklebust683b57b2006-06-09 09:34:22 -04001214};
1215
Benny Halevy22958462009-04-01 09:22:02 -04001216struct nfs4_fs_locations_res {
Benny Halevy22958462009-04-01 09:22:02 -04001217 struct nfs4_sequence_res seq_res;
Trond Myklebust62ae0822012-11-29 17:10:01 -05001218 struct nfs4_fs_locations *fs_locations;
Chuck Leverb03d7352013-10-17 14:12:50 -04001219 unsigned char migration:1, renew:1;
Benny Halevy22958462009-04-01 09:22:02 -04001220};
1221
Chuck Leverfb15b262013-03-16 15:54:34 -04001222struct nfs4_secinfo4 {
1223 u32 flavor;
1224 struct rpcsec_gss_info flavor_info;
Bryan Schumaker5a5ea0d2011-03-24 17:12:29 +00001225};
1226
1227struct nfs4_secinfo_flavors {
Chuck Leverfb15b262013-03-16 15:54:34 -04001228 unsigned int num_flavors;
1229 struct nfs4_secinfo4 flavors[0];
Bryan Schumaker5a5ea0d2011-03-24 17:12:29 +00001230};
1231
1232struct nfs4_secinfo_arg {
Trond Myklebust62ae0822012-11-29 17:10:01 -05001233 struct nfs4_sequence_args seq_args;
Bryan Schumaker5a5ea0d2011-03-24 17:12:29 +00001234 const struct nfs_fh *dir_fh;
1235 const struct qstr *name;
Bryan Schumaker5a5ea0d2011-03-24 17:12:29 +00001236};
1237
1238struct nfs4_secinfo_res {
Bryan Schumaker5a5ea0d2011-03-24 17:12:29 +00001239 struct nfs4_sequence_res seq_res;
Trond Myklebust62ae0822012-11-29 17:10:01 -05001240 struct nfs4_secinfo_flavors *flavors;
Bryan Schumaker5a5ea0d2011-03-24 17:12:29 +00001241};
1242
Chuck Lever44c99932013-10-17 14:13:30 -04001243struct nfs4_fsid_present_arg {
1244 struct nfs4_sequence_args seq_args;
1245 const struct nfs_fh *fh;
1246 clientid4 clientid;
1247 unsigned char renew:1;
1248};
1249
1250struct nfs4_fsid_present_res {
1251 struct nfs4_sequence_res seq_res;
1252 struct nfs_fh *fh;
1253 unsigned char renew:1;
1254};
1255
Linus Torvalds1da177e2005-04-16 15:20:36 -07001256#endif /* CONFIG_NFS_V4 */
1257
Benny Halevy99fe60d2009-04-01 09:22:29 -04001258struct nfstime4 {
1259 u64 seconds;
1260 u32 nseconds;
1261};
1262
1263#ifdef CONFIG_NFS_V4_1
Fred Isamanea2cf222012-04-20 14:47:53 -04001264
1265struct pnfs_commit_bucket {
1266 struct list_head written;
1267 struct list_head committing;
1268 struct pnfs_layout_segment *wlseg;
1269 struct pnfs_layout_segment *clseg;
Weston Andros Adamson5002c582014-05-15 11:56:54 -04001270 struct nfs_writeverf direct_verf;
Fred Isamanea2cf222012-04-20 14:47:53 -04001271};
1272
Trond Myklebustd7242c42020-03-18 17:22:47 -04001273struct pnfs_commit_array {
1274 struct list_head cinfo_list;
1275 struct list_head lseg_list;
1276 struct pnfs_layout_segment *lseg;
1277 struct rcu_head rcu;
Trond Myklebusta9901892020-03-20 16:04:06 -04001278 refcount_t refcount;
Trond Myklebustd7242c42020-03-18 17:22:47 -04001279 unsigned int nbuckets;
1280 struct pnfs_commit_bucket buckets[];
1281};
1282
Fred Isamanea2cf222012-04-20 14:47:53 -04001283struct pnfs_ds_commit_info {
Trond Myklebustc21e7162020-03-19 13:36:36 -04001284 struct list_head commits;
Trond Myklebustd7242c42020-03-18 17:22:47 -04001285 unsigned int nwritten;
1286 unsigned int ncommitting;
Trond Myklebust9c455a82020-03-21 11:13:05 -04001287 const struct pnfs_commit_ops *ops;
Fred Isamanea2cf222012-04-20 14:47:53 -04001288};
1289
Weston Andros Adamson2031cd12013-08-13 16:37:32 -04001290struct nfs41_state_protection {
1291 u32 how;
1292 struct nfs4_op_map enforce;
1293 struct nfs4_op_map allow;
1294};
1295
Benny Halevy99fe60d2009-04-01 09:22:29 -04001296struct nfs41_exchange_id_args {
1297 struct nfs_client *client;
Trond Myklebustfd405592017-08-01 16:02:47 -04001298 nfs4_verifier verifier;
Benny Halevy99fe60d2009-04-01 09:22:29 -04001299 u32 flags;
Weston Andros Adamson2031cd12013-08-13 16:37:32 -04001300 struct nfs41_state_protection state_protect;
Benny Halevy99fe60d2009-04-01 09:22:29 -04001301};
1302
Chuck Leveracdeb692012-05-21 22:46:16 -04001303struct nfs41_server_owner {
Benny Halevy99fe60d2009-04-01 09:22:29 -04001304 uint64_t minor_id;
1305 uint32_t major_id_sz;
1306 char major_id[NFS4_OPAQUE_LIMIT];
1307};
1308
Chuck Lever79d4e1f2012-05-21 22:44:31 -04001309struct nfs41_server_scope {
Benny Halevy99fe60d2009-04-01 09:22:29 -04001310 uint32_t server_scope_sz;
1311 char server_scope[NFS4_OPAQUE_LIMIT];
1312};
1313
Weston Andros Adamson7d2ed9a2012-02-17 15:20:26 -05001314struct nfs41_impl_id {
1315 char domain[NFS4_OPAQUE_LIMIT + 1];
1316 char name[NFS4_OPAQUE_LIMIT + 1];
1317 struct nfstime4 date;
1318};
1319
Trond Myklebust71a097c2015-02-18 09:27:18 -08001320struct nfs41_bind_conn_to_session_args {
1321 struct nfs_client *client;
1322 struct nfs4_sessionid sessionid;
1323 u32 dir;
1324 bool use_conn_in_rdma_mode;
1325};
1326
Weston Andros Adamson7c44f1ae2012-05-24 13:22:50 -04001327struct nfs41_bind_conn_to_session_res {
Trond Myklebust71a097c2015-02-18 09:27:18 -08001328 struct nfs4_sessionid sessionid;
Weston Andros Adamson7c44f1ae2012-05-24 13:22:50 -04001329 u32 dir;
1330 bool use_conn_in_rdma_mode;
1331};
1332
Benny Halevy99fe60d2009-04-01 09:22:29 -04001333struct nfs41_exchange_id_res {
Trond Myklebust32b01312012-05-26 13:41:04 -04001334 u64 clientid;
1335 u32 seqid;
Benny Halevy99fe60d2009-04-01 09:22:29 -04001336 u32 flags;
Chuck Leveracdeb692012-05-21 22:46:16 -04001337 struct nfs41_server_owner *server_owner;
Chuck Lever79d4e1f2012-05-21 22:44:31 -04001338 struct nfs41_server_scope *server_scope;
Weston Andros Adamson7d2ed9a2012-02-17 15:20:26 -05001339 struct nfs41_impl_id *impl_id;
Weston Andros Adamson2031cd12013-08-13 16:37:32 -04001340 struct nfs41_state_protection state_protect;
Benny Halevy99fe60d2009-04-01 09:22:29 -04001341};
Andy Adamsonfc931582009-04-01 09:22:31 -04001342
1343struct nfs41_create_session_args {
1344 struct nfs_client *client;
Trond Myklebust79969dd12015-02-18 11:30:18 -08001345 u64 clientid;
1346 uint32_t seqid;
Andy Adamsonfc931582009-04-01 09:22:31 -04001347 uint32_t flags;
1348 uint32_t cb_program;
1349 struct nfs4_channel_attrs fc_attrs; /* Fore Channel */
1350 struct nfs4_channel_attrs bc_attrs; /* Back Channel */
1351};
1352
1353struct nfs41_create_session_res {
Trond Myklebust79969dd12015-02-18 11:30:18 -08001354 struct nfs4_sessionid sessionid;
1355 uint32_t seqid;
1356 uint32_t flags;
1357 struct nfs4_channel_attrs fc_attrs; /* Fore Channel */
1358 struct nfs4_channel_attrs bc_attrs; /* Back Channel */
Andy Adamsonfc931582009-04-01 09:22:31 -04001359};
Ricardo Labiaga180197532009-12-05 16:08:40 -05001360
1361struct nfs41_reclaim_complete_args {
Trond Myklebust62ae0822012-11-29 17:10:01 -05001362 struct nfs4_sequence_args seq_args;
Ricardo Labiaga180197532009-12-05 16:08:40 -05001363 /* In the future extend to include curr_fh for use with migration */
1364 unsigned char one_fs:1;
Ricardo Labiaga180197532009-12-05 16:08:40 -05001365};
1366
1367struct nfs41_reclaim_complete_res {
1368 struct nfs4_sequence_res seq_res;
1369};
Bryan Schumakerfca78d62011-06-02 14:59:07 -04001370
1371#define SECINFO_STYLE_CURRENT_FH 0
1372#define SECINFO_STYLE_PARENT 1
1373struct nfs41_secinfo_no_name_args {
Bryan Schumakerfca78d62011-06-02 14:59:07 -04001374 struct nfs4_sequence_args seq_args;
Trond Myklebust62ae0822012-11-29 17:10:01 -05001375 int style;
Bryan Schumakerfca78d62011-06-02 14:59:07 -04001376};
1377
Bryan Schumaker7d974792011-06-02 14:59:08 -04001378struct nfs41_test_stateid_args {
Bryan Schumaker7d974792011-06-02 14:59:08 -04001379 struct nfs4_sequence_args seq_args;
Trond Myklebust62ae0822012-11-29 17:10:01 -05001380 nfs4_stateid *stateid;
Bryan Schumaker7d974792011-06-02 14:59:08 -04001381};
1382
1383struct nfs41_test_stateid_res {
Bryan Schumaker7d974792011-06-02 14:59:08 -04001384 struct nfs4_sequence_res seq_res;
Trond Myklebust62ae0822012-11-29 17:10:01 -05001385 unsigned int status;
Bryan Schumaker7d974792011-06-02 14:59:08 -04001386};
1387
Bryan Schumaker9aeda352011-06-02 14:59:09 -04001388struct nfs41_free_stateid_args {
Bryan Schumaker9aeda352011-06-02 14:59:09 -04001389 struct nfs4_sequence_args seq_args;
Trond Myklebust7c1d5fa2013-05-03 14:40:01 -04001390 nfs4_stateid stateid;
Bryan Schumaker9aeda352011-06-02 14:59:09 -04001391};
1392
1393struct nfs41_free_stateid_res {
Bryan Schumaker9aeda352011-06-02 14:59:09 -04001394 struct nfs4_sequence_res seq_res;
Trond Myklebust62ae0822012-11-29 17:10:01 -05001395 unsigned int status;
Bryan Schumaker9aeda352011-06-02 14:59:09 -04001396};
1397
Trond Myklebust4f976152012-04-30 18:39:20 -04001398#else
1399
1400struct pnfs_ds_commit_info {
1401};
1402
Benny Halevy99fe60d2009-04-01 09:22:29 -04001403#endif /* CONFIG_NFS_V4_1 */
1404
Anna Schumaker1c6dcbe2014-09-26 13:58:48 -04001405#ifdef CONFIG_NFS_V4_2
Anna Schumakerf4ac1672014-11-25 13:18:15 -05001406struct nfs42_falloc_args {
1407 struct nfs4_sequence_args seq_args;
1408
1409 struct nfs_fh *falloc_fh;
1410 nfs4_stateid falloc_stateid;
1411 u64 falloc_offset;
1412 u64 falloc_length;
Anna Schumaker9a519402015-03-16 14:06:23 -04001413 const u32 *falloc_bitmask;
Anna Schumakerf4ac1672014-11-25 13:18:15 -05001414};
1415
1416struct nfs42_falloc_res {
1417 struct nfs4_sequence_res seq_res;
1418 unsigned int status;
Anna Schumaker9a519402015-03-16 14:06:23 -04001419
1420 struct nfs_fattr *falloc_fattr;
1421 const struct nfs_server *falloc_server;
Anna Schumakerf4ac1672014-11-25 13:18:15 -05001422};
1423
Anna Schumaker2e724482013-05-21 16:53:03 -04001424struct nfs42_copy_args {
1425 struct nfs4_sequence_args seq_args;
1426
1427 struct nfs_fh *src_fh;
1428 nfs4_stateid src_stateid;
1429 u64 src_pos;
1430
1431 struct nfs_fh *dst_fh;
1432 nfs4_stateid dst_stateid;
1433 u64 dst_pos;
1434
1435 u64 count;
Olga Kornievskaia62164f32018-07-09 15:13:31 -04001436 bool sync;
Olga Kornievskaia1d38f3f2019-06-04 11:54:18 -04001437 struct nl4_server *cp_src;
Anna Schumaker2e724482013-05-21 16:53:03 -04001438};
1439
1440struct nfs42_write_res {
Olga Kornievskaia67aa7442018-07-09 15:13:30 -04001441 nfs4_stateid stateid;
Anna Schumaker2e724482013-05-21 16:53:03 -04001442 u64 count;
1443 struct nfs_writeverf verifier;
1444};
1445
1446struct nfs42_copy_res {
1447 struct nfs4_sequence_res seq_res;
1448 struct nfs42_write_res write_res;
1449 bool consecutive;
1450 bool synchronous;
Olga Kornievskaiae0926932017-05-08 18:02:24 -04001451 struct nfs_commitres commit_res;
Anna Schumaker2e724482013-05-21 16:53:03 -04001452};
1453
Olga Kornievskaiacb95dee2018-07-09 15:13:29 -04001454struct nfs42_offload_status_args {
1455 struct nfs4_sequence_args osa_seq_args;
1456 struct nfs_fh *osa_src_fh;
1457 nfs4_stateid osa_stateid;
1458};
1459
1460struct nfs42_offload_status_res {
1461 struct nfs4_sequence_res osr_seq_res;
1462 uint64_t osr_count;
1463 int osr_status;
1464};
1465
Olga Kornievskaia04915672019-06-04 16:14:30 -04001466struct nfs42_copy_notify_args {
1467 struct nfs4_sequence_args cna_seq_args;
1468
1469 struct nfs_fh *cna_src_fh;
1470 nfs4_stateid cna_src_stateid;
1471 struct nl4_server cna_dst;
1472};
1473
1474struct nfs42_copy_notify_res {
1475 struct nfs4_sequence_res cnr_seq_res;
1476
1477 struct nfstime4 cnr_lease_time;
1478 nfs4_stateid cnr_stateid;
1479 struct nl4_server cnr_src;
1480};
1481
Anna Schumaker1c6dcbe2014-09-26 13:58:48 -04001482struct nfs42_seek_args {
1483 struct nfs4_sequence_args seq_args;
1484
1485 struct nfs_fh *sa_fh;
1486 nfs4_stateid sa_stateid;
1487 u64 sa_offset;
1488 u32 sa_what;
1489};
1490
1491struct nfs42_seek_res {
1492 struct nfs4_sequence_res seq_res;
1493 unsigned int status;
1494
1495 u32 sr_eof;
1496 u64 sr_offset;
1497};
1498#endif
1499
Linus Torvalds1da177e2005-04-16 15:20:36 -07001500struct nfs_page;
1501
Chuck Lever40859d72005-11-30 18:09:02 -05001502#define NFS_PAGEVEC_SIZE (8U)
1503
Fred Isaman30dd3742012-04-20 14:47:45 -04001504struct nfs_page_array {
1505 struct page **pagevec;
1506 unsigned int npages; /* Max length of pagevec */
1507 struct page *page_array[NFS_PAGEVEC_SIZE];
1508};
1509
Fred Isaman4db6e0b2012-04-20 14:47:46 -04001510/* used as flag bits in nfs_pgio_header */
1511enum {
1512 NFS_IOHDR_ERROR = 0,
1513 NFS_IOHDR_EOF,
1514 NFS_IOHDR_REDO,
Trond Myklebust37e9ed22015-12-22 12:30:24 -05001515 NFS_IOHDR_STAT,
Trond Myklebust42f86b42018-06-18 19:07:24 -04001516 NFS_IOHDR_RESEND_PNFS,
1517 NFS_IOHDR_RESEND_MDS,
Fred Isaman4db6e0b2012-04-20 14:47:46 -04001518};
1519
Trond Myklebust919e3bd2017-06-20 19:35:37 -04001520struct nfs_io_completion;
Fred Isamancd841602012-04-20 14:47:44 -04001521struct nfs_pgio_header {
1522 struct inode *inode;
NeilBrowna52458b2018-12-03 11:30:31 +11001523 const struct cred *cred;
Fred Isamancd841602012-04-20 14:47:44 -04001524 struct list_head pages;
1525 struct nfs_page *req;
Anna Schumakerf79d06f2014-05-06 09:12:28 -04001526 struct nfs_writeverf verf; /* Used for writes */
Benjamin Coddingtonfbe77c32017-04-19 10:11:35 -04001527 fmode_t rw_mode;
Fred Isamancd841602012-04-20 14:47:44 -04001528 struct pnfs_layout_segment *lseg;
Fred Isaman4db6e0b2012-04-20 14:47:46 -04001529 loff_t io_start;
Fred Isamancd841602012-04-20 14:47:44 -04001530 const struct rpc_call_ops *mds_ops;
Fred Isaman4db6e0b2012-04-20 14:47:46 -04001531 void (*release) (struct nfs_pgio_header *hdr);
Fred Isaman061ae2e2012-04-20 14:47:48 -04001532 const struct nfs_pgio_completion_ops *completion_ops;
Anna Schumaker4a0de552014-05-06 09:12:30 -04001533 const struct nfs_rw_ops *rw_ops;
Trond Myklebust919e3bd2017-06-20 19:35:37 -04001534 struct nfs_io_completion *io_completion;
Fred Isaman584aa812012-04-20 14:47:51 -04001535 struct nfs_direct_req *dreq;
Trond Myklebust1c6c4b72018-09-25 12:34:43 -04001536
Fred Isamancd841602012-04-20 14:47:44 -04001537 int pnfs_error;
Fred Isaman4db6e0b2012-04-20 14:47:46 -04001538 int error; /* merge with pnfs_error */
Trond Myklebust1c6c4b72018-09-25 12:34:43 -04001539 unsigned int good_bytes; /* boundary of good data */
Fred Isaman4db6e0b2012-04-20 14:47:46 -04001540 unsigned long flags;
Weston Andros Adamsond45f60c2014-06-09 11:48:35 -04001541
1542 /*
1543 * rpc data
1544 */
1545 struct rpc_task task;
1546 struct nfs_fattr fattr;
Weston Andros Adamsond45f60c2014-06-09 11:48:35 -04001547 struct nfs_pgio_args args; /* argument struct */
1548 struct nfs_pgio_res res; /* result struct */
1549 unsigned long timestamp; /* For lease renewal */
1550 int (*pgio_done_cb)(struct rpc_task *, struct nfs_pgio_header *);
1551 __u64 mds_offset; /* Filelayout dense stripe */
1552 struct nfs_page_array page_array;
1553 struct nfs_client *ds_clp; /* pNFS data server */
Weston Andros Adamson6cccbb62014-09-16 17:35:51 -04001554 int ds_commit_idx; /* ds index if ds_clp is set */
Weston Andros Adamsona7d42dd2014-09-19 10:55:07 -04001555 int pgio_mirror_idx;/* mirror index in pgio layer */
Fred Isamancd841602012-04-20 14:47:44 -04001556};
1557
Fred Isamanea2cf222012-04-20 14:47:53 -04001558struct nfs_mds_commit_info {
1559 atomic_t rpcs_out;
Trond Myklebust5cb953d2017-08-01 17:04:12 -04001560 atomic_long_t ncommit;
Fred Isamanea2cf222012-04-20 14:47:53 -04001561 struct list_head list;
1562};
1563
Trond Myklebustb20135d2015-12-31 09:28:06 -05001564struct nfs_commit_info;
Fred Isamanf453a542012-04-20 14:47:54 -04001565struct nfs_commit_data;
1566struct nfs_inode;
1567struct nfs_commit_completion_ops {
Fred Isamanf453a542012-04-20 14:47:54 -04001568 void (*completion) (struct nfs_commit_data *data);
Trond Myklebustb20135d2015-12-31 09:28:06 -05001569 void (*resched_write) (struct nfs_commit_info *, struct nfs_page *);
Fred Isamanf453a542012-04-20 14:47:54 -04001570};
1571
Fred Isamanea2cf222012-04-20 14:47:53 -04001572struct nfs_commit_info {
Dave Wysochanskife238e62016-04-01 13:45:09 -04001573 struct inode *inode; /* Needed for inode->i_lock */
Fred Isamanea2cf222012-04-20 14:47:53 -04001574 struct nfs_mds_commit_info *mds;
1575 struct pnfs_ds_commit_info *ds;
Fred Isamanb359f9d2012-04-20 14:47:55 -04001576 struct nfs_direct_req *dreq; /* O_DIRECT request */
Fred Isamanf453a542012-04-20 14:47:54 -04001577 const struct nfs_commit_completion_ops *completion_ops;
Fred Isamanea2cf222012-04-20 14:47:53 -04001578};
1579
Fred Isaman0b7c0152012-04-20 14:47:39 -04001580struct nfs_commit_data {
1581 struct rpc_task task;
1582 struct inode *inode;
NeilBrowna52458b2018-12-03 11:30:31 +11001583 const struct cred *cred;
Fred Isaman0b7c0152012-04-20 14:47:39 -04001584 struct nfs_fattr fattr;
1585 struct nfs_writeverf verf;
1586 struct list_head pages; /* Coalesced requests we wish to flush */
1587 struct list_head list; /* lists of struct nfs_write_data */
1588 struct nfs_direct_req *dreq; /* O_DIRECT request */
1589 struct nfs_commitargs args; /* argument struct */
1590 struct nfs_commitres res; /* result struct */
1591 struct nfs_open_context *context;
1592 struct pnfs_layout_segment *lseg;
1593 struct nfs_client *ds_clp; /* pNFS data server */
1594 int ds_commit_index;
Peng Tao378520b2014-08-07 10:15:02 +08001595 loff_t lwb;
Fred Isaman0b7c0152012-04-20 14:47:39 -04001596 const struct rpc_call_ops *mds_ops;
Fred Isamanf453a542012-04-20 14:47:54 -04001597 const struct nfs_commit_completion_ops *completion_ops;
Fred Isaman0b7c0152012-04-20 14:47:39 -04001598 int (*commit_done_cb) (struct rpc_task *task, struct nfs_commit_data *data);
Trond Myklebust37e9ed22015-12-22 12:30:24 -05001599 unsigned long flags;
Fred Isaman0b7c0152012-04-20 14:47:39 -04001600};
1601
Fred Isaman061ae2e2012-04-20 14:47:48 -04001602struct nfs_pgio_completion_ops {
Trond Myklebustdf3accb2019-02-13 10:39:39 -05001603 void (*error_cleanup)(struct list_head *head, int);
Fred Isaman584aa812012-04-20 14:47:51 -04001604 void (*init_hdr)(struct nfs_pgio_header *hdr);
Fred Isaman061ae2e2012-04-20 14:47:48 -04001605 void (*completion)(struct nfs_pgio_header *hdr);
Trond Myklebustdc602dd2015-12-31 11:44:06 -05001606 void (*reschedule_io)(struct nfs_pgio_header *hdr);
Fred Isaman061ae2e2012-04-20 14:47:48 -04001607};
1608
Bryan Schumaker34e137c2012-03-19 14:54:41 -04001609struct nfs_unlinkdata {
Bryan Schumaker34e137c2012-03-19 14:54:41 -04001610 struct nfs_removeargs args;
1611 struct nfs_removeres res;
Al Viro884be172016-04-28 23:56:31 -04001612 struct dentry *dentry;
1613 wait_queue_head_t wq;
NeilBrowna52458b2018-12-03 11:30:31 +11001614 const struct cred *cred;
Bryan Schumaker34e137c2012-03-19 14:54:41 -04001615 struct nfs_fattr dir_attr;
NeilBrown8478eaa2014-09-18 16:09:27 +10001616 long timeout;
Bryan Schumaker34e137c2012-03-19 14:54:41 -04001617};
1618
Bryan Schumakerc6bfa1a2012-03-19 14:54:42 -04001619struct nfs_renamedata {
1620 struct nfs_renameargs args;
1621 struct nfs_renameres res;
NeilBrowna52458b2018-12-03 11:30:31 +11001622 const struct cred *cred;
Bryan Schumakerc6bfa1a2012-03-19 14:54:42 -04001623 struct inode *old_dir;
1624 struct dentry *old_dentry;
1625 struct nfs_fattr old_fattr;
1626 struct inode *new_dir;
1627 struct dentry *new_dentry;
1628 struct nfs_fattr new_fattr;
Jeff Layton96f9d8c2014-03-17 07:06:54 -04001629 void (*complete)(struct rpc_task *, struct nfs_renamedata *);
NeilBrown8478eaa2014-09-18 16:09:27 +10001630 long timeout;
Benjamin Coddington818a8db2017-06-16 11:13:00 -04001631 bool cancelled;
Bryan Schumakerc6bfa1a2012-03-19 14:54:42 -04001632};
1633
Linus Torvalds1da177e2005-04-16 15:20:36 -07001634struct nfs_access_entry;
Andy Adamson45a52a02011-03-01 01:34:08 +00001635struct nfs_client;
Trond Myklebuste0dca7a2011-03-14 18:20:01 -04001636struct rpc_timeout;
Bryan Schumakerff9099f22012-07-30 16:05:18 -04001637struct nfs_subversion;
1638struct nfs_mount_info;
Bryan Schumaker6663ee72012-06-20 15:53:46 -04001639struct nfs_client_initdata;
Bryan Schumaker1abb50882012-06-20 15:53:47 -04001640struct nfs_pageio_descriptor;
David Howellsf2aedb72019-12-10 07:31:13 -05001641struct fs_context;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001642
1643/*
1644 * RPC procedure vector for NFSv2/NFSv3 demuxing
1645 */
1646struct nfs_rpc_ops {
Chuck Leverc0e07cb2008-01-14 12:32:05 -05001647 u32 version; /* Protocol version */
Al Virof786aa92009-02-20 05:51:22 +00001648 const struct dentry_operations *dentry_ops;
Arjan van de Venc5ef1c42007-02-12 00:55:40 -08001649 const struct inode_operations *dir_inode_ops;
1650 const struct inode_operations *file_inode_ops;
Jeff Layton1788ea62011-11-04 13:31:21 -04001651 const struct file_operations *file_ops;
Benjamin Coddingtonb1ece732017-04-11 12:50:11 -04001652 const struct nlmclnt_operations *nlmclnt_ops;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001653
1654 int (*getroot) (struct nfs_server *, struct nfs_fh *,
1655 struct nfs_fsinfo *);
David Howellsf2aedb72019-12-10 07:31:13 -05001656 int (*submount) (struct fs_context *, struct nfs_server *);
1657 int (*try_get_tree) (struct fs_context *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001658 int (*getattr) (struct nfs_server *, struct nfs_fh *,
Trond Myklebusta841b542018-04-07 13:50:59 -04001659 struct nfs_fattr *, struct nfs4_label *,
1660 struct inode *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001661 int (*setattr) (struct dentry *, struct nfs_fattr *,
1662 struct iattr *);
Trond Myklebustf7b37b82020-01-14 12:06:34 -05001663 int (*lookup) (struct inode *, struct dentry *,
David Quigley1775fd32013-05-22 12:50:42 -04001664 struct nfs_fh *, struct nfs_fattr *,
1665 struct nfs4_label *);
Jeff Layton5b5faaf2017-06-29 06:34:52 -07001666 int (*lookupp) (struct inode *, struct nfs_fh *,
1667 struct nfs_fattr *, struct nfs4_label *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001668 int (*access) (struct inode *, struct nfs_access_entry *);
1669 int (*readlink)(struct inode *, struct page *, unsigned int,
1670 unsigned int);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001671 int (*create) (struct inode *, struct dentry *,
Miklos Szeredi8867fe52012-06-05 15:10:19 +02001672 struct iattr *, int);
Trond Myklebust912678d2018-03-20 16:43:15 -04001673 int (*remove) (struct inode *, struct dentry *);
Trond Myklebusted7e9ad2018-05-30 16:11:52 -04001674 void (*unlink_setup) (struct rpc_message *, struct dentry *, struct inode *);
Bryan Schumaker34e137c2012-03-19 14:54:41 -04001675 void (*unlink_rpc_prepare) (struct rpc_task *, struct nfs_unlinkdata *);
Trond Myklebuste4eff1a2007-07-14 15:39:58 -04001676 int (*unlink_done) (struct rpc_task *, struct inode *);
Trond Myklebustf2c2c552018-03-20 16:43:16 -04001677 void (*rename_setup) (struct rpc_message *msg,
1678 struct dentry *old_dentry,
1679 struct dentry *new_dentry);
Bryan Schumakerc6bfa1a2012-03-19 14:54:42 -04001680 void (*rename_rpc_prepare)(struct rpc_task *task, struct nfs_renamedata *);
Jeff Laytond3d41522010-09-17 17:31:57 -04001681 int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir);
Al Virobeffb8f2016-07-20 16:34:42 -04001682 int (*link) (struct inode *, struct inode *, const struct qstr *);
Chuck Lever94a6d752006-08-22 20:06:23 -04001683 int (*symlink) (struct inode *, struct dentry *, struct page *,
1684 unsigned int, struct iattr *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001685 int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
Al Virobeffb8f2016-07-20 16:34:42 -04001686 int (*rmdir) (struct inode *, const struct qstr *);
NeilBrown684f39b2018-12-03 11:30:30 +11001687 int (*readdir) (struct dentry *, const struct cred *,
Benjamin Coddingtona7a3b1e2017-06-20 08:33:44 -04001688 u64, struct page **, unsigned int, bool);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001689 int (*mknod) (struct inode *, struct dentry *, struct iattr *,
1690 dev_t);
1691 int (*statfs) (struct nfs_server *, struct nfs_fh *,
1692 struct nfs_fsstat *);
1693 int (*fsinfo) (struct nfs_server *, struct nfs_fh *,
1694 struct nfs_fsinfo *);
1695 int (*pathconf) (struct nfs_server *, struct nfs_fh *,
1696 struct nfs_pathconf *);
David Howellse9326dc2006-08-22 20:06:10 -04001697 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
Benjamin Coddingtona7a3b1e2017-06-20 08:33:44 -04001698 int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, bool);
Weston Andros Adamsond45f60c2014-06-09 11:48:35 -04001699 int (*pgio_rpc_prepare)(struct rpc_task *,
1700 struct nfs_pgio_header *);
1701 void (*read_setup)(struct nfs_pgio_header *, struct rpc_message *);
1702 int (*read_done)(struct rpc_task *, struct nfs_pgio_header *);
Anna Schumakerfb91fb02018-05-04 16:22:48 -04001703 void (*write_setup)(struct nfs_pgio_header *, struct rpc_message *,
1704 struct rpc_clnt **);
Weston Andros Adamsond45f60c2014-06-09 11:48:35 -04001705 int (*write_done)(struct rpc_task *, struct nfs_pgio_header *);
Anna Schumakere9ae1ee2018-05-04 16:22:49 -04001706 void (*commit_setup) (struct nfs_commit_data *, struct rpc_message *,
1707 struct rpc_clnt **);
Fred Isaman0b7c0152012-04-20 14:47:39 -04001708 void (*commit_rpc_prepare)(struct rpc_task *, struct nfs_commit_data *);
1709 int (*commit_done) (struct rpc_task *, struct nfs_commit_data *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001710 int (*lock)(struct file *, int, struct file_lock *);
Trond Myklebust21162712008-05-20 19:34:39 -04001711 int (*lock_check_bounds)(const struct file_lock *);
Trond Myklebustada70d92005-06-22 17:16:22 +00001712 void (*clear_acl_cache)(struct inode *);
Trond Myklebust7fe5c392009-03-19 15:35:50 -04001713 void (*close_context)(struct nfs_open_context *ctx, int);
Trond Myklebust2b484292010-09-17 10:56:51 -04001714 struct inode * (*open_context) (struct inode *dir,
1715 struct nfs_open_context *ctx,
1716 int open_flags,
Trond Myklebust5bc2afc2013-09-23 18:01:28 -04001717 struct iattr *iattr,
1718 int *);
Bryan Schumaker011e2a72012-06-20 15:53:43 -04001719 int (*have_delegation)(struct inode *, fmode_t);
Bryan Schumaker6663ee72012-06-20 15:53:46 -04001720 struct nfs_client *(*alloc_client) (const struct nfs_client_initdata *);
Trond Myklebust5c6e5b62016-06-22 14:13:12 -04001721 struct nfs_client *(*init_client) (struct nfs_client *,
1722 const struct nfs_client_initdata *);
Bryan Schumakercdb7eced2012-06-20 15:53:45 -04001723 void (*free_client) (struct nfs_client *);
Scott Mayhew62a55d02019-12-10 07:31:14 -05001724 struct nfs_server *(*create_server)(struct fs_context *);
Bryan Schumaker1179acc2012-07-30 16:05:19 -04001725 struct nfs_server *(*clone_server)(struct nfs_server *, struct nfs_fh *,
1726 struct nfs_fattr *, rpc_authflavor_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001727};
1728
1729/*
1730 * NFS_CALL(getattr, inode, (fattr));
1731 * into
1732 * NFS_PROTO(inode)->getattr(fattr);
1733 */
1734#define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args
1735
1736/*
1737 * Function vectors etc. for the NFS client
1738 */
David Howells509de812006-08-22 20:06:11 -04001739extern const struct nfs_rpc_ops nfs_v2_clientops;
1740extern const struct nfs_rpc_ops nfs_v3_clientops;
1741extern const struct nfs_rpc_ops nfs_v4_clientops;
Trond Myklebusta613fa12012-01-20 13:53:56 -05001742extern const struct rpc_version nfs_version2;
1743extern const struct rpc_version nfs_version3;
1744extern const struct rpc_version nfs_version4;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001745
Trond Myklebusta613fa12012-01-20 13:53:56 -05001746extern const struct rpc_version nfsacl_version3;
1747extern const struct rpc_program nfsacl_program;
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +00001748
Linus Torvalds1da177e2005-04-16 15:20:36 -07001749#endif