blob: 62f63fb0c4c8d6cd54c8c798e5d7239408d45d34 [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
Andy Adamson2050f0c2009-04-01 09:22:30 -0400177struct nfs4_get_lease_time_args {
178 struct nfs4_sequence_args la_seq_args;
179};
180
181struct nfs4_get_lease_time_res {
182 struct nfs_fsinfo *lr_fsinfo;
183 struct nfs4_sequence_res lr_seq_res;
184};
185
Linus Torvalds1da177e2005-04-16 15:20:36 -0700186/*
187 * Arguments to the open call.
188 */
189struct nfs_openargs {
190 const struct nfs_fh * fh;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700191 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700192 int open_flags;
Trond Myklebustdc0b0272008-12-23 15:21:56 -0500193 fmode_t fmode;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700194 __u64 clientid;
Trond Myklebust9f958ab2007-07-02 13:58:33 -0400195 __u64 id;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700196 union {
197 struct iattr * attrs; /* UNCHECKED, GUARDED */
198 nfs4_verifier verifier; /* EXCLUSIVE */
199 nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */
Trond Myklebustbd7bf9d2008-12-23 15:21:53 -0500200 fmode_t delegation_type; /* CLAIM_PREVIOUS */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700201 } u;
202 const struct qstr * name;
203 const struct nfs_server *server; /* Needed for ID mapping */
204 const u32 * bitmask;
205 __u32 claim;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400206 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700207};
208
209struct nfs_openres {
210 nfs4_stateid stateid;
211 struct nfs_fh fh;
212 struct nfs4_change_info cinfo;
213 __u32 rflags;
214 struct nfs_fattr * f_attr;
Trond Myklebust56ae19f2005-10-27 22:12:40 -0400215 struct nfs_fattr * dir_attr;
Trond Myklebustc1d51932008-04-07 13:20:54 -0400216 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700217 const struct nfs_server *server;
Trond Myklebustbd7bf9d2008-12-23 15:21:53 -0500218 fmode_t delegation_type;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700219 nfs4_stateid delegation;
220 __u32 do_recall;
221 __u64 maxsize;
Jeff Laytonaa53ed52007-06-05 14:49:03 -0400222 __u32 attrset[NFS4_BITMAP_SIZE];
Benny Halevy9ff71c32009-04-01 09:21:52 -0400223 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700224};
225
226/*
227 * Arguments to the open_confirm call.
228 */
229struct nfs_open_confirmargs {
230 const struct nfs_fh * fh;
Trond Myklebustcdd4e682006-01-03 09:55:12 +0100231 nfs4_stateid * stateid;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700232 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700233};
234
235struct nfs_open_confirmres {
236 nfs4_stateid stateid;
Trond Myklebustc1d51932008-04-07 13:20:54 -0400237 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700238};
239
240/*
241 * Arguments to the close call.
242 */
243struct nfs_closeargs {
244 struct nfs_fh * fh;
Trond Myklebust95121352005-10-18 14:20:12 -0700245 nfs4_stateid * stateid;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700246 struct nfs_seqid * seqid;
Trond Myklebustdc0b0272008-12-23 15:21:56 -0500247 fmode_t fmode;
Trond Myklebust516a6af2005-10-27 22:12:41 -0400248 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400249 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700250};
251
252struct nfs_closeres {
253 nfs4_stateid stateid;
Trond Myklebust516a6af2005-10-27 22:12:41 -0400254 struct nfs_fattr * fattr;
Trond Myklebustc1d51932008-04-07 13:20:54 -0400255 struct nfs_seqid * seqid;
Trond Myklebust516a6af2005-10-27 22:12:41 -0400256 const struct nfs_server *server;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400257 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700258};
259/*
260 * * Arguments to the lock,lockt, and locku call.
261 * */
262struct nfs_lowner {
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100263 __u64 clientid;
Trond Myklebust9f958ab2007-07-02 13:58:33 -0400264 __u64 id;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700265};
266
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100267struct nfs_lock_args {
268 struct nfs_fh * fh;
269 struct file_lock * fl;
Trond Myklebust06735b32005-10-18 14:20:15 -0700270 struct nfs_seqid * lock_seqid;
271 nfs4_stateid * lock_stateid;
272 struct nfs_seqid * open_seqid;
273 nfs4_stateid * open_stateid;
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100274 struct nfs_lowner lock_owner;
275 unsigned char block : 1;
276 unsigned char reclaim : 1;
277 unsigned char new_lock_owner : 1;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400278 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700279};
280
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100281struct nfs_lock_res {
Trond Myklebustc1d51932008-04-07 13:20:54 -0400282 nfs4_stateid stateid;
283 struct nfs_seqid * lock_seqid;
284 struct nfs_seqid * open_seqid;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400285 struct nfs4_sequence_res seq_res;
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100286};
287
288struct nfs_locku_args {
289 struct nfs_fh * fh;
290 struct file_lock * fl;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700291 struct nfs_seqid * seqid;
Trond Myklebustfaf5f492005-10-18 14:20:15 -0700292 nfs4_stateid * stateid;
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_locku_res {
Trond Myklebustc1d51932008-04-07 13:20:54 -0400297 nfs4_stateid stateid;
298 struct nfs_seqid * seqid;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400299 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700300};
301
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100302struct nfs_lockt_args {
303 struct nfs_fh * fh;
304 struct file_lock * fl;
305 struct nfs_lowner lock_owner;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400306 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700307};
308
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100309struct nfs_lockt_res {
310 struct file_lock * denied; /* LOCK, LOCKT failed */
Benny Halevy9ff71c32009-04-01 09:21:52 -0400311 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700312};
313
314struct nfs4_delegreturnargs {
315 const struct nfs_fh *fhandle;
316 const nfs4_stateid *stateid;
Trond Myklebustfa178f22006-01-03 09:55:38 +0100317 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400318 struct nfs4_sequence_args seq_args;
Trond Myklebustfa178f22006-01-03 09:55:38 +0100319};
320
321struct nfs4_delegreturnres {
322 struct nfs_fattr * fattr;
323 const struct nfs_server *server;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400324 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700325};
326
327/*
328 * Arguments to the read call.
329 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700330struct nfs_readargs {
331 struct nfs_fh * fh;
332 struct nfs_open_context *context;
333 __u64 offset;
334 __u32 count;
335 unsigned int pgbase;
336 struct page ** pages;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400337 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700338};
339
340struct nfs_readres {
341 struct nfs_fattr * fattr;
342 __u32 count;
343 int eof;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400344 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700345};
346
347/*
348 * Arguments to the write call.
349 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700350struct nfs_writeargs {
351 struct nfs_fh * fh;
352 struct nfs_open_context *context;
353 __u64 offset;
354 __u32 count;
355 enum nfs3_stable_how stable;
356 unsigned int pgbase;
357 struct page ** pages;
Trond Myklebust4f9838c2005-10-27 22:12:44 -0400358 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400359 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700360};
361
362struct nfs_writeverf {
363 enum nfs3_stable_how committed;
Al Virobc4785c2006-10-19 23:28:51 -0700364 __be32 verifier[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700365};
366
367struct nfs_writeres {
368 struct nfs_fattr * fattr;
369 struct nfs_writeverf * verf;
370 __u32 count;
Trond Myklebust4f9838c2005-10-27 22:12:44 -0400371 const struct nfs_server *server;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400372 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700373};
374
375/*
Trond Myklebust4fdc17b2007-07-14 15:39:57 -0400376 * Common arguments to the unlink call
377 */
378struct nfs_removeargs {
379 const struct nfs_fh *fh;
380 struct qstr name;
381 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400382 struct nfs4_sequence_args seq_args;
Trond Myklebust4fdc17b2007-07-14 15:39:57 -0400383};
384
385struct nfs_removeres {
386 const struct nfs_server *server;
387 struct nfs4_change_info cinfo;
388 struct nfs_fattr dir_attr;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400389 struct nfs4_sequence_res seq_res;
Trond Myklebust4fdc17b2007-07-14 15:39:57 -0400390};
391
392/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700393 * Argument struct for decode_entry function
394 */
395struct nfs_entry {
396 __u64 ino;
397 __u64 cookie,
398 prev_cookie;
399 const char * name;
400 unsigned int len;
401 int eof;
402 struct nfs_fh * fh;
403 struct nfs_fattr * fattr;
404};
405
406/*
407 * The following types are for NFSv2 only.
408 */
409struct nfs_sattrargs {
410 struct nfs_fh * fh;
411 struct iattr * sattr;
412};
413
414struct nfs_diropargs {
415 struct nfs_fh * fh;
416 const char * name;
417 unsigned int len;
418};
419
420struct nfs_createargs {
421 struct nfs_fh * fh;
422 const char * name;
423 unsigned int len;
424 struct iattr * sattr;
425};
426
427struct nfs_renameargs {
428 struct nfs_fh * fromfh;
429 const char * fromname;
430 unsigned int fromlen;
431 struct nfs_fh * tofh;
432 const char * toname;
433 unsigned int tolen;
434};
435
436struct nfs_setattrargs {
437 struct nfs_fh * fh;
438 nfs4_stateid stateid;
439 struct iattr * iap;
440 const struct nfs_server * server; /* Needed for name mapping */
441 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400442 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700443};
444
J. Bruce Fields23ec6962005-06-22 17:16:22 +0000445struct nfs_setaclargs {
446 struct nfs_fh * fh;
447 size_t acl_len;
448 unsigned int acl_pgbase;
449 struct page ** acl_pages;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400450 struct nfs4_sequence_args seq_args;
J. Bruce Fields23ec6962005-06-22 17:16:22 +0000451};
452
Benny Halevy73c403a2009-04-01 09:22:01 -0400453struct nfs_setaclres {
454 struct nfs4_sequence_res seq_res;
455};
456
J. Bruce Fields029d1052005-06-22 17:16:22 +0000457struct nfs_getaclargs {
458 struct nfs_fh * fh;
459 size_t acl_len;
460 unsigned int acl_pgbase;
461 struct page ** acl_pages;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400462 struct nfs4_sequence_args seq_args;
J. Bruce Fields029d1052005-06-22 17:16:22 +0000463};
464
Benny Halevy663c79b2009-04-01 09:21:59 -0400465struct nfs_getaclres {
466 size_t acl_len;
467 struct nfs4_sequence_res seq_res;
468};
469
Linus Torvalds1da177e2005-04-16 15:20:36 -0700470struct nfs_setattrres {
471 struct nfs_fattr * fattr;
472 const struct nfs_server * server;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400473 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700474};
475
476struct nfs_linkargs {
477 struct nfs_fh * fromfh;
478 struct nfs_fh * tofh;
479 const char * toname;
480 unsigned int tolen;
481};
482
483struct nfs_symlinkargs {
484 struct nfs_fh * fromfh;
485 const char * fromname;
486 unsigned int fromlen;
Chuck Lever94a6d752006-08-22 20:06:23 -0400487 struct page ** pages;
488 unsigned int pathlen;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700489 struct iattr * sattr;
490};
491
492struct nfs_readdirargs {
493 struct nfs_fh * fh;
494 __u32 cookie;
495 unsigned int count;
496 struct page ** pages;
497};
498
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +0000499struct nfs3_getaclargs {
500 struct nfs_fh * fh;
501 int mask;
502 struct page ** pages;
503};
504
505struct nfs3_setaclargs {
506 struct inode * inode;
507 int mask;
508 struct posix_acl * acl_access;
509 struct posix_acl * acl_default;
Trond Myklebustae461412009-03-10 20:33:18 -0400510 size_t len;
511 unsigned int npages;
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +0000512 struct page ** pages;
513};
514
Linus Torvalds1da177e2005-04-16 15:20:36 -0700515struct nfs_diropok {
516 struct nfs_fh * fh;
517 struct nfs_fattr * fattr;
518};
519
520struct nfs_readlinkargs {
521 struct nfs_fh * fh;
522 unsigned int pgbase;
523 unsigned int pglen;
524 struct page ** pages;
525};
526
527struct nfs3_sattrargs {
528 struct nfs_fh * fh;
529 struct iattr * sattr;
530 unsigned int guard;
531 struct timespec guardtime;
532};
533
534struct nfs3_diropargs {
535 struct nfs_fh * fh;
536 const char * name;
537 unsigned int len;
538};
539
540struct nfs3_accessargs {
541 struct nfs_fh * fh;
542 __u32 access;
543};
544
545struct nfs3_createargs {
546 struct nfs_fh * fh;
547 const char * name;
548 unsigned int len;
549 struct iattr * sattr;
550 enum nfs3_createmode createmode;
Al Virobc4785c2006-10-19 23:28:51 -0700551 __be32 verifier[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700552};
553
554struct nfs3_mkdirargs {
555 struct nfs_fh * fh;
556 const char * name;
557 unsigned int len;
558 struct iattr * sattr;
559};
560
561struct nfs3_symlinkargs {
562 struct nfs_fh * fromfh;
563 const char * fromname;
564 unsigned int fromlen;
Chuck Lever94a6d752006-08-22 20:06:23 -0400565 struct page ** pages;
566 unsigned int pathlen;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700567 struct iattr * sattr;
568};
569
570struct nfs3_mknodargs {
571 struct nfs_fh * fh;
572 const char * name;
573 unsigned int len;
574 enum nfs3_ftype type;
575 struct iattr * sattr;
576 dev_t rdev;
577};
578
579struct nfs3_renameargs {
580 struct nfs_fh * fromfh;
581 const char * fromname;
582 unsigned int fromlen;
583 struct nfs_fh * tofh;
584 const char * toname;
585 unsigned int tolen;
586};
587
588struct nfs3_linkargs {
589 struct nfs_fh * fromfh;
590 struct nfs_fh * tofh;
591 const char * toname;
592 unsigned int tolen;
593};
594
595struct nfs3_readdirargs {
596 struct nfs_fh * fh;
597 __u64 cookie;
Al Virobc4785c2006-10-19 23:28:51 -0700598 __be32 verf[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700599 int plus;
600 unsigned int count;
601 struct page ** pages;
602};
603
604struct nfs3_diropres {
605 struct nfs_fattr * dir_attr;
606 struct nfs_fh * fh;
607 struct nfs_fattr * fattr;
608};
609
610struct nfs3_accessres {
611 struct nfs_fattr * fattr;
612 __u32 access;
613};
614
615struct nfs3_readlinkargs {
616 struct nfs_fh * fh;
617 unsigned int pgbase;
618 unsigned int pglen;
619 struct page ** pages;
620};
621
622struct nfs3_renameres {
623 struct nfs_fattr * fromattr;
624 struct nfs_fattr * toattr;
625};
626
627struct nfs3_linkres {
628 struct nfs_fattr * dir_attr;
629 struct nfs_fattr * fattr;
630};
631
632struct nfs3_readdirres {
633 struct nfs_fattr * dir_attr;
Al Virobc4785c2006-10-19 23:28:51 -0700634 __be32 * verf;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700635 int plus;
636};
637
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +0000638struct nfs3_getaclres {
639 struct nfs_fattr * fattr;
640 int mask;
641 unsigned int acl_access_count;
642 unsigned int acl_default_count;
643 struct posix_acl * acl_access;
644 struct posix_acl * acl_default;
645};
646
Linus Torvalds1da177e2005-04-16 15:20:36 -0700647#ifdef CONFIG_NFS_V4
648
649typedef u64 clientid4;
650
651struct nfs4_accessargs {
652 const struct nfs_fh * fh;
Trond Myklebust76b32992007-08-10 17:45:11 -0400653 const u32 * bitmask;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700654 u32 access;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400655 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700656};
657
658struct nfs4_accessres {
Trond Myklebust76b32992007-08-10 17:45:11 -0400659 const struct nfs_server * server;
660 struct nfs_fattr * fattr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700661 u32 supported;
662 u32 access;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400663 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700664};
665
666struct nfs4_create_arg {
667 u32 ftype;
668 union {
Chuck Lever94a6d752006-08-22 20:06:23 -0400669 struct {
670 struct page ** pages;
671 unsigned int len;
672 } symlink; /* NF4LNK */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700673 struct {
674 u32 specdata1;
675 u32 specdata2;
676 } device; /* NF4BLK, NF4CHR */
677 } u;
678 const struct qstr * name;
679 const struct nfs_server * server;
680 const struct iattr * attrs;
681 const struct nfs_fh * dir_fh;
682 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400683 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700684};
685
686struct nfs4_create_res {
687 const struct nfs_server * server;
688 struct nfs_fh * fh;
689 struct nfs_fattr * fattr;
690 struct nfs4_change_info dir_cinfo;
Trond Myklebust56ae19f2005-10-27 22:12:40 -0400691 struct nfs_fattr * dir_fattr;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400692 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700693};
694
695struct nfs4_fsinfo_arg {
696 const struct nfs_fh * fh;
697 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400698 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700699};
700
Benny Halevy3dda5e42009-04-01 09:21:57 -0400701struct nfs4_fsinfo_res {
702 struct nfs_fsinfo *fsinfo;
703 struct nfs4_sequence_res seq_res;
704};
705
Linus Torvalds1da177e2005-04-16 15:20:36 -0700706struct nfs4_getattr_arg {
707 const struct nfs_fh * fh;
708 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400709 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700710};
711
712struct nfs4_getattr_res {
713 const struct nfs_server * server;
714 struct nfs_fattr * fattr;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400715 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700716};
717
718struct nfs4_link_arg {
719 const struct nfs_fh * fh;
720 const struct nfs_fh * dir_fh;
721 const struct qstr * name;
Trond Myklebust91ba2ee2005-10-27 22:12:42 -0400722 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400723 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700724};
725
Trond Myklebust91ba2ee2005-10-27 22:12:42 -0400726struct nfs4_link_res {
727 const struct nfs_server * server;
728 struct nfs_fattr * fattr;
729 struct nfs4_change_info cinfo;
730 struct nfs_fattr * dir_attr;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400731 struct nfs4_sequence_res seq_res;
Trond Myklebust91ba2ee2005-10-27 22:12:42 -0400732};
733
734
Linus Torvalds1da177e2005-04-16 15:20:36 -0700735struct nfs4_lookup_arg {
736 const struct nfs_fh * dir_fh;
737 const struct qstr * name;
738 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400739 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700740};
741
742struct nfs4_lookup_res {
743 const struct nfs_server * server;
744 struct nfs_fattr * fattr;
745 struct nfs_fh * fh;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400746 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700747};
748
749struct nfs4_lookup_root_arg {
750 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400751 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700752};
753
754struct nfs4_pathconf_arg {
755 const struct nfs_fh * fh;
756 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400757 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700758};
759
Benny Halevyd45b2982009-04-01 09:21:58 -0400760struct nfs4_pathconf_res {
761 struct nfs_pathconf *pathconf;
762 struct nfs4_sequence_res seq_res;
763};
764
Linus Torvalds1da177e2005-04-16 15:20:36 -0700765struct nfs4_readdir_arg {
766 const struct nfs_fh * fh;
767 u64 cookie;
768 nfs4_verifier verifier;
769 u32 count;
770 struct page ** pages; /* zero-copy data */
771 unsigned int pgbase; /* zero-copy data */
772 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400773 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700774};
775
776struct nfs4_readdir_res {
777 nfs4_verifier verifier;
778 unsigned int pgbase;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400779 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700780};
781
782struct nfs4_readlink {
783 const struct nfs_fh * fh;
784 unsigned int pgbase;
785 unsigned int pglen; /* zero-copy data */
786 struct page ** pages; /* zero-copy data */
Benny Halevy9ff71c32009-04-01 09:21:52 -0400787 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700788};
789
Benny Halevyf50c7002009-04-01 09:21:55 -0400790struct nfs4_readlink_res {
791 struct nfs4_sequence_res seq_res;
792};
793
Linus Torvalds1da177e2005-04-16 15:20:36 -0700794struct nfs4_rename_arg {
795 const struct nfs_fh * old_dir;
796 const struct nfs_fh * new_dir;
797 const struct qstr * old_name;
798 const struct qstr * new_name;
Trond Myklebust6caf2c82005-10-27 22:12:43 -0400799 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400800 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700801};
802
803struct nfs4_rename_res {
Trond Myklebust6caf2c82005-10-27 22:12:43 -0400804 const struct nfs_server * server;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700805 struct nfs4_change_info old_cinfo;
Trond Myklebust6caf2c82005-10-27 22:12:43 -0400806 struct nfs_fattr * old_fattr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700807 struct nfs4_change_info new_cinfo;
Trond Myklebust6caf2c82005-10-27 22:12:43 -0400808 struct nfs_fattr * new_fattr;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400809 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700810};
811
Trond Myklebust19d771f2008-10-08 13:54:52 -0400812#define NFS4_SETCLIENTID_NAMELEN (127)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700813struct nfs4_setclientid {
Chuck Levercc38bac2007-12-10 14:56:54 -0500814 const nfs4_verifier * sc_verifier;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700815 unsigned int sc_name_len;
Chuck Leverd1ce02e2008-09-25 11:57:12 -0400816 char sc_name[NFS4_SETCLIENTID_NAMELEN + 1];
Chuck Levercc38bac2007-12-10 14:56:54 -0500817 u32 sc_prog;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700818 unsigned int sc_netid_len;
Chuck Leverd1ce02e2008-09-25 11:57:12 -0400819 char sc_netid[RPCBIND_MAXNETIDLEN + 1];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700820 unsigned int sc_uaddr_len;
Chuck Leverd1ce02e2008-09-25 11:57:12 -0400821 char sc_uaddr[RPCBIND_MAXUADDRLEN + 1];
Chuck Levercc38bac2007-12-10 14:56:54 -0500822 u32 sc_cb_ident;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700823};
824
825struct nfs4_statfs_arg {
826 const struct nfs_fh * fh;
827 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400828 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700829};
830
Benny Halevy24ad1482009-04-01 09:21:56 -0400831struct nfs4_statfs_res {
832 struct nfs_fsstat *fsstat;
833 struct nfs4_sequence_res seq_res;
834};
835
Benny Halevy43652ad2009-04-01 09:21:54 -0400836struct nfs4_server_caps_arg {
837 struct nfs_fh *fhandle;
838 struct nfs4_sequence_args seq_args;
839};
840
Linus Torvalds1da177e2005-04-16 15:20:36 -0700841struct nfs4_server_caps_res {
842 u32 attr_bitmask[2];
843 u32 acl_bitmask;
844 u32 has_links;
845 u32 has_symlinks;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400846 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700847};
848
Manoj Naik7aaa0b32006-06-09 09:34:23 -0400849struct nfs4_string {
850 unsigned int len;
851 char *data;
Trond Myklebust683b57b2006-06-09 09:34:22 -0400852};
853
Manoj Naik7aaa0b32006-06-09 09:34:23 -0400854#define NFS4_PATHNAME_MAXCOMPONENTS 512
855struct nfs4_pathname {
856 unsigned int ncomponents;
857 struct nfs4_string components[NFS4_PATHNAME_MAXCOMPONENTS];
858};
859
860#define NFS4_FS_LOCATION_MAXSERVERS 10
861struct nfs4_fs_location {
862 unsigned int nservers;
863 struct nfs4_string servers[NFS4_FS_LOCATION_MAXSERVERS];
864 struct nfs4_pathname rootpath;
865};
866
867#define NFS4_FS_LOCATIONS_MAXENTRIES 10
868struct nfs4_fs_locations {
Trond Myklebust683b57b2006-06-09 09:34:22 -0400869 struct nfs_fattr fattr;
870 const struct nfs_server *server;
Manoj Naik7aaa0b32006-06-09 09:34:23 -0400871 struct nfs4_pathname fs_path;
Trond Myklebust683b57b2006-06-09 09:34:22 -0400872 int nlocations;
Manoj Naik7aaa0b32006-06-09 09:34:23 -0400873 struct nfs4_fs_location locations[NFS4_FS_LOCATIONS_MAXENTRIES];
Trond Myklebust683b57b2006-06-09 09:34:22 -0400874};
875
876struct nfs4_fs_locations_arg {
877 const struct nfs_fh *dir_fh;
878 const struct qstr *name;
879 struct page *page;
880 const u32 *bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400881 struct nfs4_sequence_args seq_args;
Trond Myklebust683b57b2006-06-09 09:34:22 -0400882};
883
Benny Halevy22958462009-04-01 09:22:02 -0400884struct nfs4_fs_locations_res {
885 struct nfs4_fs_locations *fs_locations;
886 struct nfs4_sequence_res seq_res;
887};
888
Linus Torvalds1da177e2005-04-16 15:20:36 -0700889#endif /* CONFIG_NFS_V4 */
890
Benny Halevy99fe60d2009-04-01 09:22:29 -0400891struct nfstime4 {
892 u64 seconds;
893 u32 nseconds;
894};
895
896#ifdef CONFIG_NFS_V4_1
897struct nfs_impl_id4 {
898 u32 domain_len;
899 char *domain;
900 u32 name_len;
901 char *name;
902 struct nfstime4 date;
903};
904
905#define NFS4_EXCHANGE_ID_LEN (48)
906struct nfs41_exchange_id_args {
907 struct nfs_client *client;
908 nfs4_verifier *verifier;
909 unsigned int id_len;
910 char id[NFS4_EXCHANGE_ID_LEN];
911 u32 flags;
912};
913
914struct server_owner {
915 uint64_t minor_id;
916 uint32_t major_id_sz;
917 char major_id[NFS4_OPAQUE_LIMIT];
918};
919
920struct server_scope {
921 uint32_t server_scope_sz;
922 char server_scope[NFS4_OPAQUE_LIMIT];
923};
924
925struct nfs41_exchange_id_res {
926 struct nfs_client *client;
927 u32 flags;
928};
Andy Adamsonfc931582009-04-01 09:22:31 -0400929
930struct nfs41_create_session_args {
931 struct nfs_client *client;
932 uint32_t flags;
933 uint32_t cb_program;
934 struct nfs4_channel_attrs fc_attrs; /* Fore Channel */
935 struct nfs4_channel_attrs bc_attrs; /* Back Channel */
936};
937
938struct nfs41_create_session_res {
939 struct nfs_client *client;
940};
Benny Halevy99fe60d2009-04-01 09:22:29 -0400941#endif /* CONFIG_NFS_V4_1 */
942
Linus Torvalds1da177e2005-04-16 15:20:36 -0700943struct nfs_page;
944
Chuck Lever40859d72005-11-30 18:09:02 -0500945#define NFS_PAGEVEC_SIZE (8U)
946
Linus Torvalds1da177e2005-04-16 15:20:36 -0700947struct nfs_read_data {
948 int flags;
949 struct rpc_task task;
950 struct inode *inode;
951 struct rpc_cred *cred;
952 struct nfs_fattr fattr; /* fattr storage */
953 struct list_head pages; /* Coalesced read requests */
954 struct nfs_page *req; /* multi ops per nfs_page */
Chuck Lever40859d72005-11-30 18:09:02 -0500955 struct page **pagevec;
Trond Myklebuste9f7bee2006-09-08 09:48:54 -0700956 unsigned int npages; /* Max length of pagevec */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700957 struct nfs_readargs args;
958 struct nfs_readres res;
959#ifdef CONFIG_NFS_V4
960 unsigned long timestamp; /* For lease renewal */
961#endif
Chuck Lever0d0b5cb2006-05-25 01:40:53 -0400962 struct page *page_array[NFS_PAGEVEC_SIZE];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700963};
964
965struct nfs_write_data {
966 int flags;
967 struct rpc_task task;
968 struct inode *inode;
969 struct rpc_cred *cred;
970 struct nfs_fattr fattr;
971 struct nfs_writeverf verf;
972 struct list_head pages; /* Coalesced requests we wish to flush */
973 struct nfs_page *req; /* multi ops per nfs_page */
Chuck Lever40859d72005-11-30 18:09:02 -0500974 struct page **pagevec;
Trond Myklebuste9f7bee2006-09-08 09:48:54 -0700975 unsigned int npages; /* Max length of pagevec */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700976 struct nfs_writeargs args; /* argument struct */
977 struct nfs_writeres res; /* result struct */
978#ifdef CONFIG_NFS_V4
979 unsigned long timestamp; /* For lease renewal */
980#endif
Chuck Lever0d0b5cb2006-05-25 01:40:53 -0400981 struct page *page_array[NFS_PAGEVEC_SIZE];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700982};
983
984struct nfs_access_entry;
985
986/*
987 * RPC procedure vector for NFSv2/NFSv3 demuxing
988 */
989struct nfs_rpc_ops {
Chuck Leverc0e07cb2008-01-14 12:32:05 -0500990 u32 version; /* Protocol version */
Al Virof786aa92009-02-20 05:51:22 +0000991 const struct dentry_operations *dentry_ops;
Arjan van de Venc5ef1c42007-02-12 00:55:40 -0800992 const struct inode_operations *dir_inode_ops;
993 const struct inode_operations *file_inode_ops;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700994
995 int (*getroot) (struct nfs_server *, struct nfs_fh *,
996 struct nfs_fsinfo *);
David Howells2b3de442006-08-22 20:06:09 -0400997 int (*lookupfh)(struct nfs_server *, struct nfs_fh *,
998 struct qstr *, struct nfs_fh *,
999 struct nfs_fattr *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001000 int (*getattr) (struct nfs_server *, struct nfs_fh *,
1001 struct nfs_fattr *);
1002 int (*setattr) (struct dentry *, struct nfs_fattr *,
1003 struct iattr *);
1004 int (*lookup) (struct inode *, struct qstr *,
1005 struct nfs_fh *, struct nfs_fattr *);
1006 int (*access) (struct inode *, struct nfs_access_entry *);
1007 int (*readlink)(struct inode *, struct page *, unsigned int,
1008 unsigned int);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001009 int (*create) (struct inode *, struct dentry *,
Trond Myklebust02a913a2005-10-18 14:20:17 -07001010 struct iattr *, int, struct nameidata *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001011 int (*remove) (struct inode *, struct qstr *);
Trond Myklebuste4eff1a2007-07-14 15:39:58 -04001012 void (*unlink_setup) (struct rpc_message *, struct inode *dir);
1013 int (*unlink_done) (struct rpc_task *, struct inode *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001014 int (*rename) (struct inode *, struct qstr *,
1015 struct inode *, struct qstr *);
1016 int (*link) (struct inode *, struct inode *, struct qstr *);
Chuck Lever94a6d752006-08-22 20:06:23 -04001017 int (*symlink) (struct inode *, struct dentry *, struct page *,
1018 unsigned int, struct iattr *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001019 int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
1020 int (*rmdir) (struct inode *, struct qstr *);
1021 int (*readdir) (struct dentry *, struct rpc_cred *,
1022 u64, struct page *, unsigned int, int);
1023 int (*mknod) (struct inode *, struct dentry *, struct iattr *,
1024 dev_t);
1025 int (*statfs) (struct nfs_server *, struct nfs_fh *,
1026 struct nfs_fsstat *);
1027 int (*fsinfo) (struct nfs_server *, struct nfs_fh *,
1028 struct nfs_fsinfo *);
1029 int (*pathconf) (struct nfs_server *, struct nfs_fh *,
1030 struct nfs_pathconf *);
David Howellse9326dc2006-08-22 20:06:10 -04001031 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
Al Viro0dbb4c62006-10-19 23:28:49 -07001032 __be32 *(*decode_dirent)(__be32 *, struct nfs_entry *, int plus);
Trond Myklebustbdc7f022007-07-14 15:40:00 -04001033 void (*read_setup) (struct nfs_read_data *, struct rpc_message *);
Trond Myklebustec06c092006-03-20 13:44:27 -05001034 int (*read_done) (struct rpc_task *, struct nfs_read_data *);
Trond Myklebustbdc7f022007-07-14 15:40:00 -04001035 void (*write_setup) (struct nfs_write_data *, struct rpc_message *);
Trond Myklebust788e7a82006-03-20 13:44:27 -05001036 int (*write_done) (struct rpc_task *, struct nfs_write_data *);
Trond Myklebustbdc7f022007-07-14 15:40:00 -04001037 void (*commit_setup) (struct nfs_write_data *, struct rpc_message *);
Trond Myklebust788e7a82006-03-20 13:44:27 -05001038 int (*commit_done) (struct rpc_task *, struct nfs_write_data *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001039 int (*lock)(struct file *, int, struct file_lock *);
Trond Myklebust21162712008-05-20 19:34:39 -04001040 int (*lock_check_bounds)(const struct file_lock *);
Trond Myklebustada70d92005-06-22 17:16:22 +00001041 void (*clear_acl_cache)(struct inode *);
Trond Myklebust7fe5c392009-03-19 15:35:50 -04001042 void (*close_context)(struct nfs_open_context *ctx, int);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001043};
1044
1045/*
1046 * NFS_CALL(getattr, inode, (fattr));
1047 * into
1048 * NFS_PROTO(inode)->getattr(fattr);
1049 */
1050#define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args
1051
1052/*
1053 * Function vectors etc. for the NFS client
1054 */
David Howells509de812006-08-22 20:06:11 -04001055extern const struct nfs_rpc_ops nfs_v2_clientops;
1056extern const struct nfs_rpc_ops nfs_v3_clientops;
1057extern const struct nfs_rpc_ops nfs_v4_clientops;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001058extern struct rpc_version nfs_version2;
1059extern struct rpc_version nfs_version3;
1060extern struct rpc_version nfs_version4;
1061
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +00001062extern struct rpc_version nfsacl_version3;
1063extern struct rpc_program nfsacl_program;
1064
Linus Torvalds1da177e2005-04-16 15:20:36 -07001065#endif