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