blob: 9f422fd876738ac4bb2ff41a568945f791672a83 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _LINUX_NFS_XDR_H
2#define _LINUX_NFS_XDR_H
3
4#include <linux/sunrpc/xprt.h>
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +00005#include <linux/nfsacl.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
Linus Torvalds1da177e2005-04-16 15:20:36 -070017struct nfs4_fsid {
18 __u64 major;
19 __u64 minor;
20};
21
22struct nfs_fattr {
23 unsigned short valid; /* which fields are valid */
24 __u64 pre_size; /* pre_op_attr.size */
25 struct timespec pre_mtime; /* pre_op_attr.mtime */
26 struct timespec pre_ctime; /* pre_op_attr.ctime */
27 enum nfs_ftype type; /* always use NFSv2 types */
28 __u32 mode;
29 __u32 nlink;
30 __u32 uid;
31 __u32 gid;
32 __u64 size;
33 union {
34 struct {
35 __u32 blocksize;
36 __u32 blocks;
37 } nfs2;
38 struct {
39 __u64 used;
40 } nfs3;
41 } du;
42 dev_t rdev;
43 union {
44 __u64 nfs3; /* also nfs2 */
45 struct nfs4_fsid nfs4;
46 } fsid_u;
47 __u64 fileid;
48 struct timespec atime;
49 struct timespec mtime;
50 struct timespec ctime;
51 __u32 bitmap[2]; /* NFSv4 returned attribute bitmap */
52 __u64 change_attr; /* NFSv4 change attribute */
53 __u64 pre_change_attr;/* pre-op NFSv4 change attribute */
Trond Myklebust33801142005-10-27 22:12:39 -040054 unsigned long time_start;
Linus Torvalds1da177e2005-04-16 15:20:36 -070055};
56
57#define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */
58#define NFS_ATTR_FATTR 0x0002 /* post-op attributes */
59#define NFS_ATTR_FATTR_V3 0x0004 /* NFSv3 attributes */
60#define NFS_ATTR_FATTR_V4 0x0008
61#define NFS_ATTR_PRE_CHANGE 0x0010
62
63/*
64 * Info on the file system
65 */
66struct nfs_fsinfo {
67 struct nfs_fattr *fattr; /* Post-op attributes */
68 __u32 rtmax; /* max. read transfer size */
69 __u32 rtpref; /* pref. read transfer size */
70 __u32 rtmult; /* reads should be multiple of this */
71 __u32 wtmax; /* max. write transfer size */
72 __u32 wtpref; /* pref. write transfer size */
73 __u32 wtmult; /* writes should be multiple of this */
74 __u32 dtpref; /* pref. readdir transfer size */
75 __u64 maxfilesize;
76 __u32 lease_time; /* in seconds */
77};
78
79struct nfs_fsstat {
80 struct nfs_fattr *fattr; /* Post-op attributes */
81 __u64 tbytes; /* total size in bytes */
82 __u64 fbytes; /* # of free bytes */
83 __u64 abytes; /* # of bytes available to user */
84 __u64 tfiles; /* # of files */
85 __u64 ffiles; /* # of free files */
86 __u64 afiles; /* # of files available to user */
87};
88
89struct nfs2_fsstat {
90 __u32 tsize; /* Server transfer size */
91 __u32 bsize; /* Filesystem block size */
92 __u32 blocks; /* No. of "bsize" blocks on filesystem */
93 __u32 bfree; /* No. of free "bsize" blocks */
94 __u32 bavail; /* No. of available "bsize" blocks */
95};
96
97struct nfs_pathconf {
98 struct nfs_fattr *fattr; /* Post-op attributes */
99 __u32 max_link; /* max # of hard links */
100 __u32 max_namelen; /* max name length */
101};
102
103struct nfs4_change_info {
104 u32 atomic;
105 u64 before;
106 u64 after;
107};
108
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700109struct nfs_seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110/*
111 * Arguments to the open call.
112 */
113struct nfs_openargs {
114 const struct nfs_fh * fh;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700115 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116 int open_flags;
117 __u64 clientid;
118 __u32 id;
119 union {
120 struct iattr * attrs; /* UNCHECKED, GUARDED */
121 nfs4_verifier verifier; /* EXCLUSIVE */
122 nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */
123 int delegation_type; /* CLAIM_PREVIOUS */
124 } u;
125 const struct qstr * name;
126 const struct nfs_server *server; /* Needed for ID mapping */
127 const u32 * bitmask;
128 __u32 claim;
129};
130
131struct nfs_openres {
132 nfs4_stateid stateid;
133 struct nfs_fh fh;
134 struct nfs4_change_info cinfo;
135 __u32 rflags;
136 struct nfs_fattr * f_attr;
Trond Myklebust56ae19f2005-10-27 22:12:40 -0400137 struct nfs_fattr * dir_attr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700138 const struct nfs_server *server;
139 int delegation_type;
140 nfs4_stateid delegation;
141 __u32 do_recall;
142 __u64 maxsize;
143};
144
145/*
146 * Arguments to the open_confirm call.
147 */
148struct nfs_open_confirmargs {
149 const struct nfs_fh * fh;
Trond Myklebustcdd4e682006-01-03 09:55:12 +0100150 nfs4_stateid * stateid;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700151 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700152};
153
154struct nfs_open_confirmres {
155 nfs4_stateid stateid;
156};
157
158/*
159 * Arguments to the close call.
160 */
161struct nfs_closeargs {
162 struct nfs_fh * fh;
Trond Myklebust95121352005-10-18 14:20:12 -0700163 nfs4_stateid * stateid;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700164 struct nfs_seqid * seqid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700165 int open_flags;
Trond Myklebust516a6af2005-10-27 22:12:41 -0400166 const u32 * bitmask;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700167};
168
169struct nfs_closeres {
170 nfs4_stateid stateid;
Trond Myklebust516a6af2005-10-27 22:12:41 -0400171 struct nfs_fattr * fattr;
172 const struct nfs_server *server;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700173};
174/*
175 * * Arguments to the lock,lockt, and locku call.
176 * */
177struct nfs_lowner {
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100178 __u64 clientid;
179 u32 id;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700180};
181
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100182struct nfs_lock_args {
183 struct nfs_fh * fh;
184 struct file_lock * fl;
Trond Myklebust06735b32005-10-18 14:20:15 -0700185 struct nfs_seqid * lock_seqid;
186 nfs4_stateid * lock_stateid;
187 struct nfs_seqid * open_seqid;
188 nfs4_stateid * open_stateid;
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100189 struct nfs_lowner lock_owner;
190 unsigned char block : 1;
191 unsigned char reclaim : 1;
192 unsigned char new_lock_owner : 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700193};
194
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100195struct nfs_lock_res {
196 nfs4_stateid stateid;
197};
198
199struct nfs_locku_args {
200 struct nfs_fh * fh;
201 struct file_lock * fl;
Trond Myklebustcee54fc2005-10-18 14:20:12 -0700202 struct nfs_seqid * seqid;
Trond Myklebustfaf5f492005-10-18 14:20:15 -0700203 nfs4_stateid * stateid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700204};
205
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100206struct nfs_locku_res {
207 nfs4_stateid stateid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700208};
209
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100210struct nfs_lockt_args {
211 struct nfs_fh * fh;
212 struct file_lock * fl;
213 struct nfs_lowner lock_owner;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700214};
215
Trond Myklebust911d1aa2006-01-03 09:55:16 +0100216struct nfs_lockt_res {
217 struct file_lock * denied; /* LOCK, LOCKT failed */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700218};
219
220struct nfs4_delegreturnargs {
221 const struct nfs_fh *fhandle;
222 const nfs4_stateid *stateid;
223};
224
225/*
226 * Arguments to the read call.
227 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700228struct nfs_readargs {
229 struct nfs_fh * fh;
230 struct nfs_open_context *context;
231 __u64 offset;
232 __u32 count;
233 unsigned int pgbase;
234 struct page ** pages;
235};
236
237struct nfs_readres {
238 struct nfs_fattr * fattr;
239 __u32 count;
240 int eof;
241};
242
243/*
244 * Arguments to the write call.
245 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700246struct nfs_writeargs {
247 struct nfs_fh * fh;
248 struct nfs_open_context *context;
249 __u64 offset;
250 __u32 count;
251 enum nfs3_stable_how stable;
252 unsigned int pgbase;
253 struct page ** pages;
Trond Myklebust4f9838c2005-10-27 22:12:44 -0400254 const u32 * bitmask;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700255};
256
257struct nfs_writeverf {
258 enum nfs3_stable_how committed;
259 __u32 verifier[2];
260};
261
262struct nfs_writeres {
263 struct nfs_fattr * fattr;
264 struct nfs_writeverf * verf;
265 __u32 count;
Trond Myklebust4f9838c2005-10-27 22:12:44 -0400266 const struct nfs_server *server;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700267};
268
269/*
270 * Argument struct for decode_entry function
271 */
272struct nfs_entry {
273 __u64 ino;
274 __u64 cookie,
275 prev_cookie;
276 const char * name;
277 unsigned int len;
278 int eof;
279 struct nfs_fh * fh;
280 struct nfs_fattr * fattr;
281};
282
283/*
284 * The following types are for NFSv2 only.
285 */
286struct nfs_sattrargs {
287 struct nfs_fh * fh;
288 struct iattr * sattr;
289};
290
291struct nfs_diropargs {
292 struct nfs_fh * fh;
293 const char * name;
294 unsigned int len;
295};
296
297struct nfs_createargs {
298 struct nfs_fh * fh;
299 const char * name;
300 unsigned int len;
301 struct iattr * sattr;
302};
303
304struct nfs_renameargs {
305 struct nfs_fh * fromfh;
306 const char * fromname;
307 unsigned int fromlen;
308 struct nfs_fh * tofh;
309 const char * toname;
310 unsigned int tolen;
311};
312
313struct nfs_setattrargs {
314 struct nfs_fh * fh;
315 nfs4_stateid stateid;
316 struct iattr * iap;
317 const struct nfs_server * server; /* Needed for name mapping */
318 const u32 * bitmask;
319};
320
J. Bruce Fields23ec6962005-06-22 17:16:22 +0000321struct nfs_setaclargs {
322 struct nfs_fh * fh;
323 size_t acl_len;
324 unsigned int acl_pgbase;
325 struct page ** acl_pages;
326};
327
J. Bruce Fields029d1052005-06-22 17:16:22 +0000328struct nfs_getaclargs {
329 struct nfs_fh * fh;
330 size_t acl_len;
331 unsigned int acl_pgbase;
332 struct page ** acl_pages;
333};
334
Linus Torvalds1da177e2005-04-16 15:20:36 -0700335struct nfs_setattrres {
336 struct nfs_fattr * fattr;
337 const struct nfs_server * server;
338};
339
340struct nfs_linkargs {
341 struct nfs_fh * fromfh;
342 struct nfs_fh * tofh;
343 const char * toname;
344 unsigned int tolen;
345};
346
347struct nfs_symlinkargs {
348 struct nfs_fh * fromfh;
349 const char * fromname;
350 unsigned int fromlen;
351 const char * topath;
352 unsigned int tolen;
353 struct iattr * sattr;
354};
355
356struct nfs_readdirargs {
357 struct nfs_fh * fh;
358 __u32 cookie;
359 unsigned int count;
360 struct page ** pages;
361};
362
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +0000363struct nfs3_getaclargs {
364 struct nfs_fh * fh;
365 int mask;
366 struct page ** pages;
367};
368
369struct nfs3_setaclargs {
370 struct inode * inode;
371 int mask;
372 struct posix_acl * acl_access;
373 struct posix_acl * acl_default;
374 struct page ** pages;
375};
376
Linus Torvalds1da177e2005-04-16 15:20:36 -0700377struct nfs_diropok {
378 struct nfs_fh * fh;
379 struct nfs_fattr * fattr;
380};
381
382struct nfs_readlinkargs {
383 struct nfs_fh * fh;
384 unsigned int pgbase;
385 unsigned int pglen;
386 struct page ** pages;
387};
388
389struct nfs3_sattrargs {
390 struct nfs_fh * fh;
391 struct iattr * sattr;
392 unsigned int guard;
393 struct timespec guardtime;
394};
395
396struct nfs3_diropargs {
397 struct nfs_fh * fh;
398 const char * name;
399 unsigned int len;
400};
401
402struct nfs3_accessargs {
403 struct nfs_fh * fh;
404 __u32 access;
405};
406
407struct nfs3_createargs {
408 struct nfs_fh * fh;
409 const char * name;
410 unsigned int len;
411 struct iattr * sattr;
412 enum nfs3_createmode createmode;
413 __u32 verifier[2];
414};
415
416struct nfs3_mkdirargs {
417 struct nfs_fh * fh;
418 const char * name;
419 unsigned int len;
420 struct iattr * sattr;
421};
422
423struct nfs3_symlinkargs {
424 struct nfs_fh * fromfh;
425 const char * fromname;
426 unsigned int fromlen;
427 const char * topath;
428 unsigned int tolen;
429 struct iattr * sattr;
430};
431
432struct nfs3_mknodargs {
433 struct nfs_fh * fh;
434 const char * name;
435 unsigned int len;
436 enum nfs3_ftype type;
437 struct iattr * sattr;
438 dev_t rdev;
439};
440
441struct nfs3_renameargs {
442 struct nfs_fh * fromfh;
443 const char * fromname;
444 unsigned int fromlen;
445 struct nfs_fh * tofh;
446 const char * toname;
447 unsigned int tolen;
448};
449
450struct nfs3_linkargs {
451 struct nfs_fh * fromfh;
452 struct nfs_fh * tofh;
453 const char * toname;
454 unsigned int tolen;
455};
456
457struct nfs3_readdirargs {
458 struct nfs_fh * fh;
459 __u64 cookie;
460 __u32 verf[2];
461 int plus;
462 unsigned int count;
463 struct page ** pages;
464};
465
466struct nfs3_diropres {
467 struct nfs_fattr * dir_attr;
468 struct nfs_fh * fh;
469 struct nfs_fattr * fattr;
470};
471
472struct nfs3_accessres {
473 struct nfs_fattr * fattr;
474 __u32 access;
475};
476
477struct nfs3_readlinkargs {
478 struct nfs_fh * fh;
479 unsigned int pgbase;
480 unsigned int pglen;
481 struct page ** pages;
482};
483
484struct nfs3_renameres {
485 struct nfs_fattr * fromattr;
486 struct nfs_fattr * toattr;
487};
488
489struct nfs3_linkres {
490 struct nfs_fattr * dir_attr;
491 struct nfs_fattr * fattr;
492};
493
494struct nfs3_readdirres {
495 struct nfs_fattr * dir_attr;
496 __u32 * verf;
497 int plus;
498};
499
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +0000500struct nfs3_getaclres {
501 struct nfs_fattr * fattr;
502 int mask;
503 unsigned int acl_access_count;
504 unsigned int acl_default_count;
505 struct posix_acl * acl_access;
506 struct posix_acl * acl_default;
507};
508
Linus Torvalds1da177e2005-04-16 15:20:36 -0700509#ifdef CONFIG_NFS_V4
510
511typedef u64 clientid4;
512
513struct nfs4_accessargs {
514 const struct nfs_fh * fh;
515 u32 access;
516};
517
518struct nfs4_accessres {
519 u32 supported;
520 u32 access;
521};
522
523struct nfs4_create_arg {
524 u32 ftype;
525 union {
526 struct qstr * symlink; /* NF4LNK */
527 struct {
528 u32 specdata1;
529 u32 specdata2;
530 } device; /* NF4BLK, NF4CHR */
531 } u;
532 const struct qstr * name;
533 const struct nfs_server * server;
534 const struct iattr * attrs;
535 const struct nfs_fh * dir_fh;
536 const u32 * bitmask;
537};
538
539struct nfs4_create_res {
540 const struct nfs_server * server;
541 struct nfs_fh * fh;
542 struct nfs_fattr * fattr;
543 struct nfs4_change_info dir_cinfo;
Trond Myklebust56ae19f2005-10-27 22:12:40 -0400544 struct nfs_fattr * dir_fattr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700545};
546
547struct nfs4_fsinfo_arg {
548 const struct nfs_fh * fh;
549 const u32 * bitmask;
550};
551
552struct nfs4_getattr_arg {
553 const struct nfs_fh * fh;
554 const u32 * bitmask;
555};
556
557struct nfs4_getattr_res {
558 const struct nfs_server * server;
559 struct nfs_fattr * fattr;
560};
561
562struct nfs4_link_arg {
563 const struct nfs_fh * fh;
564 const struct nfs_fh * dir_fh;
565 const struct qstr * name;
Trond Myklebust91ba2ee2005-10-27 22:12:42 -0400566 const u32 * bitmask;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700567};
568
Trond Myklebust91ba2ee2005-10-27 22:12:42 -0400569struct nfs4_link_res {
570 const struct nfs_server * server;
571 struct nfs_fattr * fattr;
572 struct nfs4_change_info cinfo;
573 struct nfs_fattr * dir_attr;
574};
575
576
Linus Torvalds1da177e2005-04-16 15:20:36 -0700577struct nfs4_lookup_arg {
578 const struct nfs_fh * dir_fh;
579 const struct qstr * name;
580 const u32 * bitmask;
581};
582
583struct nfs4_lookup_res {
584 const struct nfs_server * server;
585 struct nfs_fattr * fattr;
586 struct nfs_fh * fh;
587};
588
589struct nfs4_lookup_root_arg {
590 const u32 * bitmask;
591};
592
593struct nfs4_pathconf_arg {
594 const struct nfs_fh * fh;
595 const u32 * bitmask;
596};
597
598struct nfs4_readdir_arg {
599 const struct nfs_fh * fh;
600 u64 cookie;
601 nfs4_verifier verifier;
602 u32 count;
603 struct page ** pages; /* zero-copy data */
604 unsigned int pgbase; /* zero-copy data */
605 const u32 * bitmask;
606};
607
608struct nfs4_readdir_res {
609 nfs4_verifier verifier;
610 unsigned int pgbase;
611};
612
613struct nfs4_readlink {
614 const struct nfs_fh * fh;
615 unsigned int pgbase;
616 unsigned int pglen; /* zero-copy data */
617 struct page ** pages; /* zero-copy data */
618};
619
620struct nfs4_remove_arg {
621 const struct nfs_fh * fh;
622 const struct qstr * name;
Trond Myklebust16e42952005-10-27 22:12:44 -0400623 const u32 * bitmask;
624};
625
626struct nfs4_remove_res {
627 const struct nfs_server * server;
628 struct nfs4_change_info cinfo;
629 struct nfs_fattr * dir_attr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700630};
631
632struct nfs4_rename_arg {
633 const struct nfs_fh * old_dir;
634 const struct nfs_fh * new_dir;
635 const struct qstr * old_name;
636 const struct qstr * new_name;
Trond Myklebust6caf2c82005-10-27 22:12:43 -0400637 const u32 * bitmask;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700638};
639
640struct nfs4_rename_res {
Trond Myklebust6caf2c82005-10-27 22:12:43 -0400641 const struct nfs_server * server;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700642 struct nfs4_change_info old_cinfo;
Trond Myklebust6caf2c82005-10-27 22:12:43 -0400643 struct nfs_fattr * old_fattr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700644 struct nfs4_change_info new_cinfo;
Trond Myklebust6caf2c82005-10-27 22:12:43 -0400645 struct nfs_fattr * new_fattr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700646};
647
648struct nfs4_setclientid {
649 const nfs4_verifier * sc_verifier; /* request */
650 unsigned int sc_name_len;
651 char sc_name[32]; /* request */
652 u32 sc_prog; /* request */
653 unsigned int sc_netid_len;
654 char sc_netid[4]; /* request */
655 unsigned int sc_uaddr_len;
656 char sc_uaddr[24]; /* request */
657 u32 sc_cb_ident; /* request */
658};
659
660struct nfs4_statfs_arg {
661 const struct nfs_fh * fh;
662 const u32 * bitmask;
663};
664
665struct nfs4_server_caps_res {
666 u32 attr_bitmask[2];
667 u32 acl_bitmask;
668 u32 has_links;
669 u32 has_symlinks;
670};
671
672#endif /* CONFIG_NFS_V4 */
673
674struct nfs_page;
675
Chuck Lever40859d72005-11-30 18:09:02 -0500676#define NFS_PAGEVEC_SIZE (8U)
677
Linus Torvalds1da177e2005-04-16 15:20:36 -0700678struct nfs_read_data {
679 int flags;
680 struct rpc_task task;
681 struct inode *inode;
682 struct rpc_cred *cred;
683 struct nfs_fattr fattr; /* fattr storage */
684 struct list_head pages; /* Coalesced read requests */
685 struct nfs_page *req; /* multi ops per nfs_page */
Chuck Lever40859d72005-11-30 18:09:02 -0500686 struct page **pagevec;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700687 struct nfs_readargs args;
688 struct nfs_readres res;
689#ifdef CONFIG_NFS_V4
690 unsigned long timestamp; /* For lease renewal */
691#endif
692 void (*complete) (struct nfs_read_data *, int);
Chuck Lever40859d72005-11-30 18:09:02 -0500693 struct page *page_array[NFS_PAGEVEC_SIZE + 1];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700694};
695
696struct nfs_write_data {
697 int flags;
698 struct rpc_task task;
699 struct inode *inode;
700 struct rpc_cred *cred;
701 struct nfs_fattr fattr;
702 struct nfs_writeverf verf;
703 struct list_head pages; /* Coalesced requests we wish to flush */
704 struct nfs_page *req; /* multi ops per nfs_page */
Chuck Lever40859d72005-11-30 18:09:02 -0500705 struct page **pagevec;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700706 struct nfs_writeargs args; /* argument struct */
707 struct nfs_writeres res; /* result struct */
708#ifdef CONFIG_NFS_V4
709 unsigned long timestamp; /* For lease renewal */
710#endif
711 void (*complete) (struct nfs_write_data *, int);
Chuck Lever40859d72005-11-30 18:09:02 -0500712 struct page *page_array[NFS_PAGEVEC_SIZE + 1];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700713};
714
715struct nfs_access_entry;
716
717/*
718 * RPC procedure vector for NFSv2/NFSv3 demuxing
719 */
720struct nfs_rpc_ops {
721 int version; /* Protocol version */
722 struct dentry_operations *dentry_ops;
723 struct inode_operations *dir_inode_ops;
J. Bruce Fields92cfc622005-06-22 17:16:22 +0000724 struct inode_operations *file_inode_ops;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700725
726 int (*getroot) (struct nfs_server *, struct nfs_fh *,
727 struct nfs_fsinfo *);
728 int (*getattr) (struct nfs_server *, struct nfs_fh *,
729 struct nfs_fattr *);
730 int (*setattr) (struct dentry *, struct nfs_fattr *,
731 struct iattr *);
732 int (*lookup) (struct inode *, struct qstr *,
733 struct nfs_fh *, struct nfs_fattr *);
734 int (*access) (struct inode *, struct nfs_access_entry *);
735 int (*readlink)(struct inode *, struct page *, unsigned int,
736 unsigned int);
737 int (*read) (struct nfs_read_data *);
738 int (*write) (struct nfs_write_data *);
739 int (*commit) (struct nfs_write_data *);
740 int (*create) (struct inode *, struct dentry *,
Trond Myklebust02a913a2005-10-18 14:20:17 -0700741 struct iattr *, int, struct nameidata *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700742 int (*remove) (struct inode *, struct qstr *);
743 int (*unlink_setup) (struct rpc_message *,
744 struct dentry *, struct qstr *);
745 int (*unlink_done) (struct dentry *, struct rpc_task *);
746 int (*rename) (struct inode *, struct qstr *,
747 struct inode *, struct qstr *);
748 int (*link) (struct inode *, struct inode *, struct qstr *);
749 int (*symlink) (struct inode *, struct qstr *, struct qstr *,
750 struct iattr *, struct nfs_fh *,
751 struct nfs_fattr *);
752 int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
753 int (*rmdir) (struct inode *, struct qstr *);
754 int (*readdir) (struct dentry *, struct rpc_cred *,
755 u64, struct page *, unsigned int, int);
756 int (*mknod) (struct inode *, struct dentry *, struct iattr *,
757 dev_t);
758 int (*statfs) (struct nfs_server *, struct nfs_fh *,
759 struct nfs_fsstat *);
760 int (*fsinfo) (struct nfs_server *, struct nfs_fh *,
761 struct nfs_fsinfo *);
762 int (*pathconf) (struct nfs_server *, struct nfs_fh *,
763 struct nfs_pathconf *);
764 u32 * (*decode_dirent)(u32 *, struct nfs_entry *, int plus);
765 void (*read_setup) (struct nfs_read_data *);
766 void (*write_setup) (struct nfs_write_data *, int how);
767 void (*commit_setup) (struct nfs_write_data *, int how);
768 int (*file_open) (struct inode *, struct file *);
769 int (*file_release) (struct inode *, struct file *);
770 int (*lock)(struct file *, int, struct file_lock *);
Trond Myklebustada70d92005-06-22 17:16:22 +0000771 void (*clear_acl_cache)(struct inode *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700772};
773
774/*
775 * NFS_CALL(getattr, inode, (fattr));
776 * into
777 * NFS_PROTO(inode)->getattr(fattr);
778 */
779#define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args
780
781/*
782 * Function vectors etc. for the NFS client
783 */
784extern struct nfs_rpc_ops nfs_v2_clientops;
785extern struct nfs_rpc_ops nfs_v3_clientops;
786extern struct nfs_rpc_ops nfs_v4_clientops;
787extern struct rpc_version nfs_version2;
788extern struct rpc_version nfs_version3;
789extern struct rpc_version nfs_version4;
790
Andreas Gruenbacherb7fa0552005-06-22 17:16:27 +0000791extern struct rpc_version nfsacl_version3;
792extern struct rpc_program nfsacl_program;
793
Linus Torvalds1da177e2005-04-16 15:20:36 -0700794#endif