blob: db0d1236aae75c3edbdf0b793e5a062d325efaac [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;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400166};
167
168struct nfs4_sequence_res {
Benny Halevyf3752972009-04-01 09:22:04 -0400169 struct nfs4_session *sr_session;
Andy Adamson5f7dbd52009-04-01 09:22:05 -0400170 u8 sr_slotid; /* slot used to send request */
Benny Halevy9ff71c32009-04-01 09:21:52 -0400171};
172
Linus Torvalds1da177e2005-04-16 15:20:36 -0700173/*
174 * Arguments to the open call.
175 */
176struct nfs_openargs {
177 const struct nfs_fh * fh;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700178 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700179 int open_flags;
Trond Myklebustdc0b0272008-12-23 15:21:56 -0500180 fmode_t fmode;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700181 __u64 clientid;
Trond Myklebust9f958ab2007-07-02 13:58:33 -0400182 __u64 id;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700183 union {
184 struct iattr * attrs; /* UNCHECKED, GUARDED */
185 nfs4_verifier verifier; /* EXCLUSIVE */
186 nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */
Trond Myklebustbd7bf9d2008-12-23 15:21:53 -0500187 fmode_t delegation_type; /* CLAIM_PREVIOUS */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700188 } u;
189 const struct qstr * name;
190 const struct nfs_server *server; /* Needed for ID mapping */
191 const u32 * bitmask;
192 __u32 claim;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400193 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700194};
195
196struct nfs_openres {
197 nfs4_stateid stateid;
198 struct nfs_fh fh;
199 struct nfs4_change_info cinfo;
200 __u32 rflags;
201 struct nfs_fattr * f_attr;
Trond Myklebust56ae19f2005-10-27 22:12:40 -0400202 struct nfs_fattr * dir_attr;
Trond Myklebustc1d51932008-04-07 13:20:54 -0400203 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700204 const struct nfs_server *server;
Trond Myklebustbd7bf9d2008-12-23 15:21:53 -0500205 fmode_t delegation_type;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700206 nfs4_stateid delegation;
207 __u32 do_recall;
208 __u64 maxsize;
Jeff Laytonaa53ed52007-06-05 14:49:03 -0400209 __u32 attrset[NFS4_BITMAP_SIZE];
Benny Halevy9ff71c32009-04-01 09:21:52 -0400210 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700211};
212
213/*
214 * Arguments to the open_confirm call.
215 */
216struct nfs_open_confirmargs {
217 const struct nfs_fh * fh;
Trond Myklebustcdd4e682006-01-03 09:55:12 +0100218 nfs4_stateid * stateid;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700219 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700220};
221
222struct nfs_open_confirmres {
223 nfs4_stateid stateid;
Trond Myklebustc1d51932008-04-07 13:20:54 -0400224 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700225};
226
227/*
228 * Arguments to the close call.
229 */
230struct nfs_closeargs {
231 struct nfs_fh * fh;
Trond Myklebust95121352005-10-18 14:20:12 -0700232 nfs4_stateid * stateid;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700233 struct nfs_seqid * seqid;
Trond Myklebustdc0b0272008-12-23 15:21:56 -0500234 fmode_t fmode;
Trond Myklebust516a6af2005-10-27 22:12:41 -0400235 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400236 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700237};
238
239struct nfs_closeres {
240 nfs4_stateid stateid;
Trond Myklebust516a6af2005-10-27 22:12:41 -0400241 struct nfs_fattr * fattr;
Trond Myklebustc1d51932008-04-07 13:20:54 -0400242 struct nfs_seqid * seqid;
Trond Myklebust516a6af2005-10-27 22:12:41 -0400243 const struct nfs_server *server;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400244 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700245};
246/*
247 * * Arguments to the lock,lockt, and locku call.
248 * */
249struct nfs_lowner {
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100250 __u64 clientid;
Trond Myklebust9f958ab2007-07-02 13:58:33 -0400251 __u64 id;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700252};
253
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100254struct nfs_lock_args {
255 struct nfs_fh * fh;
256 struct file_lock * fl;
Trond Myklebust06735b32005-10-18 14:20:15 -0700257 struct nfs_seqid * lock_seqid;
258 nfs4_stateid * lock_stateid;
259 struct nfs_seqid * open_seqid;
260 nfs4_stateid * open_stateid;
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100261 struct nfs_lowner lock_owner;
262 unsigned char block : 1;
263 unsigned char reclaim : 1;
264 unsigned char new_lock_owner : 1;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400265 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700266};
267
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100268struct nfs_lock_res {
Trond Myklebustc1d51932008-04-07 13:20:54 -0400269 nfs4_stateid stateid;
270 struct nfs_seqid * lock_seqid;
271 struct nfs_seqid * open_seqid;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400272 struct nfs4_sequence_res seq_res;
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100273};
274
275struct nfs_locku_args {
276 struct nfs_fh * fh;
277 struct file_lock * fl;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700278 struct nfs_seqid * seqid;
Trond Myklebustfaf5f492005-10-18 14:20:15 -0700279 nfs4_stateid * stateid;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400280 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700281};
282
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100283struct nfs_locku_res {
Trond Myklebustc1d51932008-04-07 13:20:54 -0400284 nfs4_stateid stateid;
285 struct nfs_seqid * seqid;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400286 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700287};
288
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100289struct nfs_lockt_args {
290 struct nfs_fh * fh;
291 struct file_lock * fl;
292 struct nfs_lowner lock_owner;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400293 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700294};
295
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100296struct nfs_lockt_res {
297 struct file_lock * denied; /* LOCK, LOCKT failed */
Benny Halevy9ff71c32009-04-01 09:21:52 -0400298 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700299};
300
301struct nfs4_delegreturnargs {
302 const struct nfs_fh *fhandle;
303 const nfs4_stateid *stateid;
Trond Myklebustfa178f22006-01-03 09:55:38 +0100304 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400305 struct nfs4_sequence_args seq_args;
Trond Myklebustfa178f22006-01-03 09:55:38 +0100306};
307
308struct nfs4_delegreturnres {
309 struct nfs_fattr * fattr;
310 const struct nfs_server *server;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400311 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700312};
313
314/*
315 * Arguments to the read call.
316 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700317struct nfs_readargs {
318 struct nfs_fh * fh;
319 struct nfs_open_context *context;
320 __u64 offset;
321 __u32 count;
322 unsigned int pgbase;
323 struct page ** pages;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400324 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700325};
326
327struct nfs_readres {
328 struct nfs_fattr * fattr;
329 __u32 count;
330 int eof;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400331 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700332};
333
334/*
335 * Arguments to the write call.
336 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700337struct nfs_writeargs {
338 struct nfs_fh * fh;
339 struct nfs_open_context *context;
340 __u64 offset;
341 __u32 count;
342 enum nfs3_stable_how stable;
343 unsigned int pgbase;
344 struct page ** pages;
Trond Myklebust4f9838c2005-10-27 22:12:44 -0400345 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400346 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700347};
348
349struct nfs_writeverf {
350 enum nfs3_stable_how committed;
Al Virobc4785c2006-10-19 23:28:51 -0700351 __be32 verifier[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700352};
353
354struct nfs_writeres {
355 struct nfs_fattr * fattr;
356 struct nfs_writeverf * verf;
357 __u32 count;
Trond Myklebust4f9838c2005-10-27 22:12:44 -0400358 const struct nfs_server *server;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400359 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700360};
361
362/*
Trond Myklebust4fdc17b2007-07-14 15:39:57 -0400363 * Common arguments to the unlink call
364 */
365struct nfs_removeargs {
366 const struct nfs_fh *fh;
367 struct qstr name;
368 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400369 struct nfs4_sequence_args seq_args;
Trond Myklebust4fdc17b2007-07-14 15:39:57 -0400370};
371
372struct nfs_removeres {
373 const struct nfs_server *server;
374 struct nfs4_change_info cinfo;
375 struct nfs_fattr dir_attr;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400376 struct nfs4_sequence_res seq_res;
Trond Myklebust4fdc17b2007-07-14 15:39:57 -0400377};
378
379/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700380 * Argument struct for decode_entry function
381 */
382struct nfs_entry {
383 __u64 ino;
384 __u64 cookie,
385 prev_cookie;
386 const char * name;
387 unsigned int len;
388 int eof;
389 struct nfs_fh * fh;
390 struct nfs_fattr * fattr;
391};
392
393/*
394 * The following types are for NFSv2 only.
395 */
396struct nfs_sattrargs {
397 struct nfs_fh * fh;
398 struct iattr * sattr;
399};
400
401struct nfs_diropargs {
402 struct nfs_fh * fh;
403 const char * name;
404 unsigned int len;
405};
406
407struct nfs_createargs {
408 struct nfs_fh * fh;
409 const char * name;
410 unsigned int len;
411 struct iattr * sattr;
412};
413
414struct nfs_renameargs {
415 struct nfs_fh * fromfh;
416 const char * fromname;
417 unsigned int fromlen;
418 struct nfs_fh * tofh;
419 const char * toname;
420 unsigned int tolen;
421};
422
423struct nfs_setattrargs {
424 struct nfs_fh * fh;
425 nfs4_stateid stateid;
426 struct iattr * iap;
427 const struct nfs_server * server; /* Needed for name mapping */
428 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400429 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700430};
431
J. Bruce Fields23ec6962005-06-22 17:16:22 +0000432struct nfs_setaclargs {
433 struct nfs_fh * fh;
434 size_t acl_len;
435 unsigned int acl_pgbase;
436 struct page ** acl_pages;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400437 struct nfs4_sequence_args seq_args;
J. Bruce Fields23ec6962005-06-22 17:16:22 +0000438};
439
Benny Halevy73c403a2009-04-01 09:22:01 -0400440struct nfs_setaclres {
441 struct nfs4_sequence_res seq_res;
442};
443
J. Bruce Fields029d1052005-06-22 17:16:22 +0000444struct nfs_getaclargs {
445 struct nfs_fh * fh;
446 size_t acl_len;
447 unsigned int acl_pgbase;
448 struct page ** acl_pages;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400449 struct nfs4_sequence_args seq_args;
J. Bruce Fields029d1052005-06-22 17:16:22 +0000450};
451
Benny Halevy663c79b2009-04-01 09:21:59 -0400452struct nfs_getaclres {
453 size_t acl_len;
454 struct nfs4_sequence_res seq_res;
455};
456
Linus Torvalds1da177e2005-04-16 15:20:36 -0700457struct nfs_setattrres {
458 struct nfs_fattr * fattr;
459 const struct nfs_server * server;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400460 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700461};
462
463struct nfs_linkargs {
464 struct nfs_fh * fromfh;
465 struct nfs_fh * tofh;
466 const char * toname;
467 unsigned int tolen;
468};
469
470struct nfs_symlinkargs {
471 struct nfs_fh * fromfh;
472 const char * fromname;
473 unsigned int fromlen;
Chuck Lever94a6d752006-08-22 20:06:23 -0400474 struct page ** pages;
475 unsigned int pathlen;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700476 struct iattr * sattr;
477};
478
479struct nfs_readdirargs {
480 struct nfs_fh * fh;
481 __u32 cookie;
482 unsigned int count;
483 struct page ** pages;
484};
485
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +0000486struct nfs3_getaclargs {
487 struct nfs_fh * fh;
488 int mask;
489 struct page ** pages;
490};
491
492struct nfs3_setaclargs {
493 struct inode * inode;
494 int mask;
495 struct posix_acl * acl_access;
496 struct posix_acl * acl_default;
Trond Myklebustae461412009-03-10 20:33:18 -0400497 size_t len;
498 unsigned int npages;
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +0000499 struct page ** pages;
500};
501
Linus Torvalds1da177e2005-04-16 15:20:36 -0700502struct nfs_diropok {
503 struct nfs_fh * fh;
504 struct nfs_fattr * fattr;
505};
506
507struct nfs_readlinkargs {
508 struct nfs_fh * fh;
509 unsigned int pgbase;
510 unsigned int pglen;
511 struct page ** pages;
512};
513
514struct nfs3_sattrargs {
515 struct nfs_fh * fh;
516 struct iattr * sattr;
517 unsigned int guard;
518 struct timespec guardtime;
519};
520
521struct nfs3_diropargs {
522 struct nfs_fh * fh;
523 const char * name;
524 unsigned int len;
525};
526
527struct nfs3_accessargs {
528 struct nfs_fh * fh;
529 __u32 access;
530};
531
532struct nfs3_createargs {
533 struct nfs_fh * fh;
534 const char * name;
535 unsigned int len;
536 struct iattr * sattr;
537 enum nfs3_createmode createmode;
Al Virobc4785c2006-10-19 23:28:51 -0700538 __be32 verifier[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700539};
540
541struct nfs3_mkdirargs {
542 struct nfs_fh * fh;
543 const char * name;
544 unsigned int len;
545 struct iattr * sattr;
546};
547
548struct nfs3_symlinkargs {
549 struct nfs_fh * fromfh;
550 const char * fromname;
551 unsigned int fromlen;
Chuck Lever94a6d752006-08-22 20:06:23 -0400552 struct page ** pages;
553 unsigned int pathlen;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700554 struct iattr * sattr;
555};
556
557struct nfs3_mknodargs {
558 struct nfs_fh * fh;
559 const char * name;
560 unsigned int len;
561 enum nfs3_ftype type;
562 struct iattr * sattr;
563 dev_t rdev;
564};
565
566struct nfs3_renameargs {
567 struct nfs_fh * fromfh;
568 const char * fromname;
569 unsigned int fromlen;
570 struct nfs_fh * tofh;
571 const char * toname;
572 unsigned int tolen;
573};
574
575struct nfs3_linkargs {
576 struct nfs_fh * fromfh;
577 struct nfs_fh * tofh;
578 const char * toname;
579 unsigned int tolen;
580};
581
582struct nfs3_readdirargs {
583 struct nfs_fh * fh;
584 __u64 cookie;
Al Virobc4785c2006-10-19 23:28:51 -0700585 __be32 verf[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700586 int plus;
587 unsigned int count;
588 struct page ** pages;
589};
590
591struct nfs3_diropres {
592 struct nfs_fattr * dir_attr;
593 struct nfs_fh * fh;
594 struct nfs_fattr * fattr;
595};
596
597struct nfs3_accessres {
598 struct nfs_fattr * fattr;
599 __u32 access;
600};
601
602struct nfs3_readlinkargs {
603 struct nfs_fh * fh;
604 unsigned int pgbase;
605 unsigned int pglen;
606 struct page ** pages;
607};
608
609struct nfs3_renameres {
610 struct nfs_fattr * fromattr;
611 struct nfs_fattr * toattr;
612};
613
614struct nfs3_linkres {
615 struct nfs_fattr * dir_attr;
616 struct nfs_fattr * fattr;
617};
618
619struct nfs3_readdirres {
620 struct nfs_fattr * dir_attr;
Al Virobc4785c2006-10-19 23:28:51 -0700621 __be32 * verf;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700622 int plus;
623};
624
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +0000625struct nfs3_getaclres {
626 struct nfs_fattr * fattr;
627 int mask;
628 unsigned int acl_access_count;
629 unsigned int acl_default_count;
630 struct posix_acl * acl_access;
631 struct posix_acl * acl_default;
632};
633
Linus Torvalds1da177e2005-04-16 15:20:36 -0700634#ifdef CONFIG_NFS_V4
635
636typedef u64 clientid4;
637
638struct nfs4_accessargs {
639 const struct nfs_fh * fh;
Trond Myklebust76b32992007-08-10 17:45:11 -0400640 const u32 * bitmask;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700641 u32 access;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400642 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700643};
644
645struct nfs4_accessres {
Trond Myklebust76b32992007-08-10 17:45:11 -0400646 const struct nfs_server * server;
647 struct nfs_fattr * fattr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700648 u32 supported;
649 u32 access;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400650 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700651};
652
653struct nfs4_create_arg {
654 u32 ftype;
655 union {
Chuck Lever94a6d752006-08-22 20:06:23 -0400656 struct {
657 struct page ** pages;
658 unsigned int len;
659 } symlink; /* NF4LNK */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700660 struct {
661 u32 specdata1;
662 u32 specdata2;
663 } device; /* NF4BLK, NF4CHR */
664 } u;
665 const struct qstr * name;
666 const struct nfs_server * server;
667 const struct iattr * attrs;
668 const struct nfs_fh * dir_fh;
669 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400670 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700671};
672
673struct nfs4_create_res {
674 const struct nfs_server * server;
675 struct nfs_fh * fh;
676 struct nfs_fattr * fattr;
677 struct nfs4_change_info dir_cinfo;
Trond Myklebust56ae19f2005-10-27 22:12:40 -0400678 struct nfs_fattr * dir_fattr;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400679 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700680};
681
682struct nfs4_fsinfo_arg {
683 const struct nfs_fh * fh;
684 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400685 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700686};
687
Benny Halevy3dda5e42009-04-01 09:21:57 -0400688struct nfs4_fsinfo_res {
689 struct nfs_fsinfo *fsinfo;
690 struct nfs4_sequence_res seq_res;
691};
692
Linus Torvalds1da177e2005-04-16 15:20:36 -0700693struct nfs4_getattr_arg {
694 const struct nfs_fh * fh;
695 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400696 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700697};
698
699struct nfs4_getattr_res {
700 const struct nfs_server * server;
701 struct nfs_fattr * 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_link_arg {
706 const struct nfs_fh * fh;
707 const struct nfs_fh * dir_fh;
708 const struct qstr * name;
Trond Myklebust91ba2ee2005-10-27 22:12:42 -0400709 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
Trond Myklebust91ba2ee2005-10-27 22:12:42 -0400713struct nfs4_link_res {
714 const struct nfs_server * server;
715 struct nfs_fattr * fattr;
716 struct nfs4_change_info cinfo;
717 struct nfs_fattr * dir_attr;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400718 struct nfs4_sequence_res seq_res;
Trond Myklebust91ba2ee2005-10-27 22:12:42 -0400719};
720
721
Linus Torvalds1da177e2005-04-16 15:20:36 -0700722struct nfs4_lookup_arg {
723 const struct nfs_fh * dir_fh;
724 const struct qstr * name;
725 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400726 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700727};
728
729struct nfs4_lookup_res {
730 const struct nfs_server * server;
731 struct nfs_fattr * fattr;
732 struct nfs_fh * fh;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400733 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700734};
735
736struct nfs4_lookup_root_arg {
737 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400738 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700739};
740
741struct nfs4_pathconf_arg {
742 const struct nfs_fh * fh;
743 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400744 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700745};
746
Benny Halevyd45b2982009-04-01 09:21:58 -0400747struct nfs4_pathconf_res {
748 struct nfs_pathconf *pathconf;
749 struct nfs4_sequence_res seq_res;
750};
751
Linus Torvalds1da177e2005-04-16 15:20:36 -0700752struct nfs4_readdir_arg {
753 const struct nfs_fh * fh;
754 u64 cookie;
755 nfs4_verifier verifier;
756 u32 count;
757 struct page ** pages; /* zero-copy data */
758 unsigned int pgbase; /* zero-copy data */
759 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400760 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700761};
762
763struct nfs4_readdir_res {
764 nfs4_verifier verifier;
765 unsigned int pgbase;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400766 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700767};
768
769struct nfs4_readlink {
770 const struct nfs_fh * fh;
771 unsigned int pgbase;
772 unsigned int pglen; /* zero-copy data */
773 struct page ** pages; /* zero-copy data */
Benny Halevy9ff71c32009-04-01 09:21:52 -0400774 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700775};
776
Benny Halevyf50c7002009-04-01 09:21:55 -0400777struct nfs4_readlink_res {
778 struct nfs4_sequence_res seq_res;
779};
780
Linus Torvalds1da177e2005-04-16 15:20:36 -0700781struct nfs4_rename_arg {
782 const struct nfs_fh * old_dir;
783 const struct nfs_fh * new_dir;
784 const struct qstr * old_name;
785 const struct qstr * new_name;
Trond Myklebust6caf2c82005-10-27 22:12:43 -0400786 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400787 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700788};
789
790struct nfs4_rename_res {
Trond Myklebust6caf2c82005-10-27 22:12:43 -0400791 const struct nfs_server * server;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700792 struct nfs4_change_info old_cinfo;
Trond Myklebust6caf2c82005-10-27 22:12:43 -0400793 struct nfs_fattr * old_fattr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700794 struct nfs4_change_info new_cinfo;
Trond Myklebust6caf2c82005-10-27 22:12:43 -0400795 struct nfs_fattr * new_fattr;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400796 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700797};
798
Trond Myklebust19d771f2008-10-08 13:54:52 -0400799#define NFS4_SETCLIENTID_NAMELEN (127)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700800struct nfs4_setclientid {
Chuck Levercc38bac2007-12-10 14:56:54 -0500801 const nfs4_verifier * sc_verifier;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700802 unsigned int sc_name_len;
Chuck Leverd1ce02e2008-09-25 11:57:12 -0400803 char sc_name[NFS4_SETCLIENTID_NAMELEN + 1];
Chuck Levercc38bac2007-12-10 14:56:54 -0500804 u32 sc_prog;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700805 unsigned int sc_netid_len;
Chuck Leverd1ce02e2008-09-25 11:57:12 -0400806 char sc_netid[RPCBIND_MAXNETIDLEN + 1];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700807 unsigned int sc_uaddr_len;
Chuck Leverd1ce02e2008-09-25 11:57:12 -0400808 char sc_uaddr[RPCBIND_MAXUADDRLEN + 1];
Chuck Levercc38bac2007-12-10 14:56:54 -0500809 u32 sc_cb_ident;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700810};
811
812struct nfs4_statfs_arg {
813 const struct nfs_fh * fh;
814 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400815 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700816};
817
Benny Halevy24ad1482009-04-01 09:21:56 -0400818struct nfs4_statfs_res {
819 struct nfs_fsstat *fsstat;
820 struct nfs4_sequence_res seq_res;
821};
822
Benny Halevy43652ad2009-04-01 09:21:54 -0400823struct nfs4_server_caps_arg {
824 struct nfs_fh *fhandle;
825 struct nfs4_sequence_args seq_args;
826};
827
Linus Torvalds1da177e2005-04-16 15:20:36 -0700828struct nfs4_server_caps_res {
829 u32 attr_bitmask[2];
830 u32 acl_bitmask;
831 u32 has_links;
832 u32 has_symlinks;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400833 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700834};
835
Manoj Naik7aaa0b32006-06-09 09:34:23 -0400836struct nfs4_string {
837 unsigned int len;
838 char *data;
Trond Myklebust683b57b2006-06-09 09:34:22 -0400839};
840
Manoj Naik7aaa0b32006-06-09 09:34:23 -0400841#define NFS4_PATHNAME_MAXCOMPONENTS 512
842struct nfs4_pathname {
843 unsigned int ncomponents;
844 struct nfs4_string components[NFS4_PATHNAME_MAXCOMPONENTS];
845};
846
847#define NFS4_FS_LOCATION_MAXSERVERS 10
848struct nfs4_fs_location {
849 unsigned int nservers;
850 struct nfs4_string servers[NFS4_FS_LOCATION_MAXSERVERS];
851 struct nfs4_pathname rootpath;
852};
853
854#define NFS4_FS_LOCATIONS_MAXENTRIES 10
855struct nfs4_fs_locations {
Trond Myklebust683b57b2006-06-09 09:34:22 -0400856 struct nfs_fattr fattr;
857 const struct nfs_server *server;
Manoj Naik7aaa0b32006-06-09 09:34:23 -0400858 struct nfs4_pathname fs_path;
Trond Myklebust683b57b2006-06-09 09:34:22 -0400859 int nlocations;
Manoj Naik7aaa0b32006-06-09 09:34:23 -0400860 struct nfs4_fs_location locations[NFS4_FS_LOCATIONS_MAXENTRIES];
Trond Myklebust683b57b2006-06-09 09:34:22 -0400861};
862
863struct nfs4_fs_locations_arg {
864 const struct nfs_fh *dir_fh;
865 const struct qstr *name;
866 struct page *page;
867 const u32 *bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400868 struct nfs4_sequence_args seq_args;
Trond Myklebust683b57b2006-06-09 09:34:22 -0400869};
870
Benny Halevy22958462009-04-01 09:22:02 -0400871struct nfs4_fs_locations_res {
872 struct nfs4_fs_locations *fs_locations;
873 struct nfs4_sequence_res seq_res;
874};
875
Linus Torvalds1da177e2005-04-16 15:20:36 -0700876#endif /* CONFIG_NFS_V4 */
877
878struct nfs_page;
879
Chuck Lever40859d72005-11-30 18:09:02 -0500880#define NFS_PAGEVEC_SIZE (8U)
881
Linus Torvalds1da177e2005-04-16 15:20:36 -0700882struct nfs_read_data {
883 int flags;
884 struct rpc_task task;
885 struct inode *inode;
886 struct rpc_cred *cred;
887 struct nfs_fattr fattr; /* fattr storage */
888 struct list_head pages; /* Coalesced read requests */
889 struct nfs_page *req; /* multi ops per nfs_page */
Chuck Lever40859d72005-11-30 18:09:02 -0500890 struct page **pagevec;
Trond Myklebuste9f7bee2006-09-08 09:48:54 -0700891 unsigned int npages; /* Max length of pagevec */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700892 struct nfs_readargs args;
893 struct nfs_readres res;
894#ifdef CONFIG_NFS_V4
895 unsigned long timestamp; /* For lease renewal */
896#endif
Chuck Lever0d0b5cb2006-05-25 01:40:53 -0400897 struct page *page_array[NFS_PAGEVEC_SIZE];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700898};
899
900struct nfs_write_data {
901 int flags;
902 struct rpc_task task;
903 struct inode *inode;
904 struct rpc_cred *cred;
905 struct nfs_fattr fattr;
906 struct nfs_writeverf verf;
907 struct list_head pages; /* Coalesced requests we wish to flush */
908 struct nfs_page *req; /* multi ops per nfs_page */
Chuck Lever40859d72005-11-30 18:09:02 -0500909 struct page **pagevec;
Trond Myklebuste9f7bee2006-09-08 09:48:54 -0700910 unsigned int npages; /* Max length of pagevec */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700911 struct nfs_writeargs args; /* argument struct */
912 struct nfs_writeres res; /* result struct */
913#ifdef CONFIG_NFS_V4
914 unsigned long timestamp; /* For lease renewal */
915#endif
Chuck Lever0d0b5cb2006-05-25 01:40:53 -0400916 struct page *page_array[NFS_PAGEVEC_SIZE];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700917};
918
919struct nfs_access_entry;
920
921/*
922 * RPC procedure vector for NFSv2/NFSv3 demuxing
923 */
924struct nfs_rpc_ops {
Chuck Leverc0e07cb2008-01-14 12:32:05 -0500925 u32 version; /* Protocol version */
Al Virof786aa92009-02-20 05:51:22 +0000926 const struct dentry_operations *dentry_ops;
Arjan van de Venc5ef1c42007-02-12 00:55:40 -0800927 const struct inode_operations *dir_inode_ops;
928 const struct inode_operations *file_inode_ops;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700929
930 int (*getroot) (struct nfs_server *, struct nfs_fh *,
931 struct nfs_fsinfo *);
David Howells2b3de442006-08-22 20:06:09 -0400932 int (*lookupfh)(struct nfs_server *, struct nfs_fh *,
933 struct qstr *, struct nfs_fh *,
934 struct nfs_fattr *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700935 int (*getattr) (struct nfs_server *, struct nfs_fh *,
936 struct nfs_fattr *);
937 int (*setattr) (struct dentry *, struct nfs_fattr *,
938 struct iattr *);
939 int (*lookup) (struct inode *, struct qstr *,
940 struct nfs_fh *, struct nfs_fattr *);
941 int (*access) (struct inode *, struct nfs_access_entry *);
942 int (*readlink)(struct inode *, struct page *, unsigned int,
943 unsigned int);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700944 int (*create) (struct inode *, struct dentry *,
Trond Myklebust02a913a2005-10-18 14:20:17 -0700945 struct iattr *, int, struct nameidata *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700946 int (*remove) (struct inode *, struct qstr *);
Trond Myklebuste4eff1a2007-07-14 15:39:58 -0400947 void (*unlink_setup) (struct rpc_message *, struct inode *dir);
948 int (*unlink_done) (struct rpc_task *, struct inode *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700949 int (*rename) (struct inode *, struct qstr *,
950 struct inode *, struct qstr *);
951 int (*link) (struct inode *, struct inode *, struct qstr *);
Chuck Lever94a6d752006-08-22 20:06:23 -0400952 int (*symlink) (struct inode *, struct dentry *, struct page *,
953 unsigned int, struct iattr *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700954 int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
955 int (*rmdir) (struct inode *, struct qstr *);
956 int (*readdir) (struct dentry *, struct rpc_cred *,
957 u64, struct page *, unsigned int, int);
958 int (*mknod) (struct inode *, struct dentry *, struct iattr *,
959 dev_t);
960 int (*statfs) (struct nfs_server *, struct nfs_fh *,
961 struct nfs_fsstat *);
962 int (*fsinfo) (struct nfs_server *, struct nfs_fh *,
963 struct nfs_fsinfo *);
964 int (*pathconf) (struct nfs_server *, struct nfs_fh *,
965 struct nfs_pathconf *);
David Howellse9326dc2006-08-22 20:06:10 -0400966 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
Al Viro0dbb4c62006-10-19 23:28:49 -0700967 __be32 *(*decode_dirent)(__be32 *, struct nfs_entry *, int plus);
Trond Myklebustbdc7f022007-07-14 15:40:00 -0400968 void (*read_setup) (struct nfs_read_data *, struct rpc_message *);
Trond Myklebustec06c092006-03-20 13:44:27 -0500969 int (*read_done) (struct rpc_task *, struct nfs_read_data *);
Trond Myklebustbdc7f022007-07-14 15:40:00 -0400970 void (*write_setup) (struct nfs_write_data *, struct rpc_message *);
Trond Myklebust788e7a82006-03-20 13:44:27 -0500971 int (*write_done) (struct rpc_task *, struct nfs_write_data *);
Trond Myklebustbdc7f022007-07-14 15:40:00 -0400972 void (*commit_setup) (struct nfs_write_data *, struct rpc_message *);
Trond Myklebust788e7a82006-03-20 13:44:27 -0500973 int (*commit_done) (struct rpc_task *, struct nfs_write_data *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700974 int (*lock)(struct file *, int, struct file_lock *);
Trond Myklebust21162712008-05-20 19:34:39 -0400975 int (*lock_check_bounds)(const struct file_lock *);
Trond Myklebustada70d92005-06-22 17:16:22 +0000976 void (*clear_acl_cache)(struct inode *);
Trond Myklebust7fe5c392009-03-19 15:35:50 -0400977 void (*close_context)(struct nfs_open_context *ctx, int);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700978};
979
980/*
981 * NFS_CALL(getattr, inode, (fattr));
982 * into
983 * NFS_PROTO(inode)->getattr(fattr);
984 */
985#define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args
986
987/*
988 * Function vectors etc. for the NFS client
989 */
David Howells509de812006-08-22 20:06:11 -0400990extern const struct nfs_rpc_ops nfs_v2_clientops;
991extern const struct nfs_rpc_ops nfs_v3_clientops;
992extern const struct nfs_rpc_ops nfs_v4_clientops;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700993extern struct rpc_version nfs_version2;
994extern struct rpc_version nfs_version3;
995extern struct rpc_version nfs_version4;
996
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +0000997extern struct rpc_version nfsacl_version3;
998extern struct rpc_program nfsacl_program;
999
Linus Torvalds1da177e2005-04-16 15:20:36 -07001000#endif