blob: da7a1300dc60bb01423cafd64cb8028b7de5dcb2 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _LINUX_NFS_XDR_H
2#define _LINUX_NFS_XDR_H
3
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +00004#include <linux/nfsacl.h>
Boaz Harroshd7031582009-12-03 20:28:47 +02005#include <linux/nfs3.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07006
Chuck Lever40859d72005-11-30 18:09:02 -05007/*
8 * To change the maximum rsize and wsize supported by the NFS client, adjust
9 * NFS_MAX_FILE_IO_SIZE. 64KB is a typical maximum, but some servers can
10 * support a megabyte or more. The default is left at 4096 bytes, which is
11 * reasonable for NFS over UDP.
12 */
13#define NFS_MAX_FILE_IO_SIZE (1048576U)
14#define NFS_DEF_FILE_IO_SIZE (4096U)
15#define NFS_MIN_FILE_IO_SIZE (1024U)
16
Trond Myklebust8b4bdcf2006-06-09 09:34:19 -040017struct nfs_fsid {
18 uint64_t major;
19 uint64_t minor;
Linus Torvalds1da177e2005-04-16 15:20:36 -070020};
21
Trond Myklebust8b4bdcf2006-06-09 09:34:19 -040022/*
23 * Helper for checking equality between 2 fsids.
24 */
25static inline int nfs_fsid_equal(const struct nfs_fsid *a, const struct nfs_fsid *b)
26{
27 return a->major == b->major && a->minor == b->minor;
28}
29
Linus Torvalds1da177e2005-04-16 15:20:36 -070030struct nfs_fattr {
Trond Myklebust9e6e70f2009-03-11 14:10:24 -040031 unsigned int valid; /* which fields are valid */
Trond Myklebustbca794782009-03-11 14:10:26 -040032 umode_t mode;
Linus Torvalds1da177e2005-04-16 15:20:36 -070033 __u32 nlink;
34 __u32 uid;
35 __u32 gid;
Richard Kennedy9fa8d662008-08-26 16:23:20 +010036 dev_t rdev;
Linus Torvalds1da177e2005-04-16 15:20:36 -070037 __u64 size;
38 union {
39 struct {
40 __u32 blocksize;
41 __u32 blocks;
42 } nfs2;
43 struct {
44 __u64 used;
45 } nfs3;
46 } du;
Trond Myklebust8b4bdcf2006-06-09 09:34:19 -040047 struct nfs_fsid fsid;
Linus Torvalds1da177e2005-04-16 15:20:36 -070048 __u64 fileid;
49 struct timespec atime;
50 struct timespec mtime;
51 struct timespec ctime;
Linus Torvalds1da177e2005-04-16 15:20:36 -070052 __u64 change_attr; /* NFSv4 change attribute */
53 __u64 pre_change_attr;/* pre-op NFSv4 change attribute */
Trond Myklebust1ca277d2009-03-11 14:10:25 -040054 __u64 pre_size; /* pre_op_attr.size */
55 struct timespec pre_mtime; /* pre_op_attr.mtime */
56 struct timespec pre_ctime; /* pre_op_attr.ctime */
Trond Myklebust33801142005-10-27 22:12:39 -040057 unsigned long time_start;
Trond Myklebust4704f0e2008-10-14 19:16:07 -040058 unsigned long gencount;
Linus Torvalds1da177e2005-04-16 15:20:36 -070059};
60
Trond Myklebust9e6e70f2009-03-11 14:10:24 -040061#define NFS_ATTR_FATTR_TYPE (1U << 0)
62#define NFS_ATTR_FATTR_MODE (1U << 1)
63#define NFS_ATTR_FATTR_NLINK (1U << 2)
64#define NFS_ATTR_FATTR_OWNER (1U << 3)
65#define NFS_ATTR_FATTR_GROUP (1U << 4)
66#define NFS_ATTR_FATTR_RDEV (1U << 5)
67#define NFS_ATTR_FATTR_SIZE (1U << 6)
68#define NFS_ATTR_FATTR_PRESIZE (1U << 7)
69#define NFS_ATTR_FATTR_BLOCKS_USED (1U << 8)
70#define NFS_ATTR_FATTR_SPACE_USED (1U << 9)
71#define NFS_ATTR_FATTR_FSID (1U << 10)
72#define NFS_ATTR_FATTR_FILEID (1U << 11)
73#define NFS_ATTR_FATTR_ATIME (1U << 12)
74#define NFS_ATTR_FATTR_MTIME (1U << 13)
75#define NFS_ATTR_FATTR_CTIME (1U << 14)
76#define NFS_ATTR_FATTR_PREMTIME (1U << 15)
77#define NFS_ATTR_FATTR_PRECTIME (1U << 16)
78#define NFS_ATTR_FATTR_CHANGE (1U << 17)
79#define NFS_ATTR_FATTR_PRECHANGE (1U << 18)
80#define NFS_ATTR_FATTR_V4_REFERRAL (1U << 19) /* NFSv4 referral */
81
82#define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \
83 | NFS_ATTR_FATTR_MODE \
84 | NFS_ATTR_FATTR_NLINK \
85 | NFS_ATTR_FATTR_OWNER \
86 | NFS_ATTR_FATTR_GROUP \
87 | NFS_ATTR_FATTR_RDEV \
88 | NFS_ATTR_FATTR_SIZE \
89 | NFS_ATTR_FATTR_FSID \
90 | NFS_ATTR_FATTR_FILEID \
91 | NFS_ATTR_FATTR_ATIME \
92 | NFS_ATTR_FATTR_MTIME \
93 | NFS_ATTR_FATTR_CTIME)
94#define NFS_ATTR_FATTR_V2 (NFS_ATTR_FATTR \
95 | NFS_ATTR_FATTR_BLOCKS_USED)
96#define NFS_ATTR_FATTR_V3 (NFS_ATTR_FATTR \
97 | NFS_ATTR_FATTR_SPACE_USED)
98#define NFS_ATTR_FATTR_V4 (NFS_ATTR_FATTR \
99 | NFS_ATTR_FATTR_SPACE_USED \
100 | NFS_ATTR_FATTR_CHANGE)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101
102/*
103 * Info on the file system
104 */
105struct nfs_fsinfo {
106 struct nfs_fattr *fattr; /* Post-op attributes */
107 __u32 rtmax; /* max. read transfer size */
108 __u32 rtpref; /* pref. read transfer size */
109 __u32 rtmult; /* reads should be multiple of this */
110 __u32 wtmax; /* max. write transfer size */
111 __u32 wtpref; /* pref. write transfer size */
112 __u32 wtmult; /* writes should be multiple of this */
113 __u32 dtpref; /* pref. readdir transfer size */
114 __u64 maxfilesize;
Ricardo Labiaga6b967242010-10-12 16:30:05 -0700115 struct timespec time_delta; /* server time granularity */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116 __u32 lease_time; /* in seconds */
117};
118
119struct nfs_fsstat {
120 struct nfs_fattr *fattr; /* Post-op attributes */
121 __u64 tbytes; /* total size in bytes */
122 __u64 fbytes; /* # of free bytes */
123 __u64 abytes; /* # of bytes available to user */
124 __u64 tfiles; /* # of files */
125 __u64 ffiles; /* # of free files */
126 __u64 afiles; /* # of files available to user */
127};
128
129struct nfs2_fsstat {
130 __u32 tsize; /* Server transfer size */
131 __u32 bsize; /* Filesystem block size */
132 __u32 blocks; /* No. of "bsize" blocks on filesystem */
133 __u32 bfree; /* No. of free "bsize" blocks */
134 __u32 bavail; /* No. of available "bsize" blocks */
135};
136
137struct nfs_pathconf {
138 struct nfs_fattr *fattr; /* Post-op attributes */
139 __u32 max_link; /* max # of hard links */
140 __u32 max_namelen; /* max name length */
141};
142
143struct nfs4_change_info {
144 u32 atomic;
145 u64 before;
146 u64 after;
147};
148
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700149struct nfs_seqid;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400150
Andy Adamson557134a2009-04-01 09:21:53 -0400151/* nfs41 sessions channel attributes */
152struct nfs4_channel_attrs {
153 u32 headerpadsz;
154 u32 max_rqst_sz;
155 u32 max_resp_sz;
156 u32 max_resp_sz_cached;
157 u32 max_ops;
158 u32 max_reqs;
159};
160
161/* nfs41 sessions slot seqid */
162struct nfs4_slot {
163 u32 seq_nr;
164};
165
Benny Halevy9ff71c32009-04-01 09:21:52 -0400166struct nfs4_sequence_args {
Benny Halevyf3752972009-04-01 09:22:04 -0400167 struct nfs4_session *sa_session;
Andy Adamsonfbcd4ab2009-04-01 09:22:15 -0400168 u8 sa_slotid;
169 u8 sa_cache_this;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400170};
171
172struct nfs4_sequence_res {
Benny Halevyf3752972009-04-01 09:22:04 -0400173 struct nfs4_session *sr_session;
Benny Halevydfb4f3092010-09-24 09:17:01 -0400174 struct nfs4_slot *sr_slot; /* slot used to send request */
Andy Adamsonfbcd4ab2009-04-01 09:22:15 -0400175 int sr_status; /* sequence operation status */
Richard Kennedya01878a2009-12-03 15:58:56 -0500176 unsigned long sr_renewal_time;
Alexandros Batsakis0629e372009-12-05 13:46:14 -0500177 u32 sr_status_flags;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400178};
179
Andy Adamson2050f0c2009-04-01 09:22:30 -0400180struct nfs4_get_lease_time_args {
181 struct nfs4_sequence_args la_seq_args;
182};
183
184struct nfs4_get_lease_time_res {
185 struct nfs_fsinfo *lr_fsinfo;
186 struct nfs4_sequence_res lr_seq_res;
187};
188
Linus Torvalds1da177e2005-04-16 15:20:36 -0700189/*
190 * Arguments to the open call.
191 */
192struct nfs_openargs {
193 const struct nfs_fh * fh;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700194 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700195 int open_flags;
Trond Myklebustdc0b0272008-12-23 15:21:56 -0500196 fmode_t fmode;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700197 __u64 clientid;
Trond Myklebust9f958ab2007-07-02 13:58:33 -0400198 __u64 id;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700199 union {
Trond Myklebustd77d76f2010-06-16 09:52:27 -0400200 struct {
201 struct iattr * attrs; /* UNCHECKED, GUARDED */
202 nfs4_verifier verifier; /* EXCLUSIVE */
203 };
Linus Torvalds1da177e2005-04-16 15:20:36 -0700204 nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */
Trond Myklebustbd7bf9d2008-12-23 15:21:53 -0500205 fmode_t delegation_type; /* CLAIM_PREVIOUS */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700206 } u;
207 const struct qstr * name;
208 const struct nfs_server *server; /* Needed for ID mapping */
209 const u32 * bitmask;
210 __u32 claim;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400211 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700212};
213
214struct nfs_openres {
215 nfs4_stateid stateid;
216 struct nfs_fh fh;
217 struct nfs4_change_info cinfo;
218 __u32 rflags;
219 struct nfs_fattr * f_attr;
Trond Myklebust56ae19f2005-10-27 22:12:40 -0400220 struct nfs_fattr * dir_attr;
Trond Myklebustc1d51932008-04-07 13:20:54 -0400221 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700222 const struct nfs_server *server;
Trond Myklebustbd7bf9d2008-12-23 15:21:53 -0500223 fmode_t delegation_type;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700224 nfs4_stateid delegation;
225 __u32 do_recall;
226 __u64 maxsize;
Jeff Laytonaa53ed52007-06-05 14:49:03 -0400227 __u32 attrset[NFS4_BITMAP_SIZE];
Benny Halevy9ff71c32009-04-01 09:21:52 -0400228 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700229};
230
231/*
232 * Arguments to the open_confirm call.
233 */
234struct nfs_open_confirmargs {
235 const struct nfs_fh * fh;
Trond Myklebustcdd4e682006-01-03 09:55:12 +0100236 nfs4_stateid * stateid;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700237 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700238};
239
240struct nfs_open_confirmres {
241 nfs4_stateid stateid;
Trond Myklebustc1d51932008-04-07 13:20:54 -0400242 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700243};
244
245/*
246 * Arguments to the close call.
247 */
248struct nfs_closeargs {
249 struct nfs_fh * fh;
Trond Myklebust95121352005-10-18 14:20:12 -0700250 nfs4_stateid * stateid;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700251 struct nfs_seqid * seqid;
Trond Myklebustdc0b0272008-12-23 15:21:56 -0500252 fmode_t fmode;
Trond Myklebust516a6af2005-10-27 22:12:41 -0400253 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400254 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700255};
256
257struct nfs_closeres {
258 nfs4_stateid stateid;
Trond Myklebust516a6af2005-10-27 22:12:41 -0400259 struct nfs_fattr * fattr;
Trond Myklebustc1d51932008-04-07 13:20:54 -0400260 struct nfs_seqid * seqid;
Trond Myklebust516a6af2005-10-27 22:12:41 -0400261 const struct nfs_server *server;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400262 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700263};
264/*
265 * * Arguments to the lock,lockt, and locku call.
266 * */
267struct nfs_lowner {
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100268 __u64 clientid;
Trond Myklebust9f958ab2007-07-02 13:58:33 -0400269 __u64 id;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700270};
271
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100272struct nfs_lock_args {
273 struct nfs_fh * fh;
274 struct file_lock * fl;
Trond Myklebust06735b32005-10-18 14:20:15 -0700275 struct nfs_seqid * lock_seqid;
276 nfs4_stateid * lock_stateid;
277 struct nfs_seqid * open_seqid;
278 nfs4_stateid * open_stateid;
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100279 struct nfs_lowner lock_owner;
280 unsigned char block : 1;
281 unsigned char reclaim : 1;
282 unsigned char new_lock_owner : 1;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400283 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700284};
285
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100286struct nfs_lock_res {
Trond Myklebustc1d51932008-04-07 13:20:54 -0400287 nfs4_stateid stateid;
288 struct nfs_seqid * lock_seqid;
289 struct nfs_seqid * open_seqid;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400290 struct nfs4_sequence_res seq_res;
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100291};
292
293struct nfs_locku_args {
294 struct nfs_fh * fh;
295 struct file_lock * fl;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700296 struct nfs_seqid * seqid;
Trond Myklebustfaf5f492005-10-18 14:20:15 -0700297 nfs4_stateid * stateid;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400298 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700299};
300
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100301struct nfs_locku_res {
Trond Myklebustc1d51932008-04-07 13:20:54 -0400302 nfs4_stateid stateid;
303 struct nfs_seqid * seqid;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400304 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700305};
306
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100307struct nfs_lockt_args {
308 struct nfs_fh * fh;
309 struct file_lock * fl;
310 struct nfs_lowner lock_owner;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400311 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700312};
313
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100314struct nfs_lockt_res {
315 struct file_lock * denied; /* LOCK, LOCKT failed */
Benny Halevy9ff71c32009-04-01 09:21:52 -0400316 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700317};
318
Trond Myklebustd3c7b7c2010-07-01 12:49:01 -0400319struct nfs_release_lockowner_args {
320 struct nfs_lowner lock_owner;
321};
322
Linus Torvalds1da177e2005-04-16 15:20:36 -0700323struct nfs4_delegreturnargs {
324 const struct nfs_fh *fhandle;
325 const nfs4_stateid *stateid;
Trond Myklebustfa178f22006-01-03 09:55:38 +0100326 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400327 struct nfs4_sequence_args seq_args;
Trond Myklebustfa178f22006-01-03 09:55:38 +0100328};
329
330struct nfs4_delegreturnres {
331 struct nfs_fattr * fattr;
332 const struct nfs_server *server;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400333 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700334};
335
336/*
337 * Arguments to the read call.
338 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700339struct nfs_readargs {
340 struct nfs_fh * fh;
341 struct nfs_open_context *context;
Trond Myklebustf11ac8d2010-06-25 16:35:53 -0400342 struct nfs_lock_context *lock_context;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700343 __u64 offset;
344 __u32 count;
345 unsigned int pgbase;
346 struct page ** pages;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400347 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700348};
349
350struct nfs_readres {
351 struct nfs_fattr * fattr;
352 __u32 count;
353 int eof;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400354 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700355};
356
357/*
358 * Arguments to the write call.
359 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700360struct nfs_writeargs {
361 struct nfs_fh * fh;
362 struct nfs_open_context *context;
Trond Myklebustf11ac8d2010-06-25 16:35:53 -0400363 struct nfs_lock_context *lock_context;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700364 __u64 offset;
365 __u32 count;
366 enum nfs3_stable_how stable;
367 unsigned int pgbase;
368 struct page ** pages;
Trond Myklebust4f9838c2005-10-27 22:12:44 -0400369 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400370 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700371};
372
373struct nfs_writeverf {
374 enum nfs3_stable_how committed;
Al Virobc4785c2006-10-19 23:28:51 -0700375 __be32 verifier[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700376};
377
378struct nfs_writeres {
379 struct nfs_fattr * fattr;
380 struct nfs_writeverf * verf;
381 __u32 count;
Trond Myklebust4f9838c2005-10-27 22:12:44 -0400382 const struct nfs_server *server;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400383 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700384};
385
386/*
Trond Myklebust4fdc17b2007-07-14 15:39:57 -0400387 * Common arguments to the unlink call
388 */
389struct nfs_removeargs {
390 const struct nfs_fh *fh;
391 struct qstr name;
392 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400393 struct nfs4_sequence_args seq_args;
Trond Myklebust4fdc17b2007-07-14 15:39:57 -0400394};
395
396struct nfs_removeres {
397 const struct nfs_server *server;
Trond Myklebustd3468902010-04-16 16:22:50 -0400398 struct nfs_fattr *dir_attr;
Trond Myklebust4fdc17b2007-07-14 15:39:57 -0400399 struct nfs4_change_info cinfo;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400400 struct nfs4_sequence_res seq_res;
Trond Myklebust4fdc17b2007-07-14 15:39:57 -0400401};
402
403/*
Jeff Layton920769f2010-09-17 17:30:25 -0400404 * Common arguments to the rename call
405 */
406struct nfs_renameargs {
407 const struct nfs_fh *old_dir;
408 const struct nfs_fh *new_dir;
409 const struct qstr *old_name;
410 const struct qstr *new_name;
411 const u32 *bitmask;
412 struct nfs4_sequence_args seq_args;
413};
414
Jeff Laytone8582a82010-09-17 17:31:06 -0400415struct nfs_renameres {
416 const struct nfs_server *server;
417 struct nfs4_change_info old_cinfo;
418 struct nfs_fattr *old_fattr;
419 struct nfs4_change_info new_cinfo;
420 struct nfs_fattr *new_fattr;
421 struct nfs4_sequence_res seq_res;
422};
423
Jeff Layton920769f2010-09-17 17:30:25 -0400424/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700425 * Argument struct for decode_entry function
426 */
427struct nfs_entry {
428 __u64 ino;
429 __u64 cookie,
430 prev_cookie;
431 const char * name;
432 unsigned int len;
433 int eof;
434 struct nfs_fh * fh;
435 struct nfs_fattr * fattr;
436};
437
438/*
439 * The following types are for NFSv2 only.
440 */
441struct nfs_sattrargs {
442 struct nfs_fh * fh;
443 struct iattr * sattr;
444};
445
446struct nfs_diropargs {
447 struct nfs_fh * fh;
448 const char * name;
449 unsigned int len;
450};
451
452struct nfs_createargs {
453 struct nfs_fh * fh;
454 const char * name;
455 unsigned int len;
456 struct iattr * sattr;
457};
458
Linus Torvalds1da177e2005-04-16 15:20:36 -0700459struct nfs_setattrargs {
460 struct nfs_fh * fh;
461 nfs4_stateid stateid;
462 struct iattr * iap;
463 const struct nfs_server * server; /* Needed for name mapping */
464 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400465 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700466};
467
J. Bruce Fields23ec6962005-06-22 17:16:22 +0000468struct nfs_setaclargs {
469 struct nfs_fh * fh;
470 size_t acl_len;
471 unsigned int acl_pgbase;
472 struct page ** acl_pages;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400473 struct nfs4_sequence_args seq_args;
J. Bruce Fields23ec6962005-06-22 17:16:22 +0000474};
475
Benny Halevy73c403a2009-04-01 09:22:01 -0400476struct nfs_setaclres {
477 struct nfs4_sequence_res seq_res;
478};
479
J. Bruce Fields029d1052005-06-22 17:16:22 +0000480struct nfs_getaclargs {
481 struct nfs_fh * fh;
482 size_t acl_len;
483 unsigned int acl_pgbase;
484 struct page ** acl_pages;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400485 struct nfs4_sequence_args seq_args;
J. Bruce Fields029d1052005-06-22 17:16:22 +0000486};
487
Benny Halevy663c79b2009-04-01 09:21:59 -0400488struct nfs_getaclres {
489 size_t acl_len;
490 struct nfs4_sequence_res seq_res;
491};
492
Linus Torvalds1da177e2005-04-16 15:20:36 -0700493struct nfs_setattrres {
494 struct nfs_fattr * fattr;
495 const struct nfs_server * server;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400496 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700497};
498
499struct nfs_linkargs {
500 struct nfs_fh * fromfh;
501 struct nfs_fh * tofh;
502 const char * toname;
503 unsigned int tolen;
504};
505
506struct nfs_symlinkargs {
507 struct nfs_fh * fromfh;
508 const char * fromname;
509 unsigned int fromlen;
Chuck Lever94a6d752006-08-22 20:06:23 -0400510 struct page ** pages;
511 unsigned int pathlen;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700512 struct iattr * sattr;
513};
514
515struct nfs_readdirargs {
516 struct nfs_fh * fh;
517 __u32 cookie;
518 unsigned int count;
519 struct page ** pages;
520};
521
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +0000522struct nfs3_getaclargs {
523 struct nfs_fh * fh;
524 int mask;
525 struct page ** pages;
526};
527
528struct nfs3_setaclargs {
529 struct inode * inode;
530 int mask;
531 struct posix_acl * acl_access;
532 struct posix_acl * acl_default;
Trond Myklebustae461412009-03-10 20:33:18 -0400533 size_t len;
534 unsigned int npages;
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +0000535 struct page ** pages;
536};
537
Linus Torvalds1da177e2005-04-16 15:20:36 -0700538struct nfs_diropok {
539 struct nfs_fh * fh;
540 struct nfs_fattr * fattr;
541};
542
543struct nfs_readlinkargs {
544 struct nfs_fh * fh;
545 unsigned int pgbase;
546 unsigned int pglen;
547 struct page ** pages;
548};
549
550struct nfs3_sattrargs {
551 struct nfs_fh * fh;
552 struct iattr * sattr;
553 unsigned int guard;
554 struct timespec guardtime;
555};
556
557struct nfs3_diropargs {
558 struct nfs_fh * fh;
559 const char * name;
560 unsigned int len;
561};
562
563struct nfs3_accessargs {
564 struct nfs_fh * fh;
565 __u32 access;
566};
567
568struct nfs3_createargs {
569 struct nfs_fh * fh;
570 const char * name;
571 unsigned int len;
572 struct iattr * sattr;
573 enum nfs3_createmode createmode;
Al Virobc4785c2006-10-19 23:28:51 -0700574 __be32 verifier[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700575};
576
577struct nfs3_mkdirargs {
578 struct nfs_fh * fh;
579 const char * name;
580 unsigned int len;
581 struct iattr * sattr;
582};
583
584struct nfs3_symlinkargs {
585 struct nfs_fh * fromfh;
586 const char * fromname;
587 unsigned int fromlen;
Chuck Lever94a6d752006-08-22 20:06:23 -0400588 struct page ** pages;
589 unsigned int pathlen;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700590 struct iattr * sattr;
591};
592
593struct nfs3_mknodargs {
594 struct nfs_fh * fh;
595 const char * name;
596 unsigned int len;
597 enum nfs3_ftype type;
598 struct iattr * sattr;
599 dev_t rdev;
600};
601
Linus Torvalds1da177e2005-04-16 15:20:36 -0700602struct nfs3_linkargs {
603 struct nfs_fh * fromfh;
604 struct nfs_fh * tofh;
605 const char * toname;
606 unsigned int tolen;
607};
608
609struct nfs3_readdirargs {
610 struct nfs_fh * fh;
611 __u64 cookie;
Al Virobc4785c2006-10-19 23:28:51 -0700612 __be32 verf[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700613 int plus;
614 unsigned int count;
615 struct page ** pages;
616};
617
618struct nfs3_diropres {
619 struct nfs_fattr * dir_attr;
620 struct nfs_fh * fh;
621 struct nfs_fattr * fattr;
622};
623
624struct nfs3_accessres {
625 struct nfs_fattr * fattr;
626 __u32 access;
627};
628
629struct nfs3_readlinkargs {
630 struct nfs_fh * fh;
631 unsigned int pgbase;
632 unsigned int pglen;
633 struct page ** pages;
634};
635
Linus Torvalds1da177e2005-04-16 15:20:36 -0700636struct nfs3_linkres {
637 struct nfs_fattr * dir_attr;
638 struct nfs_fattr * fattr;
639};
640
641struct nfs3_readdirres {
642 struct nfs_fattr * dir_attr;
Al Virobc4785c2006-10-19 23:28:51 -0700643 __be32 * verf;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700644 int plus;
645};
646
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +0000647struct nfs3_getaclres {
648 struct nfs_fattr * fattr;
649 int mask;
650 unsigned int acl_access_count;
651 unsigned int acl_default_count;
652 struct posix_acl * acl_access;
653 struct posix_acl * acl_default;
654};
655
Linus Torvalds1da177e2005-04-16 15:20:36 -0700656#ifdef CONFIG_NFS_V4
657
658typedef u64 clientid4;
659
660struct nfs4_accessargs {
661 const struct nfs_fh * fh;
Trond Myklebust76b32992007-08-10 17:45:11 -0400662 const u32 * bitmask;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700663 u32 access;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400664 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700665};
666
667struct nfs4_accessres {
Trond Myklebust76b32992007-08-10 17:45:11 -0400668 const struct nfs_server * server;
669 struct nfs_fattr * fattr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700670 u32 supported;
671 u32 access;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400672 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700673};
674
675struct nfs4_create_arg {
676 u32 ftype;
677 union {
Chuck Lever94a6d752006-08-22 20:06:23 -0400678 struct {
679 struct page ** pages;
680 unsigned int len;
681 } symlink; /* NF4LNK */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700682 struct {
683 u32 specdata1;
684 u32 specdata2;
685 } device; /* NF4BLK, NF4CHR */
686 } u;
687 const struct qstr * name;
688 const struct nfs_server * server;
689 const struct iattr * attrs;
690 const struct nfs_fh * dir_fh;
691 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400692 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700693};
694
695struct nfs4_create_res {
696 const struct nfs_server * server;
697 struct nfs_fh * fh;
698 struct nfs_fattr * fattr;
699 struct nfs4_change_info dir_cinfo;
Trond Myklebust56ae19f2005-10-27 22:12:40 -0400700 struct nfs_fattr * dir_fattr;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400701 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700702};
703
704struct nfs4_fsinfo_arg {
705 const struct nfs_fh * fh;
706 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400707 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700708};
709
Benny Halevy3dda5e42009-04-01 09:21:57 -0400710struct nfs4_fsinfo_res {
711 struct nfs_fsinfo *fsinfo;
712 struct nfs4_sequence_res seq_res;
713};
714
Linus Torvalds1da177e2005-04-16 15:20:36 -0700715struct nfs4_getattr_arg {
716 const struct nfs_fh * fh;
717 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400718 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700719};
720
721struct nfs4_getattr_res {
722 const struct nfs_server * server;
723 struct nfs_fattr * fattr;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400724 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700725};
726
727struct nfs4_link_arg {
728 const struct nfs_fh * fh;
729 const struct nfs_fh * dir_fh;
730 const struct qstr * name;
Trond Myklebust91ba2ee2005-10-27 22:12:42 -0400731 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400732 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700733};
734
Trond Myklebust91ba2ee2005-10-27 22:12:42 -0400735struct nfs4_link_res {
736 const struct nfs_server * server;
737 struct nfs_fattr * fattr;
738 struct nfs4_change_info cinfo;
739 struct nfs_fattr * dir_attr;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400740 struct nfs4_sequence_res seq_res;
Trond Myklebust91ba2ee2005-10-27 22:12:42 -0400741};
742
743
Linus Torvalds1da177e2005-04-16 15:20:36 -0700744struct nfs4_lookup_arg {
745 const struct nfs_fh * dir_fh;
746 const struct qstr * name;
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
751struct nfs4_lookup_res {
752 const struct nfs_server * server;
753 struct nfs_fattr * fattr;
754 struct nfs_fh * fh;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400755 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700756};
757
758struct nfs4_lookup_root_arg {
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_pathconf_arg {
764 const struct nfs_fh * fh;
765 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400766 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700767};
768
Benny Halevyd45b2982009-04-01 09:21:58 -0400769struct nfs4_pathconf_res {
770 struct nfs_pathconf *pathconf;
771 struct nfs4_sequence_res seq_res;
772};
773
Linus Torvalds1da177e2005-04-16 15:20:36 -0700774struct nfs4_readdir_arg {
775 const struct nfs_fh * fh;
776 u64 cookie;
777 nfs4_verifier verifier;
778 u32 count;
779 struct page ** pages; /* zero-copy data */
780 unsigned int pgbase; /* zero-copy data */
781 const u32 * bitmask;
Bryan Schumaker82f2e542010-10-21 16:33:18 -0400782 int plus;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400783 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700784};
785
786struct nfs4_readdir_res {
787 nfs4_verifier verifier;
788 unsigned int pgbase;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400789 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700790};
791
792struct nfs4_readlink {
793 const struct nfs_fh * fh;
794 unsigned int pgbase;
795 unsigned int pglen; /* zero-copy data */
796 struct page ** pages; /* zero-copy data */
Benny Halevy9ff71c32009-04-01 09:21:52 -0400797 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700798};
799
Benny Halevyf50c7002009-04-01 09:21:55 -0400800struct nfs4_readlink_res {
801 struct nfs4_sequence_res seq_res;
802};
803
Trond Myklebust19d771f2008-10-08 13:54:52 -0400804#define NFS4_SETCLIENTID_NAMELEN (127)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700805struct nfs4_setclientid {
Chuck Levercc38bac2007-12-10 14:56:54 -0500806 const nfs4_verifier * sc_verifier;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700807 unsigned int sc_name_len;
Chuck Leverd1ce02e2008-09-25 11:57:12 -0400808 char sc_name[NFS4_SETCLIENTID_NAMELEN + 1];
Chuck Levercc38bac2007-12-10 14:56:54 -0500809 u32 sc_prog;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700810 unsigned int sc_netid_len;
Chuck Leverd1ce02e2008-09-25 11:57:12 -0400811 char sc_netid[RPCBIND_MAXNETIDLEN + 1];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700812 unsigned int sc_uaddr_len;
Chuck Leverd1ce02e2008-09-25 11:57:12 -0400813 char sc_uaddr[RPCBIND_MAXUADDRLEN + 1];
Chuck Levercc38bac2007-12-10 14:56:54 -0500814 u32 sc_cb_ident;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700815};
816
Trond Myklebustbb8b27e2010-04-16 16:43:06 -0400817struct nfs4_setclientid_res {
818 u64 clientid;
819 nfs4_verifier confirm;
820};
821
Linus Torvalds1da177e2005-04-16 15:20:36 -0700822struct nfs4_statfs_arg {
823 const struct nfs_fh * fh;
824 const u32 * bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400825 struct nfs4_sequence_args seq_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700826};
827
Benny Halevy24ad1482009-04-01 09:21:56 -0400828struct nfs4_statfs_res {
829 struct nfs_fsstat *fsstat;
830 struct nfs4_sequence_res seq_res;
831};
832
Benny Halevy43652ad2009-04-01 09:21:54 -0400833struct nfs4_server_caps_arg {
834 struct nfs_fh *fhandle;
835 struct nfs4_sequence_args seq_args;
836};
837
Linus Torvalds1da177e2005-04-16 15:20:36 -0700838struct nfs4_server_caps_res {
839 u32 attr_bitmask[2];
840 u32 acl_bitmask;
841 u32 has_links;
842 u32 has_symlinks;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400843 struct nfs4_sequence_res seq_res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700844};
845
Manoj Naik7aaa0b32006-06-09 09:34:23 -0400846struct nfs4_string {
847 unsigned int len;
848 char *data;
Trond Myklebust683b57b2006-06-09 09:34:22 -0400849};
850
Manoj Naik7aaa0b32006-06-09 09:34:23 -0400851#define NFS4_PATHNAME_MAXCOMPONENTS 512
852struct nfs4_pathname {
853 unsigned int ncomponents;
854 struct nfs4_string components[NFS4_PATHNAME_MAXCOMPONENTS];
855};
856
857#define NFS4_FS_LOCATION_MAXSERVERS 10
858struct nfs4_fs_location {
859 unsigned int nservers;
860 struct nfs4_string servers[NFS4_FS_LOCATION_MAXSERVERS];
861 struct nfs4_pathname rootpath;
862};
863
864#define NFS4_FS_LOCATIONS_MAXENTRIES 10
865struct nfs4_fs_locations {
Trond Myklebust683b57b2006-06-09 09:34:22 -0400866 struct nfs_fattr fattr;
867 const struct nfs_server *server;
Manoj Naik7aaa0b32006-06-09 09:34:23 -0400868 struct nfs4_pathname fs_path;
Trond Myklebust683b57b2006-06-09 09:34:22 -0400869 int nlocations;
Manoj Naik7aaa0b32006-06-09 09:34:23 -0400870 struct nfs4_fs_location locations[NFS4_FS_LOCATIONS_MAXENTRIES];
Trond Myklebust683b57b2006-06-09 09:34:22 -0400871};
872
873struct nfs4_fs_locations_arg {
874 const struct nfs_fh *dir_fh;
875 const struct qstr *name;
876 struct page *page;
877 const u32 *bitmask;
Benny Halevy9ff71c32009-04-01 09:21:52 -0400878 struct nfs4_sequence_args seq_args;
Trond Myklebust683b57b2006-06-09 09:34:22 -0400879};
880
Benny Halevy22958462009-04-01 09:22:02 -0400881struct nfs4_fs_locations_res {
882 struct nfs4_fs_locations *fs_locations;
883 struct nfs4_sequence_res seq_res;
884};
885
Linus Torvalds1da177e2005-04-16 15:20:36 -0700886#endif /* CONFIG_NFS_V4 */
887
Benny Halevy99fe60d2009-04-01 09:22:29 -0400888struct nfstime4 {
889 u64 seconds;
890 u32 nseconds;
891};
892
893#ifdef CONFIG_NFS_V4_1
894struct nfs_impl_id4 {
895 u32 domain_len;
896 char *domain;
897 u32 name_len;
898 char *name;
899 struct nfstime4 date;
900};
901
902#define NFS4_EXCHANGE_ID_LEN (48)
903struct nfs41_exchange_id_args {
904 struct nfs_client *client;
905 nfs4_verifier *verifier;
906 unsigned int id_len;
907 char id[NFS4_EXCHANGE_ID_LEN];
908 u32 flags;
909};
910
911struct server_owner {
912 uint64_t minor_id;
913 uint32_t major_id_sz;
914 char major_id[NFS4_OPAQUE_LIMIT];
915};
916
917struct server_scope {
918 uint32_t server_scope_sz;
919 char server_scope[NFS4_OPAQUE_LIMIT];
920};
921
922struct nfs41_exchange_id_res {
923 struct nfs_client *client;
924 u32 flags;
925};
Andy Adamsonfc931582009-04-01 09:22:31 -0400926
927struct nfs41_create_session_args {
928 struct nfs_client *client;
929 uint32_t flags;
930 uint32_t cb_program;
931 struct nfs4_channel_attrs fc_attrs; /* Fore Channel */
932 struct nfs4_channel_attrs bc_attrs; /* Back Channel */
933};
934
935struct nfs41_create_session_res {
936 struct nfs_client *client;
937};
Ricardo Labiaga18019752009-12-05 16:08:40 -0500938
939struct nfs41_reclaim_complete_args {
940 /* In the future extend to include curr_fh for use with migration */
941 unsigned char one_fs:1;
942 struct nfs4_sequence_args seq_args;
943};
944
945struct nfs41_reclaim_complete_res {
946 struct nfs4_sequence_res seq_res;
947};
Benny Halevy99fe60d2009-04-01 09:22:29 -0400948#endif /* CONFIG_NFS_V4_1 */
949
Linus Torvalds1da177e2005-04-16 15:20:36 -0700950struct nfs_page;
951
Chuck Lever40859d72005-11-30 18:09:02 -0500952#define NFS_PAGEVEC_SIZE (8U)
953
Linus Torvalds1da177e2005-04-16 15:20:36 -0700954struct nfs_read_data {
955 int flags;
956 struct rpc_task task;
957 struct inode *inode;
958 struct rpc_cred *cred;
959 struct nfs_fattr fattr; /* fattr storage */
960 struct list_head pages; /* Coalesced read requests */
961 struct nfs_page *req; /* multi ops per nfs_page */
Chuck Lever40859d72005-11-30 18:09:02 -0500962 struct page **pagevec;
Trond Myklebuste9f7bee2006-09-08 09:48:54 -0700963 unsigned int npages; /* Max length of pagevec */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700964 struct nfs_readargs args;
965 struct nfs_readres res;
966#ifdef CONFIG_NFS_V4
967 unsigned long timestamp; /* For lease renewal */
968#endif
Chuck Lever0d0b5cb2006-05-25 01:40:53 -0400969 struct page *page_array[NFS_PAGEVEC_SIZE];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700970};
971
972struct nfs_write_data {
973 int flags;
974 struct rpc_task task;
975 struct inode *inode;
976 struct rpc_cred *cred;
977 struct nfs_fattr fattr;
978 struct nfs_writeverf verf;
979 struct list_head pages; /* Coalesced requests we wish to flush */
980 struct nfs_page *req; /* multi ops per nfs_page */
Chuck Lever40859d72005-11-30 18:09:02 -0500981 struct page **pagevec;
Trond Myklebuste9f7bee2006-09-08 09:48:54 -0700982 unsigned int npages; /* Max length of pagevec */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700983 struct nfs_writeargs args; /* argument struct */
984 struct nfs_writeres res; /* result struct */
985#ifdef CONFIG_NFS_V4
986 unsigned long timestamp; /* For lease renewal */
987#endif
Chuck Lever0d0b5cb2006-05-25 01:40:53 -0400988 struct page *page_array[NFS_PAGEVEC_SIZE];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700989};
990
991struct nfs_access_entry;
992
993/*
994 * RPC procedure vector for NFSv2/NFSv3 demuxing
995 */
996struct nfs_rpc_ops {
Chuck Leverc0e07cb2008-01-14 12:32:05 -0500997 u32 version; /* Protocol version */
Al Virof786aa92009-02-20 05:51:22 +0000998 const struct dentry_operations *dentry_ops;
Arjan van de Venc5ef1c42007-02-12 00:55:40 -0800999 const struct inode_operations *dir_inode_ops;
1000 const struct inode_operations *file_inode_ops;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001001
1002 int (*getroot) (struct nfs_server *, struct nfs_fh *,
1003 struct nfs_fsinfo *);
David Howells2b3de442006-08-22 20:06:09 -04001004 int (*lookupfh)(struct nfs_server *, struct nfs_fh *,
1005 struct qstr *, struct nfs_fh *,
1006 struct nfs_fattr *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001007 int (*getattr) (struct nfs_server *, struct nfs_fh *,
1008 struct nfs_fattr *);
1009 int (*setattr) (struct dentry *, struct nfs_fattr *,
1010 struct iattr *);
1011 int (*lookup) (struct inode *, struct qstr *,
1012 struct nfs_fh *, struct nfs_fattr *);
1013 int (*access) (struct inode *, struct nfs_access_entry *);
1014 int (*readlink)(struct inode *, struct page *, unsigned int,
1015 unsigned int);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001016 int (*create) (struct inode *, struct dentry *,
Trond Myklebustc0204fd2010-09-17 10:56:51 -04001017 struct iattr *, int, struct nfs_open_context *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001018 int (*remove) (struct inode *, struct qstr *);
Trond Myklebuste4eff1a2007-07-14 15:39:58 -04001019 void (*unlink_setup) (struct rpc_message *, struct inode *dir);
1020 int (*unlink_done) (struct rpc_task *, struct inode *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001021 int (*rename) (struct inode *, struct qstr *,
1022 struct inode *, struct qstr *);
Jeff Laytond3d41522010-09-17 17:31:57 -04001023 void (*rename_setup) (struct rpc_message *msg, struct inode *dir);
1024 int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001025 int (*link) (struct inode *, struct inode *, struct qstr *);
Chuck Lever94a6d752006-08-22 20:06:23 -04001026 int (*symlink) (struct inode *, struct dentry *, struct page *,
1027 unsigned int, struct iattr *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001028 int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
1029 int (*rmdir) (struct inode *, struct qstr *);
1030 int (*readdir) (struct dentry *, struct rpc_cred *,
Bryan Schumaker56e4ebf2010-10-20 15:44:37 -04001031 u64, struct page **, unsigned int, int);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001032 int (*mknod) (struct inode *, struct dentry *, struct iattr *,
1033 dev_t);
1034 int (*statfs) (struct nfs_server *, struct nfs_fh *,
1035 struct nfs_fsstat *);
1036 int (*fsinfo) (struct nfs_server *, struct nfs_fh *,
1037 struct nfs_fsinfo *);
1038 int (*pathconf) (struct nfs_server *, struct nfs_fh *,
1039 struct nfs_pathconf *);
David Howellse9326dc2006-08-22 20:06:10 -04001040 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
Bryan Schumaker82f2e542010-10-21 16:33:18 -04001041 __be32 *(*decode_dirent)(struct xdr_stream *, struct nfs_entry *, struct nfs_server *, int plus);
Trond Myklebustbdc7f022007-07-14 15:40:00 -04001042 void (*read_setup) (struct nfs_read_data *, struct rpc_message *);
Trond Myklebustec06c092006-03-20 13:44:27 -05001043 int (*read_done) (struct rpc_task *, struct nfs_read_data *);
Trond Myklebustbdc7f022007-07-14 15:40:00 -04001044 void (*write_setup) (struct nfs_write_data *, struct rpc_message *);
Trond Myklebust788e7a82006-03-20 13:44:27 -05001045 int (*write_done) (struct rpc_task *, struct nfs_write_data *);
Trond Myklebustbdc7f022007-07-14 15:40:00 -04001046 void (*commit_setup) (struct nfs_write_data *, struct rpc_message *);
Trond Myklebust788e7a82006-03-20 13:44:27 -05001047 int (*commit_done) (struct rpc_task *, struct nfs_write_data *);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001048 int (*lock)(struct file *, int, struct file_lock *);
Trond Myklebust21162712008-05-20 19:34:39 -04001049 int (*lock_check_bounds)(const struct file_lock *);
Trond Myklebustada70d92005-06-22 17:16:22 +00001050 void (*clear_acl_cache)(struct inode *);
Trond Myklebust7fe5c392009-03-19 15:35:50 -04001051 void (*close_context)(struct nfs_open_context *ctx, int);
Trond Myklebust2b484292010-09-17 10:56:51 -04001052 struct inode * (*open_context) (struct inode *dir,
1053 struct nfs_open_context *ctx,
1054 int open_flags,
1055 struct iattr *iattr);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001056};
1057
1058/*
1059 * NFS_CALL(getattr, inode, (fattr));
1060 * into
1061 * NFS_PROTO(inode)->getattr(fattr);
1062 */
1063#define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args
1064
1065/*
1066 * Function vectors etc. for the NFS client
1067 */
David Howells509de812006-08-22 20:06:11 -04001068extern const struct nfs_rpc_ops nfs_v2_clientops;
1069extern const struct nfs_rpc_ops nfs_v3_clientops;
1070extern const struct nfs_rpc_ops nfs_v4_clientops;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001071extern struct rpc_version nfs_version2;
1072extern struct rpc_version nfs_version3;
1073extern struct rpc_version nfs_version4;
1074
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +00001075extern struct rpc_version nfsacl_version3;
1076extern struct rpc_program nfsacl_program;
1077
Linus Torvalds1da177e2005-04-16 15:20:36 -07001078#endif