blob: 5d70b924af5e8c07218b7610266a92122557fa7a [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 unsigned long sr_renewal_time;
174 int sr_status; /* sequence operation status */
Benny Halevy9ff71c32009-04-01 09:21:52 -0400175};
176
Linus Torvalds1da177e2005-04-16 15:20:36 -0700177/*
178 * Arguments to the open call.
179 */
180struct nfs_openargs {
181 const struct nfs_fh * fh;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700182 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700183 int open_flags;
Trond Myklebustdc0b0272008-12-23 15:21:56 -0500184 fmode_t fmode;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700185 __u64 clientid;
Trond Myklebust9f958ab2007-07-02 13:58:33 -0400186 __u64 id;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700187 union {
188 struct iattr * attrs; /* UNCHECKED, GUARDED */
189 nfs4_verifier verifier; /* EXCLUSIVE */
190 nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */
Trond Myklebustbd7bf9d2008-12-23 15:21:53 -0500191 fmode_t delegation_type; /* CLAIM_PREVIOUS */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700192 } u;
193 const struct qstr * name;
194 const struct nfs_server *server; /* Needed for ID mapping */
195 const u32 * bitmask;
196 __u32 claim;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400197 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700198};
199
200struct nfs_openres {
201 nfs4_stateid stateid;
202 struct nfs_fh fh;
203 struct nfs4_change_info cinfo;
204 __u32 rflags;
205 struct nfs_fattr * f_attr;
Trond Myklebust56ae19f2005-10-27 22:12:40 -0400206 struct nfs_fattr * dir_attr;
Trond Myklebustc1d51932008-04-07 13:20:54 -0400207 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700208 const struct nfs_server *server;
Trond Myklebustbd7bf9d2008-12-23 15:21:53 -0500209 fmode_t delegation_type;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700210 nfs4_stateid delegation;
211 __u32 do_recall;
212 __u64 maxsize;
Jeff Laytonaa53ed52007-06-05 14:49:03 -0400213 __u32 attrset[NFS4_BITMAP_SIZE];
Benny Halevy9ff71c32009-04-01 09:21:52 -0400214 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700215};
216
217/*
218 * Arguments to the open_confirm call.
219 */
220struct nfs_open_confirmargs {
221 const struct nfs_fh * fh;
Trond Myklebustcdd4e682006-01-03 09:55:12 +0100222 nfs4_stateid * stateid;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700223 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700224};
225
226struct nfs_open_confirmres {
227 nfs4_stateid stateid;
Trond Myklebustc1d51932008-04-07 13:20:54 -0400228 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700229};
230
231/*
232 * Arguments to the close call.
233 */
234struct nfs_closeargs {
235 struct nfs_fh * fh;
Trond Myklebust95121352005-10-18 14:20:12 -0700236 nfs4_stateid * stateid;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700237 struct nfs_seqid * seqid;
Trond Myklebustdc0b0272008-12-23 15:21:56 -0500238 fmode_t fmode;
Trond Myklebust516a6af2005-10-27 22:12:41 -0400239 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400240 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700241};
242
243struct nfs_closeres {
244 nfs4_stateid stateid;
Trond Myklebust516a6af2005-10-27 22:12:41 -0400245 struct nfs_fattr * fattr;
Trond Myklebustc1d51932008-04-07 13:20:54 -0400246 struct nfs_seqid * seqid;
Trond Myklebust516a6af2005-10-27 22:12:41 -0400247 const struct nfs_server *server;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400248 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700249};
250/*
251 * * Arguments to the lock,lockt, and locku call.
252 * */
253struct nfs_lowner {
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100254 __u64 clientid;
Trond Myklebust9f958ab2007-07-02 13:58:33 -0400255 __u64 id;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700256};
257
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100258struct nfs_lock_args {
259 struct nfs_fh * fh;
260 struct file_lock * fl;
Trond Myklebust06735b32005-10-18 14:20:15 -0700261 struct nfs_seqid * lock_seqid;
262 nfs4_stateid * lock_stateid;
263 struct nfs_seqid * open_seqid;
264 nfs4_stateid * open_stateid;
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100265 struct nfs_lowner lock_owner;
266 unsigned char block : 1;
267 unsigned char reclaim : 1;
268 unsigned char new_lock_owner : 1;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400269 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700270};
271
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100272struct nfs_lock_res {
Trond Myklebustc1d51932008-04-07 13:20:54 -0400273 nfs4_stateid stateid;
274 struct nfs_seqid * lock_seqid;
275 struct nfs_seqid * open_seqid;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400276 struct nfs4_sequence_res seq_res;
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100277};
278
279struct nfs_locku_args {
280 struct nfs_fh * fh;
281 struct file_lock * fl;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700282 struct nfs_seqid * seqid;
Trond Myklebustfaf5f492005-10-18 14:20:15 -0700283 nfs4_stateid * stateid;
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_locku_res {
Trond Myklebustc1d51932008-04-07 13:20:54 -0400288 nfs4_stateid stateid;
289 struct nfs_seqid * seqid;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400290 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700291};
292
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100293struct nfs_lockt_args {
294 struct nfs_fh * fh;
295 struct file_lock * fl;
296 struct nfs_lowner lock_owner;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400297 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700298};
299
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100300struct nfs_lockt_res {
301 struct file_lock * denied; /* LOCK, LOCKT failed */
Benny Halevy9ff71c32009-04-01 09:21:52 -0400302 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700303};
304
305struct nfs4_delegreturnargs {
306 const struct nfs_fh *fhandle;
307 const nfs4_stateid *stateid;
Trond Myklebustfa178f22006-01-03 09:55:38 +0100308 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400309 struct nfs4_sequence_args seq_args;
Trond Myklebustfa178f22006-01-03 09:55:38 +0100310};
311
312struct nfs4_delegreturnres {
313 struct nfs_fattr * fattr;
314 const struct nfs_server *server;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400315 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700316};
317
318/*
319 * Arguments to the read call.
320 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700321struct nfs_readargs {
322 struct nfs_fh * fh;
323 struct nfs_open_context *context;
324 __u64 offset;
325 __u32 count;
326 unsigned int pgbase;
327 struct page ** pages;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400328 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700329};
330
331struct nfs_readres {
332 struct nfs_fattr * fattr;
333 __u32 count;
334 int eof;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400335 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700336};
337
338/*
339 * Arguments to the write call.
340 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700341struct nfs_writeargs {
342 struct nfs_fh * fh;
343 struct nfs_open_context *context;
344 __u64 offset;
345 __u32 count;
346 enum nfs3_stable_how stable;
347 unsigned int pgbase;
348 struct page ** pages;
Trond Myklebust4f9838c2005-10-27 22:12:44 -0400349 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400350 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700351};
352
353struct nfs_writeverf {
354 enum nfs3_stable_how committed;
Al Virobc4785c2006-10-19 23:28:51 -0700355 __be32 verifier[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700356};
357
358struct nfs_writeres {
359 struct nfs_fattr * fattr;
360 struct nfs_writeverf * verf;
361 __u32 count;
Trond Myklebust4f9838c2005-10-27 22:12:44 -0400362 const struct nfs_server *server;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400363 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700364};
365
366/*
Trond Myklebust4fdc17b2007-07-14 15:39:57 -0400367 * Common arguments to the unlink call
368 */
369struct nfs_removeargs {
370 const struct nfs_fh *fh;
371 struct qstr name;
372 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400373 struct nfs4_sequence_args seq_args;
Trond Myklebust4fdc17b2007-07-14 15:39:57 -0400374};
375
376struct nfs_removeres {
377 const struct nfs_server *server;
378 struct nfs4_change_info cinfo;
379 struct nfs_fattr dir_attr;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400380 struct nfs4_sequence_res seq_res;
Trond Myklebust4fdc17b2007-07-14 15:39:57 -0400381};
382
383/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700384 * Argument struct for decode_entry function
385 */
386struct nfs_entry {
387 __u64 ino;
388 __u64 cookie,
389 prev_cookie;
390 const char * name;
391 unsigned int len;
392 int eof;
393 struct nfs_fh * fh;
394 struct nfs_fattr * fattr;
395};
396
397/*
398 * The following types are for NFSv2 only.
399 */
400struct nfs_sattrargs {
401 struct nfs_fh * fh;
402 struct iattr * sattr;
403};
404
405struct nfs_diropargs {
406 struct nfs_fh * fh;
407 const char * name;
408 unsigned int len;
409};
410
411struct nfs_createargs {
412 struct nfs_fh * fh;
413 const char * name;
414 unsigned int len;
415 struct iattr * sattr;
416};
417
418struct nfs_renameargs {
419 struct nfs_fh * fromfh;
420 const char * fromname;
421 unsigned int fromlen;
422 struct nfs_fh * tofh;
423 const char * toname;
424 unsigned int tolen;
425};
426
427struct nfs_setattrargs {
428 struct nfs_fh * fh;
429 nfs4_stateid stateid;
430 struct iattr * iap;
431 const struct nfs_server * server; /* Needed for name mapping */
432 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400433 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700434};
435
J. Bruce Fields23ec6962005-06-22 17:16:22 +0000436struct nfs_setaclargs {
437 struct nfs_fh * fh;
438 size_t acl_len;
439 unsigned int acl_pgbase;
440 struct page ** acl_pages;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400441 struct nfs4_sequence_args seq_args;
J. Bruce Fields23ec6962005-06-22 17:16:22 +0000442};
443
Benny Halevy73c403a2009-04-01 09:22:01 -0400444struct nfs_setaclres {
445 struct nfs4_sequence_res seq_res;
446};
447
J. Bruce Fields029d1052005-06-22 17:16:22 +0000448struct nfs_getaclargs {
449 struct nfs_fh * fh;
450 size_t acl_len;
451 unsigned int acl_pgbase;
452 struct page ** acl_pages;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400453 struct nfs4_sequence_args seq_args;
J. Bruce Fields029d1052005-06-22 17:16:22 +0000454};
455
Benny Halevy663c79b2009-04-01 09:21:59 -0400456struct nfs_getaclres {
457 size_t acl_len;
458 struct nfs4_sequence_res seq_res;
459};
460
Linus Torvalds1da177e2005-04-16 15:20:36 -0700461struct nfs_setattrres {
462 struct nfs_fattr * fattr;
463 const struct nfs_server * server;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400464 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700465};
466
467struct nfs_linkargs {
468 struct nfs_fh * fromfh;
469 struct nfs_fh * tofh;
470 const char * toname;
471 unsigned int tolen;
472};
473
474struct nfs_symlinkargs {
475 struct nfs_fh * fromfh;
476 const char * fromname;
477 unsigned int fromlen;
Chuck Lever94a6d752006-08-22 20:06:23 -0400478 struct page ** pages;
479 unsigned int pathlen;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700480 struct iattr * sattr;
481};
482
483struct nfs_readdirargs {
484 struct nfs_fh * fh;
485 __u32 cookie;
486 unsigned int count;
487 struct page ** pages;
488};
489
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +0000490struct nfs3_getaclargs {
491 struct nfs_fh * fh;
492 int mask;
493 struct page ** pages;
494};
495
496struct nfs3_setaclargs {
497 struct inode * inode;
498 int mask;
499 struct posix_acl * acl_access;
500 struct posix_acl * acl_default;
Trond Myklebustae46141f2009-03-10 20:33:18 -0400501 size_t len;
502 unsigned int npages;
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +0000503 struct page ** pages;
504};
505
Linus Torvalds1da177e2005-04-16 15:20:36 -0700506struct nfs_diropok {
507 struct nfs_fh * fh;
508 struct nfs_fattr * fattr;
509};
510
511struct nfs_readlinkargs {
512 struct nfs_fh * fh;
513 unsigned int pgbase;
514 unsigned int pglen;
515 struct page ** pages;
516};
517
518struct nfs3_sattrargs {
519 struct nfs_fh * fh;
520 struct iattr * sattr;
521 unsigned int guard;
522 struct timespec guardtime;
523};
524
525struct nfs3_diropargs {
526 struct nfs_fh * fh;
527 const char * name;
528 unsigned int len;
529};
530
531struct nfs3_accessargs {
532 struct nfs_fh * fh;
533 __u32 access;
534};
535
536struct nfs3_createargs {
537 struct nfs_fh * fh;
538 const char * name;
539 unsigned int len;
540 struct iattr * sattr;
541 enum nfs3_createmode createmode;
Al Virobc4785c2006-10-19 23:28:51 -0700542 __be32 verifier[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700543};
544
545struct nfs3_mkdirargs {
546 struct nfs_fh * fh;
547 const char * name;
548 unsigned int len;
549 struct iattr * sattr;
550};
551
552struct nfs3_symlinkargs {
553 struct nfs_fh * fromfh;
554 const char * fromname;
555 unsigned int fromlen;
Chuck Lever94a6d752006-08-22 20:06:23 -0400556 struct page ** pages;
557 unsigned int pathlen;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700558 struct iattr * sattr;
559};
560
561struct nfs3_mknodargs {
562 struct nfs_fh * fh;
563 const char * name;
564 unsigned int len;
565 enum nfs3_ftype type;
566 struct iattr * sattr;
567 dev_t rdev;
568};
569
570struct nfs3_renameargs {
571 struct nfs_fh * fromfh;
572 const char * fromname;
573 unsigned int fromlen;
574 struct nfs_fh * tofh;
575 const char * toname;
576 unsigned int tolen;
577};
578
579struct nfs3_linkargs {
580 struct nfs_fh * fromfh;
581 struct nfs_fh * tofh;
582 const char * toname;
583 unsigned int tolen;
584};
585
586struct nfs3_readdirargs {
587 struct nfs_fh * fh;
588 __u64 cookie;
Al Virobc4785c2006-10-19 23:28:51 -0700589 __be32 verf[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700590 int plus;
591 unsigned int count;
592 struct page ** pages;
593};
594
595struct nfs3_diropres {
596 struct nfs_fattr * dir_attr;
597 struct nfs_fh * fh;
598 struct nfs_fattr * fattr;
599};
600
601struct nfs3_accessres {
602 struct nfs_fattr * fattr;
603 __u32 access;
604};
605
606struct nfs3_readlinkargs {
607 struct nfs_fh * fh;
608 unsigned int pgbase;
609 unsigned int pglen;
610 struct page ** pages;
611};
612
613struct nfs3_renameres {
614 struct nfs_fattr * fromattr;
615 struct nfs_fattr * toattr;
616};
617
618struct nfs3_linkres {
619 struct nfs_fattr * dir_attr;
620 struct nfs_fattr * fattr;
621};
622
623struct nfs3_readdirres {
624 struct nfs_fattr * dir_attr;
Al Virobc4785c2006-10-19 23:28:51 -0700625 __be32 * verf;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700626 int plus;
627};
628
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +0000629struct nfs3_getaclres {
630 struct nfs_fattr * fattr;
631 int mask;
632 unsigned int acl_access_count;
633 unsigned int acl_default_count;
634 struct posix_acl * acl_access;
635 struct posix_acl * acl_default;
636};
637
Linus Torvalds1da177e2005-04-16 15:20:36 -0700638#ifdef CONFIG_NFS_V4
639
640typedef u64 clientid4;
641
642struct nfs4_accessargs {
643 const struct nfs_fh * fh;
Trond Myklebust76b32992007-08-10 17:45:11 -0400644 const u32 * bitmask;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700645 u32 access;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400646 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700647};
648
649struct nfs4_accessres {
Trond Myklebust76b32992007-08-10 17:45:11 -0400650 const struct nfs_server * server;
651 struct nfs_fattr * fattr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700652 u32 supported;
653 u32 access;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400654 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700655};
656
657struct nfs4_create_arg {
658 u32 ftype;
659 union {
Chuck Lever94a6d752006-08-22 20:06:23 -0400660 struct {
661 struct page ** pages;
662 unsigned int len;
663 } symlink; /* NF4LNK */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700664 struct {
665 u32 specdata1;
666 u32 specdata2;
667 } device; /* NF4BLK, NF4CHR */
668 } u;
669 const struct qstr * name;
670 const struct nfs_server * server;
671 const struct iattr * attrs;
672 const struct nfs_fh * dir_fh;
673 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400674 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700675};
676
677struct nfs4_create_res {
678 const struct nfs_server * server;
679 struct nfs_fh * fh;
680 struct nfs_fattr * fattr;
681 struct nfs4_change_info dir_cinfo;
Trond Myklebust56ae19f2005-10-27 22:12:40 -0400682 struct nfs_fattr * dir_fattr;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400683 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700684};
685
686struct nfs4_fsinfo_arg {
687 const struct nfs_fh * fh;
688 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400689 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700690};
691
Benny Halevy3dda5e42009-04-01 09:21:57 -0400692struct nfs4_fsinfo_res {
693 struct nfs_fsinfo *fsinfo;
694 struct nfs4_sequence_res seq_res;
695};
696
Linus Torvalds1da177e2005-04-16 15:20:36 -0700697struct nfs4_getattr_arg {
698 const struct nfs_fh * fh;
699 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400700 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700701};
702
703struct nfs4_getattr_res {
704 const struct nfs_server * server;
705 struct nfs_fattr * fattr;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400706 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700707};
708
709struct nfs4_link_arg {
710 const struct nfs_fh * fh;
711 const struct nfs_fh * dir_fh;
712 const struct qstr * name;
Trond Myklebust91ba2ee2005-10-27 22:12:42 -0400713 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400714 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700715};
716
Trond Myklebust91ba2ee2005-10-27 22:12:42 -0400717struct nfs4_link_res {
718 const struct nfs_server * server;
719 struct nfs_fattr * fattr;
720 struct nfs4_change_info cinfo;
721 struct nfs_fattr * dir_attr;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400722 struct nfs4_sequence_res seq_res;
Trond Myklebust91ba2ee2005-10-27 22:12:42 -0400723};
724
725
Linus Torvalds1da177e2005-04-16 15:20:36 -0700726struct nfs4_lookup_arg {
727 const struct nfs_fh * dir_fh;
728 const struct qstr * name;
729 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400730 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700731};
732
733struct nfs4_lookup_res {
734 const struct nfs_server * server;
735 struct nfs_fattr * fattr;
736 struct nfs_fh * fh;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400737 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700738};
739
740struct nfs4_lookup_root_arg {
741 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400742 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700743};
744
745struct nfs4_pathconf_arg {
746 const struct nfs_fh * fh;
747 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400748 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700749};
750
Benny Halevyd45b2982009-04-01 09:21:58 -0400751struct nfs4_pathconf_res {
752 struct nfs_pathconf *pathconf;
753 struct nfs4_sequence_res seq_res;
754};
755
Linus Torvalds1da177e2005-04-16 15:20:36 -0700756struct nfs4_readdir_arg {
757 const struct nfs_fh * fh;
758 u64 cookie;
759 nfs4_verifier verifier;
760 u32 count;
761 struct page ** pages; /* zero-copy data */
762 unsigned int pgbase; /* zero-copy data */
763 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400764 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700765};
766
767struct nfs4_readdir_res {
768 nfs4_verifier verifier;
769 unsigned int pgbase;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400770 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700771};
772
773struct nfs4_readlink {
774 const struct nfs_fh * fh;
775 unsigned int pgbase;
776 unsigned int pglen; /* zero-copy data */
777 struct page ** pages; /* zero-copy data */
Benny Halevy9ff71c32009-04-01 09:21:52 -0400778 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700779};
780
Benny Halevyf50c7002009-04-01 09:21:55 -0400781struct nfs4_readlink_res {
782 struct nfs4_sequence_res seq_res;
783};
784
Linus Torvalds1da177e2005-04-16 15:20:36 -0700785struct nfs4_rename_arg {
786 const struct nfs_fh * old_dir;
787 const struct nfs_fh * new_dir;
788 const struct qstr * old_name;
789 const struct qstr * new_name;
Trond Myklebust6caf2c82005-10-27 22:12:43 -0400790 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400791 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700792};
793
794struct nfs4_rename_res {
Trond Myklebust6caf2c82005-10-27 22:12:43 -0400795 const struct nfs_server * server;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700796 struct nfs4_change_info old_cinfo;
Trond Myklebust6caf2c82005-10-27 22:12:43 -0400797 struct nfs_fattr * old_fattr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700798 struct nfs4_change_info new_cinfo;
Trond Myklebust6caf2c82005-10-27 22:12:43 -0400799 struct nfs_fattr * new_fattr;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400800 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700801};
802
Trond Myklebust19d771f2008-10-08 13:54:52 -0400803#define NFS4_SETCLIENTID_NAMELEN (127)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700804struct nfs4_setclientid {
Chuck Levercc38bac2007-12-10 14:56:54 -0500805 const nfs4_verifier * sc_verifier;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700806 unsigned int sc_name_len;
Chuck Leverd1ce02e2008-09-25 11:57:12 -0400807 char sc_name[NFS4_SETCLIENTID_NAMELEN + 1];
Chuck Levercc38bac2007-12-10 14:56:54 -0500808 u32 sc_prog;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700809 unsigned int sc_netid_len;
Chuck Leverd1ce02e2008-09-25 11:57:12 -0400810 char sc_netid[RPCBIND_MAXNETIDLEN + 1];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700811 unsigned int sc_uaddr_len;
Chuck Leverd1ce02e2008-09-25 11:57:12 -0400812 char sc_uaddr[RPCBIND_MAXUADDRLEN + 1];
Chuck Levercc38bac2007-12-10 14:56:54 -0500813 u32 sc_cb_ident;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700814};
815
816struct nfs4_statfs_arg {
817 const struct nfs_fh * fh;
818 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400819 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700820};
821
Benny Halevy24ad1482009-04-01 09:21:56 -0400822struct nfs4_statfs_res {
823 struct nfs_fsstat *fsstat;
824 struct nfs4_sequence_res seq_res;
825};
826
Benny Halevy43652ad2009-04-01 09:21:54 -0400827struct nfs4_server_caps_arg {
828 struct nfs_fh *fhandle;
829 struct nfs4_sequence_args seq_args;
830};
831
Linus Torvalds1da177e2005-04-16 15:20:36 -0700832struct nfs4_server_caps_res {
833 u32 attr_bitmask[2];
834 u32 acl_bitmask;
835 u32 has_links;
836 u32 has_symlinks;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400837 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700838};
839
Manoj Naik7aaa0b32006-06-09 09:34:23 -0400840struct nfs4_string {
841 unsigned int len;
842 char *data;
Trond Myklebust683b57b2006-06-09 09:34:22 -0400843};
844
Manoj Naik7aaa0b32006-06-09 09:34:23 -0400845#define NFS4_PATHNAME_MAXCOMPONENTS 512
846struct nfs4_pathname {
847 unsigned int ncomponents;
848 struct nfs4_string components[NFS4_PATHNAME_MAXCOMPONENTS];
849};
850
851#define NFS4_FS_LOCATION_MAXSERVERS 10
852struct nfs4_fs_location {
853 unsigned int nservers;
854 struct nfs4_string servers[NFS4_FS_LOCATION_MAXSERVERS];
855 struct nfs4_pathname rootpath;
856};
857
858#define NFS4_FS_LOCATIONS_MAXENTRIES 10
859struct nfs4_fs_locations {
Trond Myklebust683b57b2006-06-09 09:34:22 -0400860 struct nfs_fattr fattr;
861 const struct nfs_server *server;
Manoj Naik7aaa0b32006-06-09 09:34:23 -0400862 struct nfs4_pathname fs_path;
Trond Myklebust683b57b2006-06-09 09:34:22 -0400863 int nlocations;
Manoj Naik7aaa0b32006-06-09 09:34:23 -0400864 struct nfs4_fs_location locations[NFS4_FS_LOCATIONS_MAXENTRIES];
Trond Myklebust683b57b2006-06-09 09:34:22 -0400865};
866
867struct nfs4_fs_locations_arg {
868 const struct nfs_fh *dir_fh;
869 const struct qstr *name;
870 struct page *page;
871 const u32 *bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400872 struct nfs4_sequence_args seq_args;
Trond Myklebust683b57b2006-06-09 09:34:22 -0400873};
874
Benny Halevy22958462009-04-01 09:22:02 -0400875struct nfs4_fs_locations_res {
876 struct nfs4_fs_locations *fs_locations;
877 struct nfs4_sequence_res seq_res;
878};
879
Linus Torvalds1da177e2005-04-16 15:20:36 -0700880#endif /* CONFIG_NFS_V4 */
881
Benny Halevy99fe60d2009-04-01 09:22:29 -0400882struct nfstime4 {
883 u64 seconds;
884 u32 nseconds;
885};
886
887#ifdef CONFIG_NFS_V4_1
888struct nfs_impl_id4 {
889 u32 domain_len;
890 char *domain;
891 u32 name_len;
892 char *name;
893 struct nfstime4 date;
894};
895
896#define NFS4_EXCHANGE_ID_LEN (48)
897struct nfs41_exchange_id_args {
898 struct nfs_client *client;
899 nfs4_verifier *verifier;
900 unsigned int id_len;
901 char id[NFS4_EXCHANGE_ID_LEN];
902 u32 flags;
903};
904
905struct server_owner {
906 uint64_t minor_id;
907 uint32_t major_id_sz;
908 char major_id[NFS4_OPAQUE_LIMIT];
909};
910
911struct server_scope {
912 uint32_t server_scope_sz;
913 char server_scope[NFS4_OPAQUE_LIMIT];
914};
915
916struct nfs41_exchange_id_res {
917 struct nfs_client *client;
918 u32 flags;
919};
920#endif /* CONFIG_NFS_V4_1 */
921
Linus Torvalds1da177e2005-04-16 15:20:36 -0700922struct nfs_page;
923
Chuck Lever40859d72005-11-30 18:09:02 -0500924#define NFS_PAGEVEC_SIZE (8U)
925
Linus Torvalds1da177e2005-04-16 15:20:36 -0700926struct nfs_read_data {
927 int flags;
928 struct rpc_task task;
929 struct inode *inode;
930 struct rpc_cred *cred;
931 struct nfs_fattr fattr; /* fattr storage */
932 struct list_head pages; /* Coalesced read requests */
933 struct nfs_page *req; /* multi ops per nfs_page */
Chuck Lever40859d72005-11-30 18:09:02 -0500934 struct page **pagevec;
Trond Myklebuste9f7bee2006-09-08 09:48:54 -0700935 unsigned int npages; /* Max length of pagevec */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700936 struct nfs_readargs args;
937 struct nfs_readres res;
938#ifdef CONFIG_NFS_V4
939 unsigned long timestamp; /* For lease renewal */
940#endif
Chuck Lever0d0b5cb2006-05-25 01:40:53 -0400941 struct page *page_array[NFS_PAGEVEC_SIZE];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700942};
943
944struct nfs_write_data {
945 int flags;
946 struct rpc_task task;
947 struct inode *inode;
948 struct rpc_cred *cred;
949 struct nfs_fattr fattr;
950 struct nfs_writeverf verf;
951 struct list_head pages; /* Coalesced requests we wish to flush */
952 struct nfs_page *req; /* multi ops per nfs_page */
Chuck Lever40859d72005-11-30 18:09:02 -0500953 struct page **pagevec;
Trond Myklebuste9f7bee2006-09-08 09:48:54 -0700954 unsigned int npages; /* Max length of pagevec */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700955 struct nfs_writeargs args; /* argument struct */
956 struct nfs_writeres res; /* result struct */
957#ifdef CONFIG_NFS_V4
958 unsigned long timestamp; /* For lease renewal */
959#endif
Chuck Lever0d0b5cb2006-05-25 01:40:53 -0400960 struct page *page_array[NFS_PAGEVEC_SIZE];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700961};
962
963struct nfs_access_entry;
964
965/*
966 * RPC procedure vector for NFSv2/NFSv3 demuxing
967 */
968struct nfs_rpc_ops {
Chuck Leverc0e07cb2008-01-14 12:32:05 -0500969 u32 version; /* Protocol version */
Al Virof786aa92009-02-20 05:51:22 +0000970 const struct dentry_operations *dentry_ops;
Arjan van de Venc5ef1c42007-02-12 00:55:40 -0800971 const struct inode_operations *dir_inode_ops;
972 const struct inode_operations *file_inode_ops;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700973
974 int (*getroot) (struct nfs_server *, struct nfs_fh *,
975 struct nfs_fsinfo *);
David Howells2b3de442006-08-22 20:06:09 -0400976 int (*lookupfh)(struct nfs_server *, struct nfs_fh *,
977 struct qstr *, struct nfs_fh *,
978 struct nfs_fattr *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700979 int (*getattr) (struct nfs_server *, struct nfs_fh *,
980 struct nfs_fattr *);
981 int (*setattr) (struct dentry *, struct nfs_fattr *,
982 struct iattr *);
983 int (*lookup) (struct inode *, struct qstr *,
984 struct nfs_fh *, struct nfs_fattr *);
985 int (*access) (struct inode *, struct nfs_access_entry *);
986 int (*readlink)(struct inode *, struct page *, unsigned int,
987 unsigned int);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700988 int (*create) (struct inode *, struct dentry *,
Trond Myklebust02a913a2005-10-18 14:20:17 -0700989 struct iattr *, int, struct nameidata *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700990 int (*remove) (struct inode *, struct qstr *);
Trond Myklebuste4eff1a2007-07-14 15:39:58 -0400991 void (*unlink_setup) (struct rpc_message *, struct inode *dir);
992 int (*unlink_done) (struct rpc_task *, struct inode *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700993 int (*rename) (struct inode *, struct qstr *,
994 struct inode *, struct qstr *);
995 int (*link) (struct inode *, struct inode *, struct qstr *);
Chuck Lever94a6d752006-08-22 20:06:23 -0400996 int (*symlink) (struct inode *, struct dentry *, struct page *,
997 unsigned int, struct iattr *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700998 int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
999 int (*rmdir) (struct inode *, struct qstr *);
1000 int (*readdir) (struct dentry *, struct rpc_cred *,
1001 u64, struct page *, unsigned int, int);
1002 int (*mknod) (struct inode *, struct dentry *, struct iattr *,
1003 dev_t);
1004 int (*statfs) (struct nfs_server *, struct nfs_fh *,
1005 struct nfs_fsstat *);
1006 int (*fsinfo) (struct nfs_server *, struct nfs_fh *,
1007 struct nfs_fsinfo *);
1008 int (*pathconf) (struct nfs_server *, struct nfs_fh *,
1009 struct nfs_pathconf *);
David Howellse9326dc2006-08-22 20:06:10 -04001010 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
Al Viro0dbb4c62006-10-19 23:28:49 -07001011 __be32 *(*decode_dirent)(__be32 *, struct nfs_entry *, int plus);
Trond Myklebustbdc7f022007-07-14 15:40:00 -04001012 void (*read_setup) (struct nfs_read_data *, struct rpc_message *);
Trond Myklebustec06c092006-03-20 13:44:27 -05001013 int (*read_done) (struct rpc_task *, struct nfs_read_data *);
Trond Myklebustbdc7f022007-07-14 15:40:00 -04001014 void (*write_setup) (struct nfs_write_data *, struct rpc_message *);
Trond Myklebust788e7a82006-03-20 13:44:27 -05001015 int (*write_done) (struct rpc_task *, struct nfs_write_data *);
Trond Myklebustbdc7f022007-07-14 15:40:00 -04001016 void (*commit_setup) (struct nfs_write_data *, struct rpc_message *);
Trond Myklebust788e7a82006-03-20 13:44:27 -05001017 int (*commit_done) (struct rpc_task *, struct nfs_write_data *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001018 int (*lock)(struct file *, int, struct file_lock *);
Trond Myklebust21162712008-05-20 19:34:39 -04001019 int (*lock_check_bounds)(const struct file_lock *);
Trond Myklebustada70d92005-06-22 17:16:22 +00001020 void (*clear_acl_cache)(struct inode *);
Trond Myklebust7fe5c392009-03-19 15:35:50 -04001021 void (*close_context)(struct nfs_open_context *ctx, int);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001022};
1023
1024/*
1025 * NFS_CALL(getattr, inode, (fattr));
1026 * into
1027 * NFS_PROTO(inode)->getattr(fattr);
1028 */
1029#define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args
1030
1031/*
1032 * Function vectors etc. for the NFS client
1033 */
David Howells509de812006-08-22 20:06:11 -04001034extern const struct nfs_rpc_ops nfs_v2_clientops;
1035extern const struct nfs_rpc_ops nfs_v3_clientops;
1036extern const struct nfs_rpc_ops nfs_v4_clientops;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001037extern struct rpc_version nfs_version2;
1038extern struct rpc_version nfs_version3;
1039extern struct rpc_version nfs_version4;
1040
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +00001041extern struct rpc_version nfsacl_version3;
1042extern struct rpc_program nfsacl_program;
1043
Linus Torvalds1da177e2005-04-16 15:20:36 -07001044#endif