blob: 065f9d105d05bd5bac2d6ded8e3462b7eedce89c [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _LINUX_NFS_XDR_H
2#define _LINUX_NFS_XDR_H
3
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +00004#include <linux/nfsacl.h>
Boaz Harroshd7031582009-12-03 20:28:47 +02005#include <linux/nfs3.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07006
Chuck Lever40859d72005-11-30 18:09:02 -05007/*
8 * To change the maximum rsize and wsize supported by the NFS client, adjust
9 * NFS_MAX_FILE_IO_SIZE. 64KB is a typical maximum, but some servers can
10 * support a megabyte or more. The default is left at 4096 bytes, which is
11 * reasonable for NFS over UDP.
12 */
13#define NFS_MAX_FILE_IO_SIZE (1048576U)
14#define NFS_DEF_FILE_IO_SIZE (4096U)
15#define NFS_MIN_FILE_IO_SIZE (1024U)
16
Trond Myklebust8b4bdcf2006-06-09 09:34:19 -040017struct nfs_fsid {
18 uint64_t major;
19 uint64_t minor;
Linus Torvalds1da177e2005-04-16 15:20:36 -070020};
21
Trond Myklebust8b4bdcf2006-06-09 09:34:19 -040022/*
23 * Helper for checking equality between 2 fsids.
24 */
25static inline int nfs_fsid_equal(const struct nfs_fsid *a, const struct nfs_fsid *b)
26{
27 return a->major == b->major && a->minor == b->minor;
28}
29
Linus Torvalds1da177e2005-04-16 15:20:36 -070030struct nfs_fattr {
Trond Myklebust9e6e70f2009-03-11 14:10:24 -040031 unsigned int valid; /* which fields are valid */
Trond Myklebustbca79472009-03-11 14:10:26 -040032 umode_t mode;
Linus Torvalds1da177e2005-04-16 15:20:36 -070033 __u32 nlink;
34 __u32 uid;
35 __u32 gid;
Richard Kennedy9fa8d662008-08-26 16:23:20 +010036 dev_t rdev;
Linus Torvalds1da177e2005-04-16 15:20:36 -070037 __u64 size;
38 union {
39 struct {
40 __u32 blocksize;
41 __u32 blocks;
42 } nfs2;
43 struct {
44 __u64 used;
45 } nfs3;
46 } du;
Trond Myklebust8b4bdcf2006-06-09 09:34:19 -040047 struct nfs_fsid fsid;
Linus Torvalds1da177e2005-04-16 15:20:36 -070048 __u64 fileid;
49 struct timespec atime;
50 struct timespec mtime;
51 struct timespec ctime;
Linus Torvalds1da177e2005-04-16 15:20:36 -070052 __u64 change_attr; /* NFSv4 change attribute */
53 __u64 pre_change_attr;/* pre-op NFSv4 change attribute */
Trond Myklebust1ca277d2009-03-11 14:10:25 -040054 __u64 pre_size; /* pre_op_attr.size */
55 struct timespec pre_mtime; /* pre_op_attr.mtime */
56 struct timespec pre_ctime; /* pre_op_attr.ctime */
Trond Myklebust33801142005-10-27 22:12:39 -040057 unsigned long time_start;
Trond Myklebust4704f0e2008-10-14 19:16:07 -040058 unsigned long gencount;
Linus Torvalds1da177e2005-04-16 15:20:36 -070059};
60
Trond Myklebust9e6e70f2009-03-11 14:10:24 -040061#define NFS_ATTR_FATTR_TYPE (1U << 0)
62#define NFS_ATTR_FATTR_MODE (1U << 1)
63#define NFS_ATTR_FATTR_NLINK (1U << 2)
64#define NFS_ATTR_FATTR_OWNER (1U << 3)
65#define NFS_ATTR_FATTR_GROUP (1U << 4)
66#define NFS_ATTR_FATTR_RDEV (1U << 5)
67#define NFS_ATTR_FATTR_SIZE (1U << 6)
68#define NFS_ATTR_FATTR_PRESIZE (1U << 7)
69#define NFS_ATTR_FATTR_BLOCKS_USED (1U << 8)
70#define NFS_ATTR_FATTR_SPACE_USED (1U << 9)
71#define NFS_ATTR_FATTR_FSID (1U << 10)
72#define NFS_ATTR_FATTR_FILEID (1U << 11)
73#define NFS_ATTR_FATTR_ATIME (1U << 12)
74#define NFS_ATTR_FATTR_MTIME (1U << 13)
75#define NFS_ATTR_FATTR_CTIME (1U << 14)
76#define NFS_ATTR_FATTR_PREMTIME (1U << 15)
77#define NFS_ATTR_FATTR_PRECTIME (1U << 16)
78#define NFS_ATTR_FATTR_CHANGE (1U << 17)
79#define NFS_ATTR_FATTR_PRECHANGE (1U << 18)
80#define NFS_ATTR_FATTR_V4_REFERRAL (1U << 19) /* NFSv4 referral */
81
82#define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \
83 | NFS_ATTR_FATTR_MODE \
84 | NFS_ATTR_FATTR_NLINK \
85 | NFS_ATTR_FATTR_OWNER \
86 | NFS_ATTR_FATTR_GROUP \
87 | NFS_ATTR_FATTR_RDEV \
88 | NFS_ATTR_FATTR_SIZE \
89 | NFS_ATTR_FATTR_FSID \
90 | NFS_ATTR_FATTR_FILEID \
91 | NFS_ATTR_FATTR_ATIME \
92 | NFS_ATTR_FATTR_MTIME \
93 | NFS_ATTR_FATTR_CTIME)
94#define NFS_ATTR_FATTR_V2 (NFS_ATTR_FATTR \
95 | NFS_ATTR_FATTR_BLOCKS_USED)
96#define NFS_ATTR_FATTR_V3 (NFS_ATTR_FATTR \
97 | NFS_ATTR_FATTR_SPACE_USED)
98#define NFS_ATTR_FATTR_V4 (NFS_ATTR_FATTR \
99 | NFS_ATTR_FATTR_SPACE_USED \
100 | NFS_ATTR_FATTR_CHANGE)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101
102/*
103 * Info on the file system
104 */
105struct nfs_fsinfo {
106 struct nfs_fattr *fattr; /* Post-op attributes */
107 __u32 rtmax; /* max. read transfer size */
108 __u32 rtpref; /* pref. read transfer size */
109 __u32 rtmult; /* reads should be multiple of this */
110 __u32 wtmax; /* max. write transfer size */
111 __u32 wtpref; /* pref. write transfer size */
112 __u32 wtmult; /* writes should be multiple of this */
113 __u32 dtpref; /* pref. readdir transfer size */
114 __u64 maxfilesize;
Ricardo Labiaga6b967242010-10-12 16:30:05 -0700115 struct timespec time_delta; /* server time granularity */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116 __u32 lease_time; /* in seconds */
Andy Adamson504913f2010-10-20 00:17:57 -0400117 __u32 layouttype; /* supported pnfs layout driver */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118};
119
120struct nfs_fsstat {
121 struct nfs_fattr *fattr; /* Post-op attributes */
122 __u64 tbytes; /* total size in bytes */
123 __u64 fbytes; /* # of free bytes */
124 __u64 abytes; /* # of bytes available to user */
125 __u64 tfiles; /* # of files */
126 __u64 ffiles; /* # of free files */
127 __u64 afiles; /* # of files available to user */
128};
129
130struct nfs2_fsstat {
131 __u32 tsize; /* Server transfer size */
132 __u32 bsize; /* Filesystem block size */
133 __u32 blocks; /* No. of "bsize" blocks on filesystem */
134 __u32 bfree; /* No. of free "bsize" blocks */
135 __u32 bavail; /* No. of available "bsize" blocks */
136};
137
138struct nfs_pathconf {
139 struct nfs_fattr *fattr; /* Post-op attributes */
140 __u32 max_link; /* max # of hard links */
141 __u32 max_namelen; /* max name length */
142};
143
144struct nfs4_change_info {
145 u32 atomic;
146 u64 before;
147 u64 after;
148};
149
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700150struct nfs_seqid;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400151
Andy Adamson557134a2009-04-01 09:21:53 -0400152/* nfs41 sessions channel attributes */
153struct nfs4_channel_attrs {
154 u32 headerpadsz;
155 u32 max_rqst_sz;
156 u32 max_resp_sz;
157 u32 max_resp_sz_cached;
158 u32 max_ops;
159 u32 max_reqs;
160};
161
162/* nfs41 sessions slot seqid */
163struct nfs4_slot {
164 u32 seq_nr;
165};
166
Benny Halevy9ff71c32009-04-01 09:21:52 -0400167struct nfs4_sequence_args {
Benny Halevyf3752972009-04-01 09:22:04 -0400168 struct nfs4_session *sa_session;
Andy Adamsonfbcd4ab2009-04-01 09:22:15 -0400169 u8 sa_slotid;
170 u8 sa_cache_this;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400171};
172
173struct nfs4_sequence_res {
Benny Halevyf3752972009-04-01 09:22:04 -0400174 struct nfs4_session *sr_session;
Benny Halevydfb4f3092010-09-24 09:17:01 -0400175 struct nfs4_slot *sr_slot; /* slot used to send request */
Andy Adamsonfbcd4ab2009-04-01 09:22:15 -0400176 int sr_status; /* sequence operation status */
Richard Kennedya01878a2009-12-03 15:58:56 -0500177 unsigned long sr_renewal_time;
Alexandros Batsakis0629e372009-12-05 13:46:14 -0500178 u32 sr_status_flags;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400179};
180
Andy Adamson2050f0c2009-04-01 09:22:30 -0400181struct nfs4_get_lease_time_args {
182 struct nfs4_sequence_args la_seq_args;
183};
184
185struct nfs4_get_lease_time_res {
186 struct nfs_fsinfo *lr_fsinfo;
187 struct nfs4_sequence_res lr_seq_res;
188};
189
Linus Torvalds1da177e2005-04-16 15:20:36 -0700190/*
191 * Arguments to the open call.
192 */
193struct nfs_openargs {
194 const struct nfs_fh * fh;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700195 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700196 int open_flags;
Trond Myklebustdc0b0272008-12-23 15:21:56 -0500197 fmode_t fmode;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700198 __u64 clientid;
Trond Myklebust9f958ab2007-07-02 13:58:33 -0400199 __u64 id;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700200 union {
Trond Myklebustd77d76f2010-06-16 09:52:27 -0400201 struct {
202 struct iattr * attrs; /* UNCHECKED, GUARDED */
203 nfs4_verifier verifier; /* EXCLUSIVE */
204 };
Linus Torvalds1da177e2005-04-16 15:20:36 -0700205 nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */
Trond Myklebustbd7bf9d2008-12-23 15:21:53 -0500206 fmode_t delegation_type; /* CLAIM_PREVIOUS */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700207 } u;
208 const struct qstr * name;
209 const struct nfs_server *server; /* Needed for ID mapping */
210 const u32 * bitmask;
211 __u32 claim;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400212 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700213};
214
215struct nfs_openres {
216 nfs4_stateid stateid;
217 struct nfs_fh fh;
218 struct nfs4_change_info cinfo;
219 __u32 rflags;
220 struct nfs_fattr * f_attr;
Trond Myklebust56ae19f2005-10-27 22:12:40 -0400221 struct nfs_fattr * dir_attr;
Trond Myklebustc1d51932008-04-07 13:20:54 -0400222 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700223 const struct nfs_server *server;
Trond Myklebustbd7bf9d2008-12-23 15:21:53 -0500224 fmode_t delegation_type;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700225 nfs4_stateid delegation;
226 __u32 do_recall;
227 __u64 maxsize;
Jeff Laytonaa53ed52007-06-05 14:49:03 -0400228 __u32 attrset[NFS4_BITMAP_SIZE];
Benny Halevy9ff71c32009-04-01 09:21:52 -0400229 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700230};
231
232/*
233 * Arguments to the open_confirm call.
234 */
235struct nfs_open_confirmargs {
236 const struct nfs_fh * fh;
Trond Myklebustcdd4e682006-01-03 09:55:12 +0100237 nfs4_stateid * stateid;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700238 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700239};
240
241struct nfs_open_confirmres {
242 nfs4_stateid stateid;
Trond Myklebustc1d51932008-04-07 13:20:54 -0400243 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700244};
245
246/*
247 * Arguments to the close call.
248 */
249struct nfs_closeargs {
250 struct nfs_fh * fh;
Trond Myklebust95121352005-10-18 14:20:12 -0700251 nfs4_stateid * stateid;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700252 struct nfs_seqid * seqid;
Trond Myklebustdc0b0272008-12-23 15:21:56 -0500253 fmode_t fmode;
Trond Myklebust516a6af2005-10-27 22:12:41 -0400254 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400255 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700256};
257
258struct nfs_closeres {
259 nfs4_stateid stateid;
Trond Myklebust516a6af2005-10-27 22:12:41 -0400260 struct nfs_fattr * fattr;
Trond Myklebustc1d51932008-04-07 13:20:54 -0400261 struct nfs_seqid * seqid;
Trond Myklebust516a6af2005-10-27 22:12:41 -0400262 const struct nfs_server *server;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400263 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700264};
265/*
266 * * Arguments to the lock,lockt, and locku call.
267 * */
268struct nfs_lowner {
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100269 __u64 clientid;
Trond Myklebust9f958ab2007-07-02 13:58:33 -0400270 __u64 id;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700271};
272
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100273struct nfs_lock_args {
274 struct nfs_fh * fh;
275 struct file_lock * fl;
Trond Myklebust06735b32005-10-18 14:20:15 -0700276 struct nfs_seqid * lock_seqid;
277 nfs4_stateid * lock_stateid;
278 struct nfs_seqid * open_seqid;
279 nfs4_stateid * open_stateid;
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100280 struct nfs_lowner lock_owner;
281 unsigned char block : 1;
282 unsigned char reclaim : 1;
283 unsigned char new_lock_owner : 1;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400284 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700285};
286
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100287struct nfs_lock_res {
Trond Myklebustc1d51932008-04-07 13:20:54 -0400288 nfs4_stateid stateid;
289 struct nfs_seqid * lock_seqid;
290 struct nfs_seqid * open_seqid;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400291 struct nfs4_sequence_res seq_res;
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100292};
293
294struct nfs_locku_args {
295 struct nfs_fh * fh;
296 struct file_lock * fl;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700297 struct nfs_seqid * seqid;
Trond Myklebustfaf5f492005-10-18 14:20:15 -0700298 nfs4_stateid * stateid;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400299 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700300};
301
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100302struct nfs_locku_res {
Trond Myklebustc1d51932008-04-07 13:20:54 -0400303 nfs4_stateid stateid;
304 struct nfs_seqid * seqid;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400305 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700306};
307
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100308struct nfs_lockt_args {
309 struct nfs_fh * fh;
310 struct file_lock * fl;
311 struct nfs_lowner lock_owner;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400312 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700313};
314
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100315struct nfs_lockt_res {
316 struct file_lock * denied; /* LOCK, LOCKT failed */
Benny Halevy9ff71c32009-04-01 09:21:52 -0400317 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700318};
319
Trond Myklebustd3c7b7c2010-07-01 12:49:01 -0400320struct nfs_release_lockowner_args {
321 struct nfs_lowner lock_owner;
322};
323
Linus Torvalds1da177e2005-04-16 15:20:36 -0700324struct nfs4_delegreturnargs {
325 const struct nfs_fh *fhandle;
326 const nfs4_stateid *stateid;
Trond Myklebustfa178f22006-01-03 09:55:38 +0100327 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400328 struct nfs4_sequence_args seq_args;
Trond Myklebustfa178f22006-01-03 09:55:38 +0100329};
330
331struct nfs4_delegreturnres {
332 struct nfs_fattr * fattr;
333 const struct nfs_server *server;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400334 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700335};
336
337/*
338 * Arguments to the read call.
339 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700340struct nfs_readargs {
341 struct nfs_fh * fh;
342 struct nfs_open_context *context;
Trond Myklebustf11ac8d2010-06-25 16:35:53 -0400343 struct nfs_lock_context *lock_context;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700344 __u64 offset;
345 __u32 count;
346 unsigned int pgbase;
347 struct page ** pages;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400348 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700349};
350
351struct nfs_readres {
352 struct nfs_fattr * fattr;
353 __u32 count;
354 int eof;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400355 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700356};
357
358/*
359 * Arguments to the write call.
360 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700361struct nfs_writeargs {
362 struct nfs_fh * fh;
363 struct nfs_open_context *context;
Trond Myklebustf11ac8d2010-06-25 16:35:53 -0400364 struct nfs_lock_context *lock_context;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700365 __u64 offset;
366 __u32 count;
367 enum nfs3_stable_how stable;
368 unsigned int pgbase;
369 struct page ** pages;
Trond Myklebust4f9838c2005-10-27 22:12:44 -0400370 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400371 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700372};
373
374struct nfs_writeverf {
375 enum nfs3_stable_how committed;
Al Virobc4785c2006-10-19 23:28:51 -0700376 __be32 verifier[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700377};
378
379struct nfs_writeres {
380 struct nfs_fattr * fattr;
381 struct nfs_writeverf * verf;
382 __u32 count;
Trond Myklebust4f9838c2005-10-27 22:12:44 -0400383 const struct nfs_server *server;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400384 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700385};
386
387/*
Trond Myklebust4fdc17b2007-07-14 15:39:57 -0400388 * Common arguments to the unlink call
389 */
390struct nfs_removeargs {
391 const struct nfs_fh *fh;
392 struct qstr name;
393 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400394 struct nfs4_sequence_args seq_args;
Trond Myklebust4fdc17b2007-07-14 15:39:57 -0400395};
396
397struct nfs_removeres {
398 const struct nfs_server *server;
Trond Myklebustd3468902010-04-16 16:22:50 -0400399 struct nfs_fattr *dir_attr;
Trond Myklebust4fdc17b2007-07-14 15:39:57 -0400400 struct nfs4_change_info cinfo;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400401 struct nfs4_sequence_res seq_res;
Trond Myklebust4fdc17b2007-07-14 15:39:57 -0400402};
403
404/*
Jeff Layton920769f2010-09-17 17:30:25 -0400405 * Common arguments to the rename call
406 */
407struct nfs_renameargs {
408 const struct nfs_fh *old_dir;
409 const struct nfs_fh *new_dir;
410 const struct qstr *old_name;
411 const struct qstr *new_name;
412 const u32 *bitmask;
413 struct nfs4_sequence_args seq_args;
414};
415
Jeff Laytone8582a82010-09-17 17:31:06 -0400416struct nfs_renameres {
417 const struct nfs_server *server;
418 struct nfs4_change_info old_cinfo;
419 struct nfs_fattr *old_fattr;
420 struct nfs4_change_info new_cinfo;
421 struct nfs_fattr *new_fattr;
422 struct nfs4_sequence_res seq_res;
423};
424
Jeff Layton920769f2010-09-17 17:30:25 -0400425/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700426 * Argument struct for decode_entry function
427 */
428struct nfs_entry {
429 __u64 ino;
430 __u64 cookie,
431 prev_cookie;
432 const char * name;
433 unsigned int len;
434 int eof;
435 struct nfs_fh * fh;
436 struct nfs_fattr * fattr;
437};
438
439/*
440 * The following types are for NFSv2 only.
441 */
442struct nfs_sattrargs {
443 struct nfs_fh * fh;
444 struct iattr * sattr;
445};
446
447struct nfs_diropargs {
448 struct nfs_fh * fh;
449 const char * name;
450 unsigned int len;
451};
452
453struct nfs_createargs {
454 struct nfs_fh * fh;
455 const char * name;
456 unsigned int len;
457 struct iattr * sattr;
458};
459
Linus Torvalds1da177e2005-04-16 15:20:36 -0700460struct nfs_setattrargs {
461 struct nfs_fh * fh;
462 nfs4_stateid stateid;
463 struct iattr * iap;
464 const struct nfs_server * server; /* Needed for name mapping */
465 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400466 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700467};
468
J. Bruce Fields23ec6962005-06-22 17:16:22 +0000469struct nfs_setaclargs {
470 struct nfs_fh * fh;
471 size_t acl_len;
472 unsigned int acl_pgbase;
473 struct page ** acl_pages;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400474 struct nfs4_sequence_args seq_args;
J. Bruce Fields23ec6962005-06-22 17:16:22 +0000475};
476
Benny Halevy73c403a2009-04-01 09:22:01 -0400477struct nfs_setaclres {
478 struct nfs4_sequence_res seq_res;
479};
480
J. Bruce Fields029d1052005-06-22 17:16:22 +0000481struct nfs_getaclargs {
482 struct nfs_fh * fh;
483 size_t acl_len;
484 unsigned int acl_pgbase;
485 struct page ** acl_pages;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400486 struct nfs4_sequence_args seq_args;
J. Bruce Fields029d1052005-06-22 17:16:22 +0000487};
488
Benny Halevy663c79b2009-04-01 09:21:59 -0400489struct nfs_getaclres {
490 size_t acl_len;
491 struct nfs4_sequence_res seq_res;
492};
493
Linus Torvalds1da177e2005-04-16 15:20:36 -0700494struct nfs_setattrres {
495 struct nfs_fattr * fattr;
496 const struct nfs_server * server;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400497 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700498};
499
500struct nfs_linkargs {
501 struct nfs_fh * fromfh;
502 struct nfs_fh * tofh;
503 const char * toname;
504 unsigned int tolen;
505};
506
507struct nfs_symlinkargs {
508 struct nfs_fh * fromfh;
509 const char * fromname;
510 unsigned int fromlen;
Chuck Lever94a6d752006-08-22 20:06:23 -0400511 struct page ** pages;
512 unsigned int pathlen;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700513 struct iattr * sattr;
514};
515
516struct nfs_readdirargs {
517 struct nfs_fh * fh;
518 __u32 cookie;
519 unsigned int count;
520 struct page ** pages;
521};
522
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +0000523struct nfs3_getaclargs {
524 struct nfs_fh * fh;
525 int mask;
526 struct page ** pages;
527};
528
529struct nfs3_setaclargs {
530 struct inode * inode;
531 int mask;
532 struct posix_acl * acl_access;
533 struct posix_acl * acl_default;
Trond Myklebustae461412009-03-10 20:33:18 -0400534 size_t len;
535 unsigned int npages;
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +0000536 struct page ** pages;
537};
538
Linus Torvalds1da177e2005-04-16 15:20:36 -0700539struct nfs_diropok {
540 struct nfs_fh * fh;
541 struct nfs_fattr * fattr;
542};
543
544struct nfs_readlinkargs {
545 struct nfs_fh * fh;
546 unsigned int pgbase;
547 unsigned int pglen;
548 struct page ** pages;
549};
550
551struct nfs3_sattrargs {
552 struct nfs_fh * fh;
553 struct iattr * sattr;
554 unsigned int guard;
555 struct timespec guardtime;
556};
557
558struct nfs3_diropargs {
559 struct nfs_fh * fh;
560 const char * name;
561 unsigned int len;
562};
563
564struct nfs3_accessargs {
565 struct nfs_fh * fh;
566 __u32 access;
567};
568
569struct nfs3_createargs {
570 struct nfs_fh * fh;
571 const char * name;
572 unsigned int len;
573 struct iattr * sattr;
574 enum nfs3_createmode createmode;
Al Virobc4785c2006-10-19 23:28:51 -0700575 __be32 verifier[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700576};
577
578struct nfs3_mkdirargs {
579 struct nfs_fh * fh;
580 const char * name;
581 unsigned int len;
582 struct iattr * sattr;
583};
584
585struct nfs3_symlinkargs {
586 struct nfs_fh * fromfh;
587 const char * fromname;
588 unsigned int fromlen;
Chuck Lever94a6d752006-08-22 20:06:23 -0400589 struct page ** pages;
590 unsigned int pathlen;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700591 struct iattr * sattr;
592};
593
594struct nfs3_mknodargs {
595 struct nfs_fh * fh;
596 const char * name;
597 unsigned int len;
598 enum nfs3_ftype type;
599 struct iattr * sattr;
600 dev_t rdev;
601};
602
Linus Torvalds1da177e2005-04-16 15:20:36 -0700603struct nfs3_linkargs {
604 struct nfs_fh * fromfh;
605 struct nfs_fh * tofh;
606 const char * toname;
607 unsigned int tolen;
608};
609
610struct nfs3_readdirargs {
611 struct nfs_fh * fh;
612 __u64 cookie;
Al Virobc4785c2006-10-19 23:28:51 -0700613 __be32 verf[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700614 int plus;
615 unsigned int count;
616 struct page ** pages;
617};
618
619struct nfs3_diropres {
620 struct nfs_fattr * dir_attr;
621 struct nfs_fh * fh;
622 struct nfs_fattr * fattr;
623};
624
625struct nfs3_accessres {
626 struct nfs_fattr * fattr;
627 __u32 access;
628};
629
630struct nfs3_readlinkargs {
631 struct nfs_fh * fh;
632 unsigned int pgbase;
633 unsigned int pglen;
634 struct page ** pages;
635};
636
Linus Torvalds1da177e2005-04-16 15:20:36 -0700637struct nfs3_linkres {
638 struct nfs_fattr * dir_attr;
639 struct nfs_fattr * fattr;
640};
641
642struct nfs3_readdirres {
643 struct nfs_fattr * dir_attr;
Al Virobc4785c2006-10-19 23:28:51 -0700644 __be32 * verf;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700645 int plus;
646};
647
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +0000648struct nfs3_getaclres {
649 struct nfs_fattr * fattr;
650 int mask;
651 unsigned int acl_access_count;
652 unsigned int acl_default_count;
653 struct posix_acl * acl_access;
654 struct posix_acl * acl_default;
655};
656
Linus Torvalds1da177e2005-04-16 15:20:36 -0700657#ifdef CONFIG_NFS_V4
658
659typedef u64 clientid4;
660
661struct nfs4_accessargs {
662 const struct nfs_fh * fh;
Trond Myklebust76b32992007-08-10 17:45:11 -0400663 const u32 * bitmask;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700664 u32 access;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400665 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700666};
667
668struct nfs4_accessres {
Trond Myklebust76b32992007-08-10 17:45:11 -0400669 const struct nfs_server * server;
670 struct nfs_fattr * fattr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700671 u32 supported;
672 u32 access;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400673 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700674};
675
676struct nfs4_create_arg {
677 u32 ftype;
678 union {
Chuck Lever94a6d752006-08-22 20:06:23 -0400679 struct {
680 struct page ** pages;
681 unsigned int len;
682 } symlink; /* NF4LNK */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700683 struct {
684 u32 specdata1;
685 u32 specdata2;
686 } device; /* NF4BLK, NF4CHR */
687 } u;
688 const struct qstr * name;
689 const struct nfs_server * server;
690 const struct iattr * attrs;
691 const struct nfs_fh * dir_fh;
692 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400693 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700694};
695
696struct nfs4_create_res {
697 const struct nfs_server * server;
698 struct nfs_fh * fh;
699 struct nfs_fattr * fattr;
700 struct nfs4_change_info dir_cinfo;
Trond Myklebust56ae19f2005-10-27 22:12:40 -0400701 struct nfs_fattr * dir_fattr;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400702 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700703};
704
705struct nfs4_fsinfo_arg {
706 const struct nfs_fh * fh;
707 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400708 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700709};
710
Benny Halevy3dda5e42009-04-01 09:21:57 -0400711struct nfs4_fsinfo_res {
712 struct nfs_fsinfo *fsinfo;
713 struct nfs4_sequence_res seq_res;
714};
715
Linus Torvalds1da177e2005-04-16 15:20:36 -0700716struct nfs4_getattr_arg {
717 const struct nfs_fh * fh;
718 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400719 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700720};
721
722struct nfs4_getattr_res {
723 const struct nfs_server * server;
724 struct nfs_fattr * fattr;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400725 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700726};
727
728struct nfs4_link_arg {
729 const struct nfs_fh * fh;
730 const struct nfs_fh * dir_fh;
731 const struct qstr * name;
Trond Myklebust91ba2ee2005-10-27 22:12:42 -0400732 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400733 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700734};
735
Trond Myklebust91ba2ee2005-10-27 22:12:42 -0400736struct nfs4_link_res {
737 const struct nfs_server * server;
738 struct nfs_fattr * fattr;
739 struct nfs4_change_info cinfo;
740 struct nfs_fattr * dir_attr;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400741 struct nfs4_sequence_res seq_res;
Trond Myklebust91ba2ee2005-10-27 22:12:42 -0400742};
743
744
Linus Torvalds1da177e2005-04-16 15:20:36 -0700745struct nfs4_lookup_arg {
746 const struct nfs_fh * dir_fh;
747 const struct qstr * name;
748 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400749 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700750};
751
752struct nfs4_lookup_res {
753 const struct nfs_server * server;
754 struct nfs_fattr * fattr;
755 struct nfs_fh * fh;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400756 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700757};
758
759struct nfs4_lookup_root_arg {
760 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400761 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700762};
763
764struct nfs4_pathconf_arg {
765 const struct nfs_fh * fh;
766 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400767 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700768};
769
Benny Halevyd45b2982009-04-01 09:21:58 -0400770struct nfs4_pathconf_res {
771 struct nfs_pathconf *pathconf;
772 struct nfs4_sequence_res seq_res;
773};
774
Linus Torvalds1da177e2005-04-16 15:20:36 -0700775struct nfs4_readdir_arg {
776 const struct nfs_fh * fh;
777 u64 cookie;
778 nfs4_verifier verifier;
779 u32 count;
780 struct page ** pages; /* zero-copy data */
781 unsigned int pgbase; /* zero-copy data */
782 const u32 * bitmask;
Bryan Schumaker82f2e542010-10-21 16:33:18 -0400783 int plus;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400784 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700785};
786
787struct nfs4_readdir_res {
788 nfs4_verifier verifier;
789 unsigned int pgbase;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400790 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700791};
792
793struct nfs4_readlink {
794 const struct nfs_fh * fh;
795 unsigned int pgbase;
796 unsigned int pglen; /* zero-copy data */
797 struct page ** pages; /* zero-copy data */
Benny Halevy9ff71c32009-04-01 09:21:52 -0400798 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700799};
800
Benny Halevyf50c7002009-04-01 09:21:55 -0400801struct nfs4_readlink_res {
802 struct nfs4_sequence_res seq_res;
803};
804
Trond Myklebust19d771f2008-10-08 13:54:52 -0400805#define NFS4_SETCLIENTID_NAMELEN (127)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700806struct nfs4_setclientid {
Chuck Levercc38bac2007-12-10 14:56:54 -0500807 const nfs4_verifier * sc_verifier;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700808 unsigned int sc_name_len;
Chuck Leverd1ce02e2008-09-25 11:57:12 -0400809 char sc_name[NFS4_SETCLIENTID_NAMELEN + 1];
Chuck Levercc38bac2007-12-10 14:56:54 -0500810 u32 sc_prog;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700811 unsigned int sc_netid_len;
Chuck Leverd1ce02e2008-09-25 11:57:12 -0400812 char sc_netid[RPCBIND_MAXNETIDLEN + 1];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700813 unsigned int sc_uaddr_len;
Chuck Leverd1ce02e2008-09-25 11:57:12 -0400814 char sc_uaddr[RPCBIND_MAXUADDRLEN + 1];
Chuck Levercc38bac2007-12-10 14:56:54 -0500815 u32 sc_cb_ident;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700816};
817
Trond Myklebustbb8b27e2010-04-16 16:43:06 -0400818struct nfs4_setclientid_res {
819 u64 clientid;
820 nfs4_verifier confirm;
821};
822
Linus Torvalds1da177e2005-04-16 15:20:36 -0700823struct nfs4_statfs_arg {
824 const struct nfs_fh * fh;
825 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400826 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700827};
828
Benny Halevy24ad1482009-04-01 09:21:56 -0400829struct nfs4_statfs_res {
830 struct nfs_fsstat *fsstat;
831 struct nfs4_sequence_res seq_res;
832};
833
Benny Halevy43652ad2009-04-01 09:21:54 -0400834struct nfs4_server_caps_arg {
835 struct nfs_fh *fhandle;
836 struct nfs4_sequence_args seq_args;
837};
838
Linus Torvalds1da177e2005-04-16 15:20:36 -0700839struct nfs4_server_caps_res {
840 u32 attr_bitmask[2];
841 u32 acl_bitmask;
842 u32 has_links;
843 u32 has_symlinks;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400844 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700845};
846
Manoj Naik7aaa0b32006-06-09 09:34:23 -0400847struct nfs4_string {
848 unsigned int len;
849 char *data;
Trond Myklebust683b57b2006-06-09 09:34:22 -0400850};
851
Manoj Naik7aaa0b32006-06-09 09:34:23 -0400852#define NFS4_PATHNAME_MAXCOMPONENTS 512
853struct nfs4_pathname {
854 unsigned int ncomponents;
855 struct nfs4_string components[NFS4_PATHNAME_MAXCOMPONENTS];
856};
857
858#define NFS4_FS_LOCATION_MAXSERVERS 10
859struct nfs4_fs_location {
860 unsigned int nservers;
861 struct nfs4_string servers[NFS4_FS_LOCATION_MAXSERVERS];
862 struct nfs4_pathname rootpath;
863};
864
865#define NFS4_FS_LOCATIONS_MAXENTRIES 10
866struct nfs4_fs_locations {
Trond Myklebust683b57b2006-06-09 09:34:22 -0400867 struct nfs_fattr fattr;
868 const struct nfs_server *server;
Manoj Naik7aaa0b32006-06-09 09:34:23 -0400869 struct nfs4_pathname fs_path;
Trond Myklebust683b57b2006-06-09 09:34:22 -0400870 int nlocations;
Manoj Naik7aaa0b32006-06-09 09:34:23 -0400871 struct nfs4_fs_location locations[NFS4_FS_LOCATIONS_MAXENTRIES];
Trond Myklebust683b57b2006-06-09 09:34:22 -0400872};
873
874struct nfs4_fs_locations_arg {
875 const struct nfs_fh *dir_fh;
876 const struct qstr *name;
877 struct page *page;
878 const u32 *bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400879 struct nfs4_sequence_args seq_args;
Trond Myklebust683b57b2006-06-09 09:34:22 -0400880};
881
Benny Halevy22958462009-04-01 09:22:02 -0400882struct nfs4_fs_locations_res {
883 struct nfs4_fs_locations *fs_locations;
884 struct nfs4_sequence_res seq_res;
885};
886
Linus Torvalds1da177e2005-04-16 15:20:36 -0700887#endif /* CONFIG_NFS_V4 */
888
Benny Halevy99fe60d2009-04-01 09:22:29 -0400889struct nfstime4 {
890 u64 seconds;
891 u32 nseconds;
892};
893
894#ifdef CONFIG_NFS_V4_1
895struct nfs_impl_id4 {
896 u32 domain_len;
897 char *domain;
898 u32 name_len;
899 char *name;
900 struct nfstime4 date;
901};
902
903#define NFS4_EXCHANGE_ID_LEN (48)
904struct nfs41_exchange_id_args {
905 struct nfs_client *client;
906 nfs4_verifier *verifier;
907 unsigned int id_len;
908 char id[NFS4_EXCHANGE_ID_LEN];
909 u32 flags;
910};
911
912struct server_owner {
913 uint64_t minor_id;
914 uint32_t major_id_sz;
915 char major_id[NFS4_OPAQUE_LIMIT];
916};
917
918struct server_scope {
919 uint32_t server_scope_sz;
920 char server_scope[NFS4_OPAQUE_LIMIT];
921};
922
923struct nfs41_exchange_id_res {
924 struct nfs_client *client;
925 u32 flags;
926};
Andy Adamsonfc931582009-04-01 09:22:31 -0400927
928struct nfs41_create_session_args {
929 struct nfs_client *client;
930 uint32_t flags;
931 uint32_t cb_program;
932 struct nfs4_channel_attrs fc_attrs; /* Fore Channel */
933 struct nfs4_channel_attrs bc_attrs; /* Back Channel */
934};
935
936struct nfs41_create_session_res {
937 struct nfs_client *client;
938};
Ricardo Labiaga180197532009-12-05 16:08:40 -0500939
940struct nfs41_reclaim_complete_args {
941 /* In the future extend to include curr_fh for use with migration */
942 unsigned char one_fs:1;
943 struct nfs4_sequence_args seq_args;
944};
945
946struct nfs41_reclaim_complete_res {
947 struct nfs4_sequence_res seq_res;
948};
Benny Halevy99fe60d2009-04-01 09:22:29 -0400949#endif /* CONFIG_NFS_V4_1 */
950
Linus Torvalds1da177e2005-04-16 15:20:36 -0700951struct nfs_page;
952
Chuck Lever40859d72005-11-30 18:09:02 -0500953#define NFS_PAGEVEC_SIZE (8U)
954
Linus Torvalds1da177e2005-04-16 15:20:36 -0700955struct nfs_read_data {
956 int flags;
957 struct rpc_task task;
958 struct inode *inode;
959 struct rpc_cred *cred;
960 struct nfs_fattr fattr; /* fattr storage */
961 struct list_head pages; /* Coalesced read requests */
962 struct nfs_page *req; /* multi ops per nfs_page */
Chuck Lever40859d72005-11-30 18:09:02 -0500963 struct page **pagevec;
Trond Myklebuste9f7bee2006-09-08 09:48:54 -0700964 unsigned int npages; /* Max length of pagevec */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700965 struct nfs_readargs args;
966 struct nfs_readres res;
967#ifdef CONFIG_NFS_V4
968 unsigned long timestamp; /* For lease renewal */
969#endif
Chuck Lever0d0b5cb2006-05-25 01:40:53 -0400970 struct page *page_array[NFS_PAGEVEC_SIZE];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700971};
972
973struct nfs_write_data {
974 int flags;
975 struct rpc_task task;
976 struct inode *inode;
977 struct rpc_cred *cred;
978 struct nfs_fattr fattr;
979 struct nfs_writeverf verf;
980 struct list_head pages; /* Coalesced requests we wish to flush */
981 struct nfs_page *req; /* multi ops per nfs_page */
Chuck Lever40859d72005-11-30 18:09:02 -0500982 struct page **pagevec;
Trond Myklebuste9f7bee2006-09-08 09:48:54 -0700983 unsigned int npages; /* Max length of pagevec */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700984 struct nfs_writeargs args; /* argument struct */
985 struct nfs_writeres res; /* result struct */
986#ifdef CONFIG_NFS_V4
987 unsigned long timestamp; /* For lease renewal */
988#endif
Chuck Lever0d0b5cb2006-05-25 01:40:53 -0400989 struct page *page_array[NFS_PAGEVEC_SIZE];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700990};
991
992struct nfs_access_entry;
993
994/*
995 * RPC procedure vector for NFSv2/NFSv3 demuxing
996 */
997struct nfs_rpc_ops {
Chuck Leverc0e07cb2008-01-14 12:32:05 -0500998 u32 version; /* Protocol version */
Al Virof786aa92009-02-20 05:51:22 +0000999 const struct dentry_operations *dentry_ops;
Arjan van de Venc5ef1c42007-02-12 00:55:40 -08001000 const struct inode_operations *dir_inode_ops;
1001 const struct inode_operations *file_inode_ops;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001002
1003 int (*getroot) (struct nfs_server *, struct nfs_fh *,
1004 struct nfs_fsinfo *);
David Howells2b3de442006-08-22 20:06:09 -04001005 int (*lookupfh)(struct nfs_server *, struct nfs_fh *,
1006 struct qstr *, struct nfs_fh *,
1007 struct nfs_fattr *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001008 int (*getattr) (struct nfs_server *, struct nfs_fh *,
1009 struct nfs_fattr *);
1010 int (*setattr) (struct dentry *, struct nfs_fattr *,
1011 struct iattr *);
1012 int (*lookup) (struct inode *, struct qstr *,
1013 struct nfs_fh *, struct nfs_fattr *);
1014 int (*access) (struct inode *, struct nfs_access_entry *);
1015 int (*readlink)(struct inode *, struct page *, unsigned int,
1016 unsigned int);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001017 int (*create) (struct inode *, struct dentry *,
Trond Myklebustc0204fd2010-09-17 10:56:51 -04001018 struct iattr *, int, struct nfs_open_context *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001019 int (*remove) (struct inode *, struct qstr *);
Trond Myklebuste4eff1a2007-07-14 15:39:58 -04001020 void (*unlink_setup) (struct rpc_message *, struct inode *dir);
1021 int (*unlink_done) (struct rpc_task *, struct inode *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001022 int (*rename) (struct inode *, struct qstr *,
1023 struct inode *, struct qstr *);
Jeff Laytond3d41522010-09-17 17:31:57 -04001024 void (*rename_setup) (struct rpc_message *msg, struct inode *dir);
1025 int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001026 int (*link) (struct inode *, struct inode *, struct qstr *);
Chuck Lever94a6d752006-08-22 20:06:23 -04001027 int (*symlink) (struct inode *, struct dentry *, struct page *,
1028 unsigned int, struct iattr *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001029 int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
1030 int (*rmdir) (struct inode *, struct qstr *);
1031 int (*readdir) (struct dentry *, struct rpc_cred *,
Bryan Schumaker56e4ebf2010-10-20 15:44:37 -04001032 u64, struct page **, unsigned int, int);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001033 int (*mknod) (struct inode *, struct dentry *, struct iattr *,
1034 dev_t);
1035 int (*statfs) (struct nfs_server *, struct nfs_fh *,
1036 struct nfs_fsstat *);
1037 int (*fsinfo) (struct nfs_server *, struct nfs_fh *,
1038 struct nfs_fsinfo *);
1039 int (*pathconf) (struct nfs_server *, struct nfs_fh *,
1040 struct nfs_pathconf *);
David Howellse9326dc2006-08-22 20:06:10 -04001041 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
Bryan Schumaker82f2e542010-10-21 16:33:18 -04001042 __be32 *(*decode_dirent)(struct xdr_stream *, struct nfs_entry *, struct nfs_server *, int plus);
Trond Myklebustbdc7f022007-07-14 15:40:00 -04001043 void (*read_setup) (struct nfs_read_data *, struct rpc_message *);
Trond Myklebustec06c092006-03-20 13:44:27 -05001044 int (*read_done) (struct rpc_task *, struct nfs_read_data *);
Trond Myklebustbdc7f022007-07-14 15:40:00 -04001045 void (*write_setup) (struct nfs_write_data *, struct rpc_message *);
Trond Myklebust788e7a82006-03-20 13:44:27 -05001046 int (*write_done) (struct rpc_task *, struct nfs_write_data *);
Trond Myklebustbdc7f022007-07-14 15:40:00 -04001047 void (*commit_setup) (struct nfs_write_data *, struct rpc_message *);
Trond Myklebust788e7a82006-03-20 13:44:27 -05001048 int (*commit_done) (struct rpc_task *, struct nfs_write_data *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001049 int (*lock)(struct file *, int, struct file_lock *);
Trond Myklebust21162712008-05-20 19:34:39 -04001050 int (*lock_check_bounds)(const struct file_lock *);
Trond Myklebustada70d92005-06-22 17:16:22 +00001051 void (*clear_acl_cache)(struct inode *);
Trond Myklebust7fe5c392009-03-19 15:35:50 -04001052 void (*close_context)(struct nfs_open_context *ctx, int);
Trond Myklebust2b484292010-09-17 10:56:51 -04001053 struct inode * (*open_context) (struct inode *dir,
1054 struct nfs_open_context *ctx,
1055 int open_flags,
1056 struct iattr *iattr);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001057};
1058
1059/*
1060 * NFS_CALL(getattr, inode, (fattr));
1061 * into
1062 * NFS_PROTO(inode)->getattr(fattr);
1063 */
1064#define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args
1065
1066/*
1067 * Function vectors etc. for the NFS client
1068 */
David Howells509de812006-08-22 20:06:11 -04001069extern const struct nfs_rpc_ops nfs_v2_clientops;
1070extern const struct nfs_rpc_ops nfs_v3_clientops;
1071extern const struct nfs_rpc_ops nfs_v4_clientops;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001072extern struct rpc_version nfs_version2;
1073extern struct rpc_version nfs_version3;
1074extern struct rpc_version nfs_version4;
1075
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +00001076extern struct rpc_version nfsacl_version3;
1077extern struct rpc_program nfsacl_program;
1078
Linus Torvalds1da177e2005-04-16 15:20:36 -07001079#endif