blob: 51071b335751daa2723a849a23f0595748a7878e [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>
Linus Torvalds1da177e2005-04-16 15:20:36 -07005
Chuck Lever40859d72005-11-30 18:09:02 -05006/*
7 * To change the maximum rsize and wsize supported by the NFS client, adjust
8 * NFS_MAX_FILE_IO_SIZE. 64KB is a typical maximum, but some servers can
9 * support a megabyte or more. The default is left at 4096 bytes, which is
10 * reasonable for NFS over UDP.
11 */
12#define NFS_MAX_FILE_IO_SIZE (1048576U)
13#define NFS_DEF_FILE_IO_SIZE (4096U)
14#define NFS_MIN_FILE_IO_SIZE (1024U)
15
Trond Myklebust8b4bdcf2006-06-09 09:34:19 -040016struct nfs_fsid {
17 uint64_t major;
18 uint64_t minor;
Linus Torvalds1da177e2005-04-16 15:20:36 -070019};
20
Trond Myklebust8b4bdcf2006-06-09 09:34:19 -040021/*
22 * Helper for checking equality between 2 fsids.
23 */
24static inline int nfs_fsid_equal(const struct nfs_fsid *a, const struct nfs_fsid *b)
25{
26 return a->major == b->major && a->minor == b->minor;
27}
28
Linus Torvalds1da177e2005-04-16 15:20:36 -070029struct nfs_fattr {
Trond Myklebust9e6e70f2009-03-11 14:10:24 -040030 unsigned int valid; /* which fields are valid */
Trond Myklebustbca79472009-03-11 14:10:26 -040031 umode_t mode;
Linus Torvalds1da177e2005-04-16 15:20:36 -070032 __u32 nlink;
33 __u32 uid;
34 __u32 gid;
Richard Kennedy9fa8d662008-08-26 16:23:20 +010035 dev_t rdev;
Linus Torvalds1da177e2005-04-16 15:20:36 -070036 __u64 size;
37 union {
38 struct {
39 __u32 blocksize;
40 __u32 blocks;
41 } nfs2;
42 struct {
43 __u64 used;
44 } nfs3;
45 } du;
Trond Myklebust8b4bdcf2006-06-09 09:34:19 -040046 struct nfs_fsid fsid;
Linus Torvalds1da177e2005-04-16 15:20:36 -070047 __u64 fileid;
48 struct timespec atime;
49 struct timespec mtime;
50 struct timespec ctime;
Linus Torvalds1da177e2005-04-16 15:20:36 -070051 __u64 change_attr; /* NFSv4 change attribute */
52 __u64 pre_change_attr;/* pre-op NFSv4 change attribute */
Trond Myklebust1ca277d2009-03-11 14:10:25 -040053 __u64 pre_size; /* pre_op_attr.size */
54 struct timespec pre_mtime; /* pre_op_attr.mtime */
55 struct timespec pre_ctime; /* pre_op_attr.ctime */
Trond Myklebust33801142005-10-27 22:12:39 -040056 unsigned long time_start;
Trond Myklebust4704f0e2008-10-14 19:16:07 -040057 unsigned long gencount;
Linus Torvalds1da177e2005-04-16 15:20:36 -070058};
59
Trond Myklebust9e6e70f2009-03-11 14:10:24 -040060#define NFS_ATTR_FATTR_TYPE (1U << 0)
61#define NFS_ATTR_FATTR_MODE (1U << 1)
62#define NFS_ATTR_FATTR_NLINK (1U << 2)
63#define NFS_ATTR_FATTR_OWNER (1U << 3)
64#define NFS_ATTR_FATTR_GROUP (1U << 4)
65#define NFS_ATTR_FATTR_RDEV (1U << 5)
66#define NFS_ATTR_FATTR_SIZE (1U << 6)
67#define NFS_ATTR_FATTR_PRESIZE (1U << 7)
68#define NFS_ATTR_FATTR_BLOCKS_USED (1U << 8)
69#define NFS_ATTR_FATTR_SPACE_USED (1U << 9)
70#define NFS_ATTR_FATTR_FSID (1U << 10)
71#define NFS_ATTR_FATTR_FILEID (1U << 11)
72#define NFS_ATTR_FATTR_ATIME (1U << 12)
73#define NFS_ATTR_FATTR_MTIME (1U << 13)
74#define NFS_ATTR_FATTR_CTIME (1U << 14)
75#define NFS_ATTR_FATTR_PREMTIME (1U << 15)
76#define NFS_ATTR_FATTR_PRECTIME (1U << 16)
77#define NFS_ATTR_FATTR_CHANGE (1U << 17)
78#define NFS_ATTR_FATTR_PRECHANGE (1U << 18)
79#define NFS_ATTR_FATTR_V4_REFERRAL (1U << 19) /* NFSv4 referral */
80
81#define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \
82 | NFS_ATTR_FATTR_MODE \
83 | NFS_ATTR_FATTR_NLINK \
84 | NFS_ATTR_FATTR_OWNER \
85 | NFS_ATTR_FATTR_GROUP \
86 | NFS_ATTR_FATTR_RDEV \
87 | NFS_ATTR_FATTR_SIZE \
88 | NFS_ATTR_FATTR_FSID \
89 | NFS_ATTR_FATTR_FILEID \
90 | NFS_ATTR_FATTR_ATIME \
91 | NFS_ATTR_FATTR_MTIME \
92 | NFS_ATTR_FATTR_CTIME)
93#define NFS_ATTR_FATTR_V2 (NFS_ATTR_FATTR \
94 | NFS_ATTR_FATTR_BLOCKS_USED)
95#define NFS_ATTR_FATTR_V3 (NFS_ATTR_FATTR \
96 | NFS_ATTR_FATTR_SPACE_USED)
97#define NFS_ATTR_FATTR_V4 (NFS_ATTR_FATTR \
98 | NFS_ATTR_FATTR_SPACE_USED \
99 | NFS_ATTR_FATTR_CHANGE)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100
101/*
102 * Info on the file system
103 */
104struct nfs_fsinfo {
105 struct nfs_fattr *fattr; /* Post-op attributes */
106 __u32 rtmax; /* max. read transfer size */
107 __u32 rtpref; /* pref. read transfer size */
108 __u32 rtmult; /* reads should be multiple of this */
109 __u32 wtmax; /* max. write transfer size */
110 __u32 wtpref; /* pref. write transfer size */
111 __u32 wtmult; /* writes should be multiple of this */
112 __u32 dtpref; /* pref. readdir transfer size */
113 __u64 maxfilesize;
114 __u32 lease_time; /* in seconds */
115};
116
117struct nfs_fsstat {
118 struct nfs_fattr *fattr; /* Post-op attributes */
119 __u64 tbytes; /* total size in bytes */
120 __u64 fbytes; /* # of free bytes */
121 __u64 abytes; /* # of bytes available to user */
122 __u64 tfiles; /* # of files */
123 __u64 ffiles; /* # of free files */
124 __u64 afiles; /* # of files available to user */
125};
126
127struct nfs2_fsstat {
128 __u32 tsize; /* Server transfer size */
129 __u32 bsize; /* Filesystem block size */
130 __u32 blocks; /* No. of "bsize" blocks on filesystem */
131 __u32 bfree; /* No. of free "bsize" blocks */
132 __u32 bavail; /* No. of available "bsize" blocks */
133};
134
135struct nfs_pathconf {
136 struct nfs_fattr *fattr; /* Post-op attributes */
137 __u32 max_link; /* max # of hard links */
138 __u32 max_namelen; /* max name length */
139};
140
141struct nfs4_change_info {
142 u32 atomic;
143 u64 before;
144 u64 after;
145};
146
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700147struct nfs_seqid;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400148
Andy Adamson557134a2009-04-01 09:21:53 -0400149/* nfs41 sessions channel attributes */
150struct nfs4_channel_attrs {
151 u32 headerpadsz;
152 u32 max_rqst_sz;
153 u32 max_resp_sz;
154 u32 max_resp_sz_cached;
155 u32 max_ops;
156 u32 max_reqs;
157};
158
159/* nfs41 sessions slot seqid */
160struct nfs4_slot {
161 u32 seq_nr;
162};
163
Benny Halevy9ff71c32009-04-01 09:21:52 -0400164struct nfs4_sequence_args {
Benny Halevyf3752972009-04-01 09:22:04 -0400165 struct nfs4_session *sa_session;
Andy Adamsonfbcd4ab2009-04-01 09:22:15 -0400166 u8 sa_slotid;
167 u8 sa_cache_this;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400168};
169
170struct nfs4_sequence_res {
Benny Halevyf3752972009-04-01 09:22:04 -0400171 struct nfs4_session *sr_session;
Andy Adamson5f7dbd52009-04-01 09:22:05 -0400172 u8 sr_slotid; /* slot used to send request */
Andy Adamsonfbcd4ab2009-04-01 09:22:15 -0400173 int sr_status; /* sequence operation status */
Richard Kennedya01878a2009-12-03 15:58:56 -0500174 unsigned long sr_renewal_time;
Alexandros Batsakis0629e372009-12-05 13:46:14 -0500175 u32 sr_status_flags;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400176};
177
Andy Adamson2050f0c2009-04-01 09:22:30 -0400178struct nfs4_get_lease_time_args {
179 struct nfs4_sequence_args la_seq_args;
180};
181
182struct nfs4_get_lease_time_res {
183 struct nfs_fsinfo *lr_fsinfo;
184 struct nfs4_sequence_res lr_seq_res;
185};
186
Linus Torvalds1da177e2005-04-16 15:20:36 -0700187/*
188 * Arguments to the open call.
189 */
190struct nfs_openargs {
191 const struct nfs_fh * fh;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700192 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700193 int open_flags;
Trond Myklebustdc0b0272008-12-23 15:21:56 -0500194 fmode_t fmode;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700195 __u64 clientid;
Trond Myklebust9f958ab2007-07-02 13:58:33 -0400196 __u64 id;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700197 union {
198 struct iattr * attrs; /* UNCHECKED, GUARDED */
199 nfs4_verifier verifier; /* EXCLUSIVE */
200 nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */
Trond Myklebustbd7bf9d2008-12-23 15:21:53 -0500201 fmode_t delegation_type; /* CLAIM_PREVIOUS */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700202 } u;
203 const struct qstr * name;
204 const struct nfs_server *server; /* Needed for ID mapping */
205 const u32 * bitmask;
206 __u32 claim;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400207 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700208};
209
210struct nfs_openres {
211 nfs4_stateid stateid;
212 struct nfs_fh fh;
213 struct nfs4_change_info cinfo;
214 __u32 rflags;
215 struct nfs_fattr * f_attr;
Trond Myklebust56ae19f2005-10-27 22:12:40 -0400216 struct nfs_fattr * dir_attr;
Trond Myklebustc1d51932008-04-07 13:20:54 -0400217 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700218 const struct nfs_server *server;
Trond Myklebustbd7bf9d2008-12-23 15:21:53 -0500219 fmode_t delegation_type;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700220 nfs4_stateid delegation;
221 __u32 do_recall;
222 __u64 maxsize;
Jeff Laytonaa53ed52007-06-05 14:49:03 -0400223 __u32 attrset[NFS4_BITMAP_SIZE];
Benny Halevy9ff71c32009-04-01 09:21:52 -0400224 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700225};
226
227/*
228 * Arguments to the open_confirm call.
229 */
230struct nfs_open_confirmargs {
231 const struct nfs_fh * fh;
Trond Myklebustcdd4e682006-01-03 09:55:12 +0100232 nfs4_stateid * stateid;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700233 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700234};
235
236struct nfs_open_confirmres {
237 nfs4_stateid stateid;
Trond Myklebustc1d51932008-04-07 13:20:54 -0400238 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700239};
240
241/*
242 * Arguments to the close call.
243 */
244struct nfs_closeargs {
245 struct nfs_fh * fh;
Trond Myklebust95121352005-10-18 14:20:12 -0700246 nfs4_stateid * stateid;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700247 struct nfs_seqid * seqid;
Trond Myklebustdc0b0272008-12-23 15:21:56 -0500248 fmode_t fmode;
Trond Myklebust516a6af2005-10-27 22:12:41 -0400249 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400250 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700251};
252
253struct nfs_closeres {
254 nfs4_stateid stateid;
Trond Myklebust516a6af2005-10-27 22:12:41 -0400255 struct nfs_fattr * fattr;
Trond Myklebustc1d51932008-04-07 13:20:54 -0400256 struct nfs_seqid * seqid;
Trond Myklebust516a6af2005-10-27 22:12:41 -0400257 const struct nfs_server *server;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400258 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700259};
260/*
261 * * Arguments to the lock,lockt, and locku call.
262 * */
263struct nfs_lowner {
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100264 __u64 clientid;
Trond Myklebust9f958ab2007-07-02 13:58:33 -0400265 __u64 id;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700266};
267
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100268struct nfs_lock_args {
269 struct nfs_fh * fh;
270 struct file_lock * fl;
Trond Myklebust06735b32005-10-18 14:20:15 -0700271 struct nfs_seqid * lock_seqid;
272 nfs4_stateid * lock_stateid;
273 struct nfs_seqid * open_seqid;
274 nfs4_stateid * open_stateid;
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100275 struct nfs_lowner lock_owner;
276 unsigned char block : 1;
277 unsigned char reclaim : 1;
278 unsigned char new_lock_owner : 1;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400279 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700280};
281
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100282struct nfs_lock_res {
Trond Myklebustc1d51932008-04-07 13:20:54 -0400283 nfs4_stateid stateid;
284 struct nfs_seqid * lock_seqid;
285 struct nfs_seqid * open_seqid;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400286 struct nfs4_sequence_res seq_res;
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100287};
288
289struct nfs_locku_args {
290 struct nfs_fh * fh;
291 struct file_lock * fl;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700292 struct nfs_seqid * seqid;
Trond Myklebustfaf5f492005-10-18 14:20:15 -0700293 nfs4_stateid * stateid;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400294 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700295};
296
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100297struct nfs_locku_res {
Trond Myklebustc1d51932008-04-07 13:20:54 -0400298 nfs4_stateid stateid;
299 struct nfs_seqid * seqid;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400300 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700301};
302
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100303struct nfs_lockt_args {
304 struct nfs_fh * fh;
305 struct file_lock * fl;
306 struct nfs_lowner lock_owner;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400307 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700308};
309
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100310struct nfs_lockt_res {
311 struct file_lock * denied; /* LOCK, LOCKT failed */
Benny Halevy9ff71c32009-04-01 09:21:52 -0400312 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700313};
314
315struct nfs4_delegreturnargs {
316 const struct nfs_fh *fhandle;
317 const nfs4_stateid *stateid;
Trond Myklebustfa178f22006-01-03 09:55:38 +0100318 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400319 struct nfs4_sequence_args seq_args;
Trond Myklebustfa178f22006-01-03 09:55:38 +0100320};
321
322struct nfs4_delegreturnres {
323 struct nfs_fattr * fattr;
324 const struct nfs_server *server;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400325 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700326};
327
328/*
329 * Arguments to the read call.
330 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700331struct nfs_readargs {
332 struct nfs_fh * fh;
333 struct nfs_open_context *context;
334 __u64 offset;
335 __u32 count;
336 unsigned int pgbase;
337 struct page ** pages;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400338 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700339};
340
341struct nfs_readres {
342 struct nfs_fattr * fattr;
343 __u32 count;
344 int eof;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400345 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700346};
347
348/*
349 * Arguments to the write call.
350 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700351struct nfs_writeargs {
352 struct nfs_fh * fh;
353 struct nfs_open_context *context;
354 __u64 offset;
355 __u32 count;
356 enum nfs3_stable_how stable;
357 unsigned int pgbase;
358 struct page ** pages;
Trond Myklebust4f9838c2005-10-27 22:12:44 -0400359 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400360 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700361};
362
363struct nfs_writeverf {
364 enum nfs3_stable_how committed;
Al Virobc4785c2006-10-19 23:28:51 -0700365 __be32 verifier[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700366};
367
368struct nfs_writeres {
369 struct nfs_fattr * fattr;
370 struct nfs_writeverf * verf;
371 __u32 count;
Trond Myklebust4f9838c2005-10-27 22:12:44 -0400372 const struct nfs_server *server;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400373 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700374};
375
376/*
Trond Myklebust4fdc17b2007-07-14 15:39:57 -0400377 * Common arguments to the unlink call
378 */
379struct nfs_removeargs {
380 const struct nfs_fh *fh;
381 struct qstr name;
382 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400383 struct nfs4_sequence_args seq_args;
Trond Myklebust4fdc17b2007-07-14 15:39:57 -0400384};
385
386struct nfs_removeres {
387 const struct nfs_server *server;
388 struct nfs4_change_info cinfo;
389 struct nfs_fattr dir_attr;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400390 struct nfs4_sequence_res seq_res;
Trond Myklebust4fdc17b2007-07-14 15:39:57 -0400391};
392
393/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700394 * Argument struct for decode_entry function
395 */
396struct nfs_entry {
397 __u64 ino;
398 __u64 cookie,
399 prev_cookie;
400 const char * name;
401 unsigned int len;
402 int eof;
403 struct nfs_fh * fh;
404 struct nfs_fattr * fattr;
405};
406
407/*
408 * The following types are for NFSv2 only.
409 */
410struct nfs_sattrargs {
411 struct nfs_fh * fh;
412 struct iattr * sattr;
413};
414
415struct nfs_diropargs {
416 struct nfs_fh * fh;
417 const char * name;
418 unsigned int len;
419};
420
421struct nfs_createargs {
422 struct nfs_fh * fh;
423 const char * name;
424 unsigned int len;
425 struct iattr * sattr;
426};
427
428struct nfs_renameargs {
429 struct nfs_fh * fromfh;
430 const char * fromname;
431 unsigned int fromlen;
432 struct nfs_fh * tofh;
433 const char * toname;
434 unsigned int tolen;
435};
436
437struct nfs_setattrargs {
438 struct nfs_fh * fh;
439 nfs4_stateid stateid;
440 struct iattr * iap;
441 const struct nfs_server * server; /* Needed for name mapping */
442 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400443 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700444};
445
J. Bruce Fields23ec6962005-06-22 17:16:22 +0000446struct nfs_setaclargs {
447 struct nfs_fh * fh;
448 size_t acl_len;
449 unsigned int acl_pgbase;
450 struct page ** acl_pages;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400451 struct nfs4_sequence_args seq_args;
J. Bruce Fields23ec6962005-06-22 17:16:22 +0000452};
453
Benny Halevy73c403a2009-04-01 09:22:01 -0400454struct nfs_setaclres {
455 struct nfs4_sequence_res seq_res;
456};
457
J. Bruce Fields029d1052005-06-22 17:16:22 +0000458struct nfs_getaclargs {
459 struct nfs_fh * fh;
460 size_t acl_len;
461 unsigned int acl_pgbase;
462 struct page ** acl_pages;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400463 struct nfs4_sequence_args seq_args;
J. Bruce Fields029d1052005-06-22 17:16:22 +0000464};
465
Benny Halevy663c79b2009-04-01 09:21:59 -0400466struct nfs_getaclres {
467 size_t acl_len;
468 struct nfs4_sequence_res seq_res;
469};
470
Linus Torvalds1da177e2005-04-16 15:20:36 -0700471struct nfs_setattrres {
472 struct nfs_fattr * fattr;
473 const struct nfs_server * server;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400474 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700475};
476
477struct nfs_linkargs {
478 struct nfs_fh * fromfh;
479 struct nfs_fh * tofh;
480 const char * toname;
481 unsigned int tolen;
482};
483
484struct nfs_symlinkargs {
485 struct nfs_fh * fromfh;
486 const char * fromname;
487 unsigned int fromlen;
Chuck Lever94a6d752006-08-22 20:06:23 -0400488 struct page ** pages;
489 unsigned int pathlen;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700490 struct iattr * sattr;
491};
492
493struct nfs_readdirargs {
494 struct nfs_fh * fh;
495 __u32 cookie;
496 unsigned int count;
497 struct page ** pages;
498};
499
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +0000500struct nfs3_getaclargs {
501 struct nfs_fh * fh;
502 int mask;
503 struct page ** pages;
504};
505
506struct nfs3_setaclargs {
507 struct inode * inode;
508 int mask;
509 struct posix_acl * acl_access;
510 struct posix_acl * acl_default;
Trond Myklebustae461412009-03-10 20:33:18 -0400511 size_t len;
512 unsigned int npages;
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +0000513 struct page ** pages;
514};
515
Linus Torvalds1da177e2005-04-16 15:20:36 -0700516struct nfs_diropok {
517 struct nfs_fh * fh;
518 struct nfs_fattr * fattr;
519};
520
521struct nfs_readlinkargs {
522 struct nfs_fh * fh;
523 unsigned int pgbase;
524 unsigned int pglen;
525 struct page ** pages;
526};
527
528struct nfs3_sattrargs {
529 struct nfs_fh * fh;
530 struct iattr * sattr;
531 unsigned int guard;
532 struct timespec guardtime;
533};
534
535struct nfs3_diropargs {
536 struct nfs_fh * fh;
537 const char * name;
538 unsigned int len;
539};
540
541struct nfs3_accessargs {
542 struct nfs_fh * fh;
543 __u32 access;
544};
545
546struct nfs3_createargs {
547 struct nfs_fh * fh;
548 const char * name;
549 unsigned int len;
550 struct iattr * sattr;
551 enum nfs3_createmode createmode;
Al Virobc4785c2006-10-19 23:28:51 -0700552 __be32 verifier[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700553};
554
555struct nfs3_mkdirargs {
556 struct nfs_fh * fh;
557 const char * name;
558 unsigned int len;
559 struct iattr * sattr;
560};
561
562struct nfs3_symlinkargs {
563 struct nfs_fh * fromfh;
564 const char * fromname;
565 unsigned int fromlen;
Chuck Lever94a6d752006-08-22 20:06:23 -0400566 struct page ** pages;
567 unsigned int pathlen;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700568 struct iattr * sattr;
569};
570
571struct nfs3_mknodargs {
572 struct nfs_fh * fh;
573 const char * name;
574 unsigned int len;
575 enum nfs3_ftype type;
576 struct iattr * sattr;
577 dev_t rdev;
578};
579
580struct nfs3_renameargs {
581 struct nfs_fh * fromfh;
582 const char * fromname;
583 unsigned int fromlen;
584 struct nfs_fh * tofh;
585 const char * toname;
586 unsigned int tolen;
587};
588
589struct nfs3_linkargs {
590 struct nfs_fh * fromfh;
591 struct nfs_fh * tofh;
592 const char * toname;
593 unsigned int tolen;
594};
595
596struct nfs3_readdirargs {
597 struct nfs_fh * fh;
598 __u64 cookie;
Al Virobc4785c2006-10-19 23:28:51 -0700599 __be32 verf[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700600 int plus;
601 unsigned int count;
602 struct page ** pages;
603};
604
605struct nfs3_diropres {
606 struct nfs_fattr * dir_attr;
607 struct nfs_fh * fh;
608 struct nfs_fattr * fattr;
609};
610
611struct nfs3_accessres {
612 struct nfs_fattr * fattr;
613 __u32 access;
614};
615
616struct nfs3_readlinkargs {
617 struct nfs_fh * fh;
618 unsigned int pgbase;
619 unsigned int pglen;
620 struct page ** pages;
621};
622
623struct nfs3_renameres {
624 struct nfs_fattr * fromattr;
625 struct nfs_fattr * toattr;
626};
627
628struct nfs3_linkres {
629 struct nfs_fattr * dir_attr;
630 struct nfs_fattr * fattr;
631};
632
633struct nfs3_readdirres {
634 struct nfs_fattr * dir_attr;
Al Virobc4785c2006-10-19 23:28:51 -0700635 __be32 * verf;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700636 int plus;
637};
638
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +0000639struct nfs3_getaclres {
640 struct nfs_fattr * fattr;
641 int mask;
642 unsigned int acl_access_count;
643 unsigned int acl_default_count;
644 struct posix_acl * acl_access;
645 struct posix_acl * acl_default;
646};
647
Linus Torvalds1da177e2005-04-16 15:20:36 -0700648#ifdef CONFIG_NFS_V4
649
650typedef u64 clientid4;
651
652struct nfs4_accessargs {
653 const struct nfs_fh * fh;
Trond Myklebust76b32992007-08-10 17:45:11 -0400654 const u32 * bitmask;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700655 u32 access;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400656 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700657};
658
659struct nfs4_accessres {
Trond Myklebust76b32992007-08-10 17:45:11 -0400660 const struct nfs_server * server;
661 struct nfs_fattr * fattr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700662 u32 supported;
663 u32 access;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400664 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700665};
666
667struct nfs4_create_arg {
668 u32 ftype;
669 union {
Chuck Lever94a6d752006-08-22 20:06:23 -0400670 struct {
671 struct page ** pages;
672 unsigned int len;
673 } symlink; /* NF4LNK */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700674 struct {
675 u32 specdata1;
676 u32 specdata2;
677 } device; /* NF4BLK, NF4CHR */
678 } u;
679 const struct qstr * name;
680 const struct nfs_server * server;
681 const struct iattr * attrs;
682 const struct nfs_fh * dir_fh;
683 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400684 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700685};
686
687struct nfs4_create_res {
688 const struct nfs_server * server;
689 struct nfs_fh * fh;
690 struct nfs_fattr * fattr;
691 struct nfs4_change_info dir_cinfo;
Trond Myklebust56ae19f2005-10-27 22:12:40 -0400692 struct nfs_fattr * dir_fattr;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400693 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700694};
695
696struct nfs4_fsinfo_arg {
697 const struct nfs_fh * fh;
698 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400699 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700700};
701
Benny Halevy3dda5e42009-04-01 09:21:57 -0400702struct nfs4_fsinfo_res {
703 struct nfs_fsinfo *fsinfo;
704 struct nfs4_sequence_res seq_res;
705};
706
Linus Torvalds1da177e2005-04-16 15:20:36 -0700707struct nfs4_getattr_arg {
708 const struct nfs_fh * fh;
709 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400710 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700711};
712
713struct nfs4_getattr_res {
714 const struct nfs_server * server;
715 struct nfs_fattr * fattr;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400716 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700717};
718
719struct nfs4_link_arg {
720 const struct nfs_fh * fh;
721 const struct nfs_fh * dir_fh;
722 const struct qstr * name;
Trond Myklebust91ba2ee2005-10-27 22:12:42 -0400723 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400724 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700725};
726
Trond Myklebust91ba2ee2005-10-27 22:12:42 -0400727struct nfs4_link_res {
728 const struct nfs_server * server;
729 struct nfs_fattr * fattr;
730 struct nfs4_change_info cinfo;
731 struct nfs_fattr * dir_attr;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400732 struct nfs4_sequence_res seq_res;
Trond Myklebust91ba2ee2005-10-27 22:12:42 -0400733};
734
735
Linus Torvalds1da177e2005-04-16 15:20:36 -0700736struct nfs4_lookup_arg {
737 const struct nfs_fh * dir_fh;
738 const struct qstr * name;
739 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400740 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700741};
742
743struct nfs4_lookup_res {
744 const struct nfs_server * server;
745 struct nfs_fattr * fattr;
746 struct nfs_fh * fh;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400747 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700748};
749
750struct nfs4_lookup_root_arg {
751 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400752 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700753};
754
755struct nfs4_pathconf_arg {
756 const struct nfs_fh * fh;
757 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400758 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700759};
760
Benny Halevyd45b2982009-04-01 09:21:58 -0400761struct nfs4_pathconf_res {
762 struct nfs_pathconf *pathconf;
763 struct nfs4_sequence_res seq_res;
764};
765
Linus Torvalds1da177e2005-04-16 15:20:36 -0700766struct nfs4_readdir_arg {
767 const struct nfs_fh * fh;
768 u64 cookie;
769 nfs4_verifier verifier;
770 u32 count;
771 struct page ** pages; /* zero-copy data */
772 unsigned int pgbase; /* zero-copy data */
773 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400774 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700775};
776
777struct nfs4_readdir_res {
778 nfs4_verifier verifier;
779 unsigned int pgbase;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400780 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700781};
782
783struct nfs4_readlink {
784 const struct nfs_fh * fh;
785 unsigned int pgbase;
786 unsigned int pglen; /* zero-copy data */
787 struct page ** pages; /* zero-copy data */
Benny Halevy9ff71c32009-04-01 09:21:52 -0400788 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700789};
790
Benny Halevyf50c7002009-04-01 09:21:55 -0400791struct nfs4_readlink_res {
792 struct nfs4_sequence_res seq_res;
793};
794
Linus Torvalds1da177e2005-04-16 15:20:36 -0700795struct nfs4_rename_arg {
796 const struct nfs_fh * old_dir;
797 const struct nfs_fh * new_dir;
798 const struct qstr * old_name;
799 const struct qstr * new_name;
Trond Myklebust6caf2c82005-10-27 22:12:43 -0400800 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400801 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700802};
803
804struct nfs4_rename_res {
Trond Myklebust6caf2c82005-10-27 22:12:43 -0400805 const struct nfs_server * server;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700806 struct nfs4_change_info old_cinfo;
Trond Myklebust6caf2c82005-10-27 22:12:43 -0400807 struct nfs_fattr * old_fattr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700808 struct nfs4_change_info new_cinfo;
Trond Myklebust6caf2c82005-10-27 22:12:43 -0400809 struct nfs_fattr * new_fattr;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400810 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700811};
812
Trond Myklebust19d771f2008-10-08 13:54:52 -0400813#define NFS4_SETCLIENTID_NAMELEN (127)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700814struct nfs4_setclientid {
Chuck Levercc38bac2007-12-10 14:56:54 -0500815 const nfs4_verifier * sc_verifier;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700816 unsigned int sc_name_len;
Chuck Leverd1ce02e2008-09-25 11:57:12 -0400817 char sc_name[NFS4_SETCLIENTID_NAMELEN + 1];
Chuck Levercc38bac2007-12-10 14:56:54 -0500818 u32 sc_prog;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700819 unsigned int sc_netid_len;
Chuck Leverd1ce02e2008-09-25 11:57:12 -0400820 char sc_netid[RPCBIND_MAXNETIDLEN + 1];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700821 unsigned int sc_uaddr_len;
Chuck Leverd1ce02e2008-09-25 11:57:12 -0400822 char sc_uaddr[RPCBIND_MAXUADDRLEN + 1];
Chuck Levercc38bac2007-12-10 14:56:54 -0500823 u32 sc_cb_ident;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700824};
825
826struct nfs4_statfs_arg {
827 const struct nfs_fh * fh;
828 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400829 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700830};
831
Benny Halevy24ad1482009-04-01 09:21:56 -0400832struct nfs4_statfs_res {
833 struct nfs_fsstat *fsstat;
834 struct nfs4_sequence_res seq_res;
835};
836
Benny Halevy43652ad2009-04-01 09:21:54 -0400837struct nfs4_server_caps_arg {
838 struct nfs_fh *fhandle;
839 struct nfs4_sequence_args seq_args;
840};
841
Linus Torvalds1da177e2005-04-16 15:20:36 -0700842struct nfs4_server_caps_res {
843 u32 attr_bitmask[2];
844 u32 acl_bitmask;
845 u32 has_links;
846 u32 has_symlinks;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400847 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700848};
849
Manoj Naik7aaa0b32006-06-09 09:34:23 -0400850struct nfs4_string {
851 unsigned int len;
852 char *data;
Trond Myklebust683b57b2006-06-09 09:34:22 -0400853};
854
Manoj Naik7aaa0b32006-06-09 09:34:23 -0400855#define NFS4_PATHNAME_MAXCOMPONENTS 512
856struct nfs4_pathname {
857 unsigned int ncomponents;
858 struct nfs4_string components[NFS4_PATHNAME_MAXCOMPONENTS];
859};
860
861#define NFS4_FS_LOCATION_MAXSERVERS 10
862struct nfs4_fs_location {
863 unsigned int nservers;
864 struct nfs4_string servers[NFS4_FS_LOCATION_MAXSERVERS];
865 struct nfs4_pathname rootpath;
866};
867
868#define NFS4_FS_LOCATIONS_MAXENTRIES 10
869struct nfs4_fs_locations {
Trond Myklebust683b57b2006-06-09 09:34:22 -0400870 struct nfs_fattr fattr;
871 const struct nfs_server *server;
Manoj Naik7aaa0b32006-06-09 09:34:23 -0400872 struct nfs4_pathname fs_path;
Trond Myklebust683b57b2006-06-09 09:34:22 -0400873 int nlocations;
Manoj Naik7aaa0b32006-06-09 09:34:23 -0400874 struct nfs4_fs_location locations[NFS4_FS_LOCATIONS_MAXENTRIES];
Trond Myklebust683b57b2006-06-09 09:34:22 -0400875};
876
877struct nfs4_fs_locations_arg {
878 const struct nfs_fh *dir_fh;
879 const struct qstr *name;
880 struct page *page;
881 const u32 *bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400882 struct nfs4_sequence_args seq_args;
Trond Myklebust683b57b2006-06-09 09:34:22 -0400883};
884
Benny Halevy22958462009-04-01 09:22:02 -0400885struct nfs4_fs_locations_res {
886 struct nfs4_fs_locations *fs_locations;
887 struct nfs4_sequence_res seq_res;
888};
889
Linus Torvalds1da177e2005-04-16 15:20:36 -0700890#endif /* CONFIG_NFS_V4 */
891
Benny Halevy99fe60d2009-04-01 09:22:29 -0400892struct nfstime4 {
893 u64 seconds;
894 u32 nseconds;
895};
896
897#ifdef CONFIG_NFS_V4_1
898struct nfs_impl_id4 {
899 u32 domain_len;
900 char *domain;
901 u32 name_len;
902 char *name;
903 struct nfstime4 date;
904};
905
906#define NFS4_EXCHANGE_ID_LEN (48)
907struct nfs41_exchange_id_args {
908 struct nfs_client *client;
909 nfs4_verifier *verifier;
910 unsigned int id_len;
911 char id[NFS4_EXCHANGE_ID_LEN];
912 u32 flags;
913};
914
915struct server_owner {
916 uint64_t minor_id;
917 uint32_t major_id_sz;
918 char major_id[NFS4_OPAQUE_LIMIT];
919};
920
921struct server_scope {
922 uint32_t server_scope_sz;
923 char server_scope[NFS4_OPAQUE_LIMIT];
924};
925
926struct nfs41_exchange_id_res {
927 struct nfs_client *client;
928 u32 flags;
929};
Andy Adamsonfc931582009-04-01 09:22:31 -0400930
931struct nfs41_create_session_args {
932 struct nfs_client *client;
933 uint32_t flags;
934 uint32_t cb_program;
935 struct nfs4_channel_attrs fc_attrs; /* Fore Channel */
936 struct nfs4_channel_attrs bc_attrs; /* Back Channel */
937};
938
939struct nfs41_create_session_res {
940 struct nfs_client *client;
941};
Ricardo Labiaga180197532009-12-05 16:08:40 -0500942
943struct nfs41_reclaim_complete_args {
944 /* In the future extend to include curr_fh for use with migration */
945 unsigned char one_fs:1;
946 struct nfs4_sequence_args seq_args;
947};
948
949struct nfs41_reclaim_complete_res {
950 struct nfs4_sequence_res seq_res;
951};
Benny Halevy99fe60d2009-04-01 09:22:29 -0400952#endif /* CONFIG_NFS_V4_1 */
953
Linus Torvalds1da177e2005-04-16 15:20:36 -0700954struct nfs_page;
955
Chuck Lever40859d72005-11-30 18:09:02 -0500956#define NFS_PAGEVEC_SIZE (8U)
957
Linus Torvalds1da177e2005-04-16 15:20:36 -0700958struct nfs_read_data {
959 int flags;
960 struct rpc_task task;
961 struct inode *inode;
962 struct rpc_cred *cred;
963 struct nfs_fattr fattr; /* fattr storage */
964 struct list_head pages; /* Coalesced read requests */
965 struct nfs_page *req; /* multi ops per nfs_page */
Chuck Lever40859d72005-11-30 18:09:02 -0500966 struct page **pagevec;
Trond Myklebuste9f7bee2006-09-08 09:48:54 -0700967 unsigned int npages; /* Max length of pagevec */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700968 struct nfs_readargs args;
969 struct nfs_readres res;
970#ifdef CONFIG_NFS_V4
971 unsigned long timestamp; /* For lease renewal */
972#endif
Chuck Lever0d0b5cb2006-05-25 01:40:53 -0400973 struct page *page_array[NFS_PAGEVEC_SIZE];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700974};
975
976struct nfs_write_data {
977 int flags;
978 struct rpc_task task;
979 struct inode *inode;
980 struct rpc_cred *cred;
981 struct nfs_fattr fattr;
982 struct nfs_writeverf verf;
983 struct list_head pages; /* Coalesced requests we wish to flush */
984 struct nfs_page *req; /* multi ops per nfs_page */
Chuck Lever40859d72005-11-30 18:09:02 -0500985 struct page **pagevec;
Trond Myklebuste9f7bee2006-09-08 09:48:54 -0700986 unsigned int npages; /* Max length of pagevec */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700987 struct nfs_writeargs args; /* argument struct */
988 struct nfs_writeres res; /* result struct */
989#ifdef CONFIG_NFS_V4
990 unsigned long timestamp; /* For lease renewal */
991#endif
Chuck Lever0d0b5cb2006-05-25 01:40:53 -0400992 struct page *page_array[NFS_PAGEVEC_SIZE];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700993};
994
995struct nfs_access_entry;
996
997/*
998 * RPC procedure vector for NFSv2/NFSv3 demuxing
999 */
1000struct nfs_rpc_ops {
Chuck Leverc0e07cb2008-01-14 12:32:05 -05001001 u32 version; /* Protocol version */
Al Virof786aa92009-02-20 05:51:22 +00001002 const struct dentry_operations *dentry_ops;
Arjan van de Venc5ef1c42007-02-12 00:55:40 -08001003 const struct inode_operations *dir_inode_ops;
1004 const struct inode_operations *file_inode_ops;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001005
1006 int (*getroot) (struct nfs_server *, struct nfs_fh *,
1007 struct nfs_fsinfo *);
David Howells2b3de442006-08-22 20:06:09 -04001008 int (*lookupfh)(struct nfs_server *, struct nfs_fh *,
1009 struct qstr *, struct nfs_fh *,
1010 struct nfs_fattr *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001011 int (*getattr) (struct nfs_server *, struct nfs_fh *,
1012 struct nfs_fattr *);
1013 int (*setattr) (struct dentry *, struct nfs_fattr *,
1014 struct iattr *);
1015 int (*lookup) (struct inode *, struct qstr *,
1016 struct nfs_fh *, struct nfs_fattr *);
1017 int (*access) (struct inode *, struct nfs_access_entry *);
1018 int (*readlink)(struct inode *, struct page *, unsigned int,
1019 unsigned int);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001020 int (*create) (struct inode *, struct dentry *,
Trond Myklebust02a913a2005-10-18 14:20:17 -07001021 struct iattr *, int, struct nameidata *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001022 int (*remove) (struct inode *, struct qstr *);
Trond Myklebuste4eff1a2007-07-14 15:39:58 -04001023 void (*unlink_setup) (struct rpc_message *, struct inode *dir);
1024 int (*unlink_done) (struct rpc_task *, struct inode *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001025 int (*rename) (struct inode *, struct qstr *,
1026 struct inode *, struct qstr *);
1027 int (*link) (struct inode *, struct inode *, struct qstr *);
Chuck Lever94a6d752006-08-22 20:06:23 -04001028 int (*symlink) (struct inode *, struct dentry *, struct page *,
1029 unsigned int, struct iattr *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001030 int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
1031 int (*rmdir) (struct inode *, struct qstr *);
1032 int (*readdir) (struct dentry *, struct rpc_cred *,
1033 u64, struct page *, unsigned int, int);
1034 int (*mknod) (struct inode *, struct dentry *, struct iattr *,
1035 dev_t);
1036 int (*statfs) (struct nfs_server *, struct nfs_fh *,
1037 struct nfs_fsstat *);
1038 int (*fsinfo) (struct nfs_server *, struct nfs_fh *,
1039 struct nfs_fsinfo *);
1040 int (*pathconf) (struct nfs_server *, struct nfs_fh *,
1041 struct nfs_pathconf *);
David Howellse9326dc2006-08-22 20:06:10 -04001042 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
Al Viro0dbb4c62006-10-19 23:28:49 -07001043 __be32 *(*decode_dirent)(__be32 *, struct nfs_entry *, int plus);
Trond Myklebustbdc7f022007-07-14 15:40:00 -04001044 void (*read_setup) (struct nfs_read_data *, struct rpc_message *);
Trond Myklebustec06c092006-03-20 13:44:27 -05001045 int (*read_done) (struct rpc_task *, struct nfs_read_data *);
Trond Myklebustbdc7f022007-07-14 15:40:00 -04001046 void (*write_setup) (struct nfs_write_data *, struct rpc_message *);
Trond Myklebust788e7a82006-03-20 13:44:27 -05001047 int (*write_done) (struct rpc_task *, struct nfs_write_data *);
Trond Myklebustbdc7f022007-07-14 15:40:00 -04001048 void (*commit_setup) (struct nfs_write_data *, struct rpc_message *);
Trond Myklebust788e7a82006-03-20 13:44:27 -05001049 int (*commit_done) (struct rpc_task *, struct nfs_write_data *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001050 int (*lock)(struct file *, int, struct file_lock *);
Trond Myklebust21162712008-05-20 19:34:39 -04001051 int (*lock_check_bounds)(const struct file_lock *);
Trond Myklebustada70d92005-06-22 17:16:22 +00001052 void (*clear_acl_cache)(struct inode *);
Trond Myklebust7fe5c392009-03-19 15:35:50 -04001053 void (*close_context)(struct nfs_open_context *ctx, int);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001054};
1055
1056/*
1057 * NFS_CALL(getattr, inode, (fattr));
1058 * into
1059 * NFS_PROTO(inode)->getattr(fattr);
1060 */
1061#define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args
1062
1063/*
1064 * Function vectors etc. for the NFS client
1065 */
David Howells509de812006-08-22 20:06:11 -04001066extern const struct nfs_rpc_ops nfs_v2_clientops;
1067extern const struct nfs_rpc_ops nfs_v3_clientops;
1068extern const struct nfs_rpc_ops nfs_v4_clientops;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001069extern struct rpc_version nfs_version2;
1070extern struct rpc_version nfs_version3;
1071extern struct rpc_version nfs_version4;
1072
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +00001073extern struct rpc_version nfsacl_version3;
1074extern struct rpc_program nfsacl_program;
1075
Linus Torvalds1da177e2005-04-16 15:20:36 -07001076#endif