]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - include/linux/nfs_xdr.h
NFSv4: Implement the fs_locations function call
[mirror_ubuntu-bionic-kernel.git] / include / linux / nfs_xdr.h
CommitLineData
1da177e4
LT
1#ifndef _LINUX_NFS_XDR_H
2#define _LINUX_NFS_XDR_H
3
4#include <linux/sunrpc/xprt.h>
b7fa0554 5#include <linux/nfsacl.h>
1da177e4 6
40859d7e
CL
7/*
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
8b4bdcf8
TM
17struct nfs_fsid {
18 uint64_t major;
19 uint64_t minor;
1da177e4
LT
20};
21
8b4bdcf8
TM
22/*
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
1da177e4
LT
30struct nfs_fattr {
31 unsigned short valid; /* which fields are valid */
32 __u64 pre_size; /* pre_op_attr.size */
33 struct timespec pre_mtime; /* pre_op_attr.mtime */
34 struct timespec pre_ctime; /* pre_op_attr.ctime */
35 enum nfs_ftype type; /* always use NFSv2 types */
36 __u32 mode;
37 __u32 nlink;
38 __u32 uid;
39 __u32 gid;
40 __u64 size;
41 union {
42 struct {
43 __u32 blocksize;
44 __u32 blocks;
45 } nfs2;
46 struct {
47 __u64 used;
48 } nfs3;
49 } du;
50 dev_t rdev;
8b4bdcf8 51 struct nfs_fsid fsid;
1da177e4
LT
52 __u64 fileid;
53 struct timespec atime;
54 struct timespec mtime;
55 struct timespec ctime;
56 __u32 bitmap[2]; /* NFSv4 returned attribute bitmap */
57 __u64 change_attr; /* NFSv4 change attribute */
58 __u64 pre_change_attr;/* pre-op NFSv4 change attribute */
33801147 59 unsigned long time_start;
1da177e4
LT
60};
61
62#define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */
63#define NFS_ATTR_FATTR 0x0002 /* post-op attributes */
64#define NFS_ATTR_FATTR_V3 0x0004 /* NFSv3 attributes */
73a3d07c 65#define NFS_ATTR_FATTR_V4 0x0008 /* NFSv4 change attribute */
1da177e4
LT
66
67/*
68 * Info on the file system
69 */
70struct nfs_fsinfo {
71 struct nfs_fattr *fattr; /* Post-op attributes */
72 __u32 rtmax; /* max. read transfer size */
73 __u32 rtpref; /* pref. read transfer size */
74 __u32 rtmult; /* reads should be multiple of this */
75 __u32 wtmax; /* max. write transfer size */
76 __u32 wtpref; /* pref. write transfer size */
77 __u32 wtmult; /* writes should be multiple of this */
78 __u32 dtpref; /* pref. readdir transfer size */
79 __u64 maxfilesize;
80 __u32 lease_time; /* in seconds */
81};
82
83struct nfs_fsstat {
84 struct nfs_fattr *fattr; /* Post-op attributes */
85 __u64 tbytes; /* total size in bytes */
86 __u64 fbytes; /* # of free bytes */
87 __u64 abytes; /* # of bytes available to user */
88 __u64 tfiles; /* # of files */
89 __u64 ffiles; /* # of free files */
90 __u64 afiles; /* # of files available to user */
91};
92
93struct nfs2_fsstat {
94 __u32 tsize; /* Server transfer size */
95 __u32 bsize; /* Filesystem block size */
96 __u32 blocks; /* No. of "bsize" blocks on filesystem */
97 __u32 bfree; /* No. of free "bsize" blocks */
98 __u32 bavail; /* No. of available "bsize" blocks */
99};
100
101struct nfs_pathconf {
102 struct nfs_fattr *fattr; /* Post-op attributes */
103 __u32 max_link; /* max # of hard links */
104 __u32 max_namelen; /* max name length */
105};
106
107struct nfs4_change_info {
108 u32 atomic;
109 u64 before;
110 u64 after;
111};
112
cee54fc9 113struct nfs_seqid;
1da177e4
LT
114/*
115 * Arguments to the open call.
116 */
117struct nfs_openargs {
118 const struct nfs_fh * fh;
cee54fc9 119 struct nfs_seqid * seqid;
1da177e4
LT
120 int open_flags;
121 __u64 clientid;
122 __u32 id;
123 union {
124 struct iattr * attrs; /* UNCHECKED, GUARDED */
125 nfs4_verifier verifier; /* EXCLUSIVE */
126 nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */
127 int delegation_type; /* CLAIM_PREVIOUS */
128 } u;
129 const struct qstr * name;
130 const struct nfs_server *server; /* Needed for ID mapping */
131 const u32 * bitmask;
132 __u32 claim;
133};
134
135struct nfs_openres {
136 nfs4_stateid stateid;
137 struct nfs_fh fh;
138 struct nfs4_change_info cinfo;
139 __u32 rflags;
140 struct nfs_fattr * f_attr;
56ae19f3 141 struct nfs_fattr * dir_attr;
1da177e4
LT
142 const struct nfs_server *server;
143 int delegation_type;
144 nfs4_stateid delegation;
145 __u32 do_recall;
146 __u64 maxsize;
147};
148
149/*
150 * Arguments to the open_confirm call.
151 */
152struct nfs_open_confirmargs {
153 const struct nfs_fh * fh;
cdd4e68b 154 nfs4_stateid * stateid;
cee54fc9 155 struct nfs_seqid * seqid;
1da177e4
LT
156};
157
158struct nfs_open_confirmres {
159 nfs4_stateid stateid;
160};
161
162/*
163 * Arguments to the close call.
164 */
165struct nfs_closeargs {
166 struct nfs_fh * fh;
9512135d 167 nfs4_stateid * stateid;
cee54fc9 168 struct nfs_seqid * seqid;
1da177e4 169 int open_flags;
516a6af6 170 const u32 * bitmask;
1da177e4
LT
171};
172
173struct nfs_closeres {
174 nfs4_stateid stateid;
516a6af6
TM
175 struct nfs_fattr * fattr;
176 const struct nfs_server *server;
1da177e4
LT
177};
178/*
179 * * Arguments to the lock,lockt, and locku call.
180 * */
181struct nfs_lowner {
911d1aaf
TM
182 __u64 clientid;
183 u32 id;
1da177e4
LT
184};
185
911d1aaf
TM
186struct nfs_lock_args {
187 struct nfs_fh * fh;
188 struct file_lock * fl;
cee54fc9 189 struct nfs_seqid * lock_seqid;
06735b34
TM
190 nfs4_stateid * lock_stateid;
191 struct nfs_seqid * open_seqid;
192 nfs4_stateid * open_stateid;
911d1aaf
TM
193 struct nfs_lowner lock_owner;
194 unsigned char block : 1;
195 unsigned char reclaim : 1;
196 unsigned char new_lock_owner : 1;
197};
198
199struct nfs_lock_res {
200 nfs4_stateid stateid;
1da177e4
LT
201};
202
911d1aaf
TM
203struct nfs_locku_args {
204 struct nfs_fh * fh;
205 struct file_lock * fl;
cee54fc9 206 struct nfs_seqid * seqid;
faf5f49c 207 nfs4_stateid * stateid;
1da177e4
LT
208};
209
911d1aaf
TM
210struct nfs_locku_res {
211 nfs4_stateid stateid;
1da177e4
LT
212};
213
911d1aaf
TM
214struct nfs_lockt_args {
215 struct nfs_fh * fh;
216 struct file_lock * fl;
217 struct nfs_lowner lock_owner;
1da177e4
LT
218};
219
911d1aaf
TM
220struct nfs_lockt_res {
221 struct file_lock * denied; /* LOCK, LOCKT failed */
1da177e4
LT
222};
223
224struct nfs4_delegreturnargs {
225 const struct nfs_fh *fhandle;
226 const nfs4_stateid *stateid;
fa178f29
TM
227 const u32 * bitmask;
228};
229
230struct nfs4_delegreturnres {
231 struct nfs_fattr * fattr;
232 const struct nfs_server *server;
1da177e4
LT
233};
234
235/*
236 * Arguments to the read call.
237 */
1da177e4
LT
238struct nfs_readargs {
239 struct nfs_fh * fh;
240 struct nfs_open_context *context;
241 __u64 offset;
242 __u32 count;
243 unsigned int pgbase;
244 struct page ** pages;
245};
246
247struct nfs_readres {
248 struct nfs_fattr * fattr;
249 __u32 count;
250 int eof;
251};
252
253/*
254 * Arguments to the write call.
255 */
1da177e4
LT
256struct nfs_writeargs {
257 struct nfs_fh * fh;
258 struct nfs_open_context *context;
259 __u64 offset;
260 __u32 count;
261 enum nfs3_stable_how stable;
262 unsigned int pgbase;
263 struct page ** pages;
4f9838c7 264 const u32 * bitmask;
1da177e4
LT
265};
266
267struct nfs_writeverf {
268 enum nfs3_stable_how committed;
269 __u32 verifier[2];
270};
271
272struct nfs_writeres {
273 struct nfs_fattr * fattr;
274 struct nfs_writeverf * verf;
275 __u32 count;
4f9838c7 276 const struct nfs_server *server;
1da177e4
LT
277};
278
279/*
280 * Argument struct for decode_entry function
281 */
282struct nfs_entry {
283 __u64 ino;
284 __u64 cookie,
285 prev_cookie;
286 const char * name;
287 unsigned int len;
288 int eof;
289 struct nfs_fh * fh;
290 struct nfs_fattr * fattr;
291};
292
293/*
294 * The following types are for NFSv2 only.
295 */
296struct nfs_sattrargs {
297 struct nfs_fh * fh;
298 struct iattr * sattr;
299};
300
301struct nfs_diropargs {
302 struct nfs_fh * fh;
303 const char * name;
304 unsigned int len;
305};
306
307struct nfs_createargs {
308 struct nfs_fh * fh;
309 const char * name;
310 unsigned int len;
311 struct iattr * sattr;
312};
313
314struct nfs_renameargs {
315 struct nfs_fh * fromfh;
316 const char * fromname;
317 unsigned int fromlen;
318 struct nfs_fh * tofh;
319 const char * toname;
320 unsigned int tolen;
321};
322
323struct nfs_setattrargs {
324 struct nfs_fh * fh;
325 nfs4_stateid stateid;
326 struct iattr * iap;
327 const struct nfs_server * server; /* Needed for name mapping */
328 const u32 * bitmask;
329};
330
23ec6965
BF
331struct nfs_setaclargs {
332 struct nfs_fh * fh;
333 size_t acl_len;
334 unsigned int acl_pgbase;
335 struct page ** acl_pages;
336};
337
029d105e
BF
338struct nfs_getaclargs {
339 struct nfs_fh * fh;
340 size_t acl_len;
341 unsigned int acl_pgbase;
342 struct page ** acl_pages;
343};
344
1da177e4
LT
345struct nfs_setattrres {
346 struct nfs_fattr * fattr;
347 const struct nfs_server * server;
348};
349
350struct nfs_linkargs {
351 struct nfs_fh * fromfh;
352 struct nfs_fh * tofh;
353 const char * toname;
354 unsigned int tolen;
355};
356
357struct nfs_symlinkargs {
358 struct nfs_fh * fromfh;
359 const char * fromname;
360 unsigned int fromlen;
361 const char * topath;
362 unsigned int tolen;
363 struct iattr * sattr;
364};
365
366struct nfs_readdirargs {
367 struct nfs_fh * fh;
368 __u32 cookie;
369 unsigned int count;
370 struct page ** pages;
371};
372
b7fa0554
AG
373struct nfs3_getaclargs {
374 struct nfs_fh * fh;
375 int mask;
376 struct page ** pages;
377};
378
379struct nfs3_setaclargs {
380 struct inode * inode;
381 int mask;
382 struct posix_acl * acl_access;
383 struct posix_acl * acl_default;
384 struct page ** pages;
385};
386
1da177e4
LT
387struct nfs_diropok {
388 struct nfs_fh * fh;
389 struct nfs_fattr * fattr;
390};
391
392struct nfs_readlinkargs {
393 struct nfs_fh * fh;
394 unsigned int pgbase;
395 unsigned int pglen;
396 struct page ** pages;
397};
398
399struct nfs3_sattrargs {
400 struct nfs_fh * fh;
401 struct iattr * sattr;
402 unsigned int guard;
403 struct timespec guardtime;
404};
405
406struct nfs3_diropargs {
407 struct nfs_fh * fh;
408 const char * name;
409 unsigned int len;
410};
411
412struct nfs3_accessargs {
413 struct nfs_fh * fh;
414 __u32 access;
415};
416
417struct nfs3_createargs {
418 struct nfs_fh * fh;
419 const char * name;
420 unsigned int len;
421 struct iattr * sattr;
422 enum nfs3_createmode createmode;
423 __u32 verifier[2];
424};
425
426struct nfs3_mkdirargs {
427 struct nfs_fh * fh;
428 const char * name;
429 unsigned int len;
430 struct iattr * sattr;
431};
432
433struct nfs3_symlinkargs {
434 struct nfs_fh * fromfh;
435 const char * fromname;
436 unsigned int fromlen;
437 const char * topath;
438 unsigned int tolen;
439 struct iattr * sattr;
440};
441
442struct nfs3_mknodargs {
443 struct nfs_fh * fh;
444 const char * name;
445 unsigned int len;
446 enum nfs3_ftype type;
447 struct iattr * sattr;
448 dev_t rdev;
449};
450
451struct nfs3_renameargs {
452 struct nfs_fh * fromfh;
453 const char * fromname;
454 unsigned int fromlen;
455 struct nfs_fh * tofh;
456 const char * toname;
457 unsigned int tolen;
458};
459
460struct nfs3_linkargs {
461 struct nfs_fh * fromfh;
462 struct nfs_fh * tofh;
463 const char * toname;
464 unsigned int tolen;
465};
466
467struct nfs3_readdirargs {
468 struct nfs_fh * fh;
469 __u64 cookie;
470 __u32 verf[2];
471 int plus;
472 unsigned int count;
473 struct page ** pages;
474};
475
476struct nfs3_diropres {
477 struct nfs_fattr * dir_attr;
478 struct nfs_fh * fh;
479 struct nfs_fattr * fattr;
480};
481
482struct nfs3_accessres {
483 struct nfs_fattr * fattr;
484 __u32 access;
485};
486
487struct nfs3_readlinkargs {
488 struct nfs_fh * fh;
489 unsigned int pgbase;
490 unsigned int pglen;
491 struct page ** pages;
492};
493
494struct nfs3_renameres {
495 struct nfs_fattr * fromattr;
496 struct nfs_fattr * toattr;
497};
498
499struct nfs3_linkres {
500 struct nfs_fattr * dir_attr;
501 struct nfs_fattr * fattr;
502};
503
504struct nfs3_readdirres {
505 struct nfs_fattr * dir_attr;
506 __u32 * verf;
507 int plus;
508};
509
b7fa0554
AG
510struct nfs3_getaclres {
511 struct nfs_fattr * fattr;
512 int mask;
513 unsigned int acl_access_count;
514 unsigned int acl_default_count;
515 struct posix_acl * acl_access;
516 struct posix_acl * acl_default;
517};
518
1da177e4
LT
519#ifdef CONFIG_NFS_V4
520
521typedef u64 clientid4;
522
523struct nfs4_accessargs {
524 const struct nfs_fh * fh;
525 u32 access;
526};
527
528struct nfs4_accessres {
529 u32 supported;
530 u32 access;
531};
532
533struct nfs4_create_arg {
534 u32 ftype;
535 union {
536 struct qstr * symlink; /* NF4LNK */
537 struct {
538 u32 specdata1;
539 u32 specdata2;
540 } device; /* NF4BLK, NF4CHR */
541 } u;
542 const struct qstr * name;
543 const struct nfs_server * server;
544 const struct iattr * attrs;
545 const struct nfs_fh * dir_fh;
546 const u32 * bitmask;
547};
548
549struct nfs4_create_res {
550 const struct nfs_server * server;
551 struct nfs_fh * fh;
552 struct nfs_fattr * fattr;
553 struct nfs4_change_info dir_cinfo;
56ae19f3 554 struct nfs_fattr * dir_fattr;
1da177e4
LT
555};
556
557struct nfs4_fsinfo_arg {
558 const struct nfs_fh * fh;
559 const u32 * bitmask;
560};
561
562struct nfs4_getattr_arg {
563 const struct nfs_fh * fh;
564 const u32 * bitmask;
565};
566
567struct nfs4_getattr_res {
568 const struct nfs_server * server;
569 struct nfs_fattr * fattr;
570};
571
572struct nfs4_link_arg {
573 const struct nfs_fh * fh;
574 const struct nfs_fh * dir_fh;
575 const struct qstr * name;
91ba2eee
TM
576 const u32 * bitmask;
577};
578
579struct nfs4_link_res {
580 const struct nfs_server * server;
581 struct nfs_fattr * fattr;
582 struct nfs4_change_info cinfo;
583 struct nfs_fattr * dir_attr;
1da177e4
LT
584};
585
91ba2eee 586
1da177e4
LT
587struct nfs4_lookup_arg {
588 const struct nfs_fh * dir_fh;
589 const struct qstr * name;
590 const u32 * bitmask;
591};
592
593struct nfs4_lookup_res {
594 const struct nfs_server * server;
595 struct nfs_fattr * fattr;
596 struct nfs_fh * fh;
597};
598
599struct nfs4_lookup_root_arg {
600 const u32 * bitmask;
601};
602
603struct nfs4_pathconf_arg {
604 const struct nfs_fh * fh;
605 const u32 * bitmask;
606};
607
608struct nfs4_readdir_arg {
609 const struct nfs_fh * fh;
610 u64 cookie;
611 nfs4_verifier verifier;
612 u32 count;
613 struct page ** pages; /* zero-copy data */
614 unsigned int pgbase; /* zero-copy data */
615 const u32 * bitmask;
616};
617
618struct nfs4_readdir_res {
619 nfs4_verifier verifier;
620 unsigned int pgbase;
621};
622
623struct nfs4_readlink {
624 const struct nfs_fh * fh;
625 unsigned int pgbase;
626 unsigned int pglen; /* zero-copy data */
627 struct page ** pages; /* zero-copy data */
628};
629
630struct nfs4_remove_arg {
631 const struct nfs_fh * fh;
632 const struct qstr * name;
16e42959
TM
633 const u32 * bitmask;
634};
635
636struct nfs4_remove_res {
637 const struct nfs_server * server;
638 struct nfs4_change_info cinfo;
639 struct nfs_fattr * dir_attr;
1da177e4
LT
640};
641
642struct nfs4_rename_arg {
643 const struct nfs_fh * old_dir;
644 const struct nfs_fh * new_dir;
645 const struct qstr * old_name;
646 const struct qstr * new_name;
6caf2c82 647 const u32 * bitmask;
1da177e4
LT
648};
649
650struct nfs4_rename_res {
6caf2c82 651 const struct nfs_server * server;
1da177e4 652 struct nfs4_change_info old_cinfo;
6caf2c82 653 struct nfs_fattr * old_fattr;
1da177e4 654 struct nfs4_change_info new_cinfo;
6caf2c82 655 struct nfs_fattr * new_fattr;
1da177e4
LT
656};
657
658struct nfs4_setclientid {
659 const nfs4_verifier * sc_verifier; /* request */
660 unsigned int sc_name_len;
661 char sc_name[32]; /* request */
662 u32 sc_prog; /* request */
663 unsigned int sc_netid_len;
664 char sc_netid[4]; /* request */
665 unsigned int sc_uaddr_len;
666 char sc_uaddr[24]; /* request */
667 u32 sc_cb_ident; /* request */
668};
669
670struct nfs4_statfs_arg {
671 const struct nfs_fh * fh;
672 const u32 * bitmask;
673};
674
675struct nfs4_server_caps_res {
676 u32 attr_bitmask[2];
677 u32 acl_bitmask;
678 u32 has_links;
679 u32 has_symlinks;
680};
681
683b57b4
TM
682struct nfs_fs_location {
683 unsigned int serverlen;
684 char * server;
685 unsigned int rootpathlen;
686 char * rootpath;
687};
688
689#define NFS_FS_LOCATIONS_MAXENTRIES 10
690struct nfs_fs_locations {
691 struct nfs_fattr fattr;
692 const struct nfs_server *server;
693 unsigned int fs_pathlen;
694 char * fs_path;
695 int nlocations;
696 struct nfs_fs_location locations[NFS_FS_LOCATIONS_MAXENTRIES];
697};
698
699struct nfs4_fs_locations_arg {
700 const struct nfs_fh *dir_fh;
701 const struct qstr *name;
702 struct page *page;
703 const u32 *bitmask;
704};
705
1da177e4
LT
706#endif /* CONFIG_NFS_V4 */
707
708struct nfs_page;
709
40859d7e
CL
710#define NFS_PAGEVEC_SIZE (8U)
711
1da177e4
LT
712struct nfs_read_data {
713 int flags;
714 struct rpc_task task;
715 struct inode *inode;
716 struct rpc_cred *cred;
717 struct nfs_fattr fattr; /* fattr storage */
718 struct list_head pages; /* Coalesced read requests */
719 struct nfs_page *req; /* multi ops per nfs_page */
40859d7e 720 struct page **pagevec;
1da177e4
LT
721 struct nfs_readargs args;
722 struct nfs_readres res;
723#ifdef CONFIG_NFS_V4
724 unsigned long timestamp; /* For lease renewal */
725#endif
0d0b5cb3 726 struct page *page_array[NFS_PAGEVEC_SIZE];
1da177e4
LT
727};
728
729struct nfs_write_data {
730 int flags;
731 struct rpc_task task;
732 struct inode *inode;
733 struct rpc_cred *cred;
734 struct nfs_fattr fattr;
735 struct nfs_writeverf verf;
736 struct list_head pages; /* Coalesced requests we wish to flush */
737 struct nfs_page *req; /* multi ops per nfs_page */
40859d7e 738 struct page **pagevec;
1da177e4
LT
739 struct nfs_writeargs args; /* argument struct */
740 struct nfs_writeres res; /* result struct */
741#ifdef CONFIG_NFS_V4
742 unsigned long timestamp; /* For lease renewal */
743#endif
0d0b5cb3 744 struct page *page_array[NFS_PAGEVEC_SIZE];
1da177e4
LT
745};
746
747struct nfs_access_entry;
748
749/*
750 * RPC procedure vector for NFSv2/NFSv3 demuxing
751 */
752struct nfs_rpc_ops {
753 int version; /* Protocol version */
754 struct dentry_operations *dentry_ops;
755 struct inode_operations *dir_inode_ops;
92cfc62c 756 struct inode_operations *file_inode_ops;
1da177e4
LT
757
758 int (*getroot) (struct nfs_server *, struct nfs_fh *,
759 struct nfs_fsinfo *);
760 int (*getattr) (struct nfs_server *, struct nfs_fh *,
761 struct nfs_fattr *);
762 int (*setattr) (struct dentry *, struct nfs_fattr *,
763 struct iattr *);
764 int (*lookup) (struct inode *, struct qstr *,
765 struct nfs_fh *, struct nfs_fattr *);
766 int (*access) (struct inode *, struct nfs_access_entry *);
767 int (*readlink)(struct inode *, struct page *, unsigned int,
768 unsigned int);
769 int (*read) (struct nfs_read_data *);
770 int (*write) (struct nfs_write_data *);
771 int (*commit) (struct nfs_write_data *);
772 int (*create) (struct inode *, struct dentry *,
02a913a7 773 struct iattr *, int, struct nameidata *);
1da177e4
LT
774 int (*remove) (struct inode *, struct qstr *);
775 int (*unlink_setup) (struct rpc_message *,
776 struct dentry *, struct qstr *);
777 int (*unlink_done) (struct dentry *, struct rpc_task *);
778 int (*rename) (struct inode *, struct qstr *,
779 struct inode *, struct qstr *);
780 int (*link) (struct inode *, struct inode *, struct qstr *);
781 int (*symlink) (struct inode *, struct qstr *, struct qstr *,
782 struct iattr *, struct nfs_fh *,
783 struct nfs_fattr *);
784 int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
785 int (*rmdir) (struct inode *, struct qstr *);
786 int (*readdir) (struct dentry *, struct rpc_cred *,
787 u64, struct page *, unsigned int, int);
788 int (*mknod) (struct inode *, struct dentry *, struct iattr *,
789 dev_t);
790 int (*statfs) (struct nfs_server *, struct nfs_fh *,
791 struct nfs_fsstat *);
792 int (*fsinfo) (struct nfs_server *, struct nfs_fh *,
793 struct nfs_fsinfo *);
794 int (*pathconf) (struct nfs_server *, struct nfs_fh *,
795 struct nfs_pathconf *);
796 u32 * (*decode_dirent)(u32 *, struct nfs_entry *, int plus);
797 void (*read_setup) (struct nfs_read_data *);
ec06c096 798 int (*read_done) (struct rpc_task *, struct nfs_read_data *);
1da177e4 799 void (*write_setup) (struct nfs_write_data *, int how);
788e7a89 800 int (*write_done) (struct rpc_task *, struct nfs_write_data *);
1da177e4 801 void (*commit_setup) (struct nfs_write_data *, int how);
788e7a89 802 int (*commit_done) (struct rpc_task *, struct nfs_write_data *);
1da177e4
LT
803 int (*file_open) (struct inode *, struct file *);
804 int (*file_release) (struct inode *, struct file *);
805 int (*lock)(struct file *, int, struct file_lock *);
ada70d94 806 void (*clear_acl_cache)(struct inode *);
1da177e4
LT
807};
808
809/*
810 * NFS_CALL(getattr, inode, (fattr));
811 * into
812 * NFS_PROTO(inode)->getattr(fattr);
813 */
814#define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args
815
816/*
817 * Function vectors etc. for the NFS client
818 */
819extern struct nfs_rpc_ops nfs_v2_clientops;
820extern struct nfs_rpc_ops nfs_v3_clientops;
821extern struct nfs_rpc_ops nfs_v4_clientops;
822extern struct rpc_version nfs_version2;
823extern struct rpc_version nfs_version3;
824extern struct rpc_version nfs_version4;
825
b7fa0554
AG
826extern struct rpc_version nfsacl_version3;
827extern struct rpc_program nfsacl_program;
828
1da177e4 829#endif