NFS: ask for layouttypes during v4 fsinfo call
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / include / linux / nfs_xdr.h
blob065f9d105d05bd5bac2d6ded8e3462b7eedce89c
1 #ifndef _LINUX_NFS_XDR_H
2 #define _LINUX_NFS_XDR_H
4 #include <linux/nfsacl.h>
5 #include <linux/nfs3.h>
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.
13 #define NFS_MAX_FILE_IO_SIZE (1048576U)
14 #define NFS_DEF_FILE_IO_SIZE (4096U)
15 #define NFS_MIN_FILE_IO_SIZE (1024U)
17 struct nfs_fsid {
18 uint64_t major;
19 uint64_t minor;
23 * Helper for checking equality between 2 fsids.
25 static inline int nfs_fsid_equal(const struct nfs_fsid *a, const struct nfs_fsid *b)
27 return a->major == b->major && a->minor == b->minor;
30 struct nfs_fattr {
31 unsigned int valid; /* which fields are valid */
32 umode_t mode;
33 __u32 nlink;
34 __u32 uid;
35 __u32 gid;
36 dev_t rdev;
37 __u64 size;
38 union {
39 struct {
40 __u32 blocksize;
41 __u32 blocks;
42 } nfs2;
43 struct {
44 __u64 used;
45 } nfs3;
46 } du;
47 struct nfs_fsid fsid;
48 __u64 fileid;
49 struct timespec atime;
50 struct timespec mtime;
51 struct timespec ctime;
52 __u64 change_attr; /* NFSv4 change attribute */
53 __u64 pre_change_attr;/* pre-op NFSv4 change attribute */
54 __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 */
57 unsigned long time_start;
58 unsigned long gencount;
61 #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 */
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)
103 * Info on the file system
105 struct 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;
115 struct timespec time_delta; /* server time granularity */
116 __u32 lease_time; /* in seconds */
117 __u32 layouttype; /* supported pnfs layout driver */
120 struct nfs_fsstat {
121 struct nfs_fattr *fattr; /* Post-op attributes */
122 __u64 tbytes; /* total size in bytes */
123 __u64 fbytes; /* # of free bytes */
124 __u64 abytes; /* # of bytes available to user */
125 __u64 tfiles; /* # of files */
126 __u64 ffiles; /* # of free files */
127 __u64 afiles; /* # of files available to user */
130 struct nfs2_fsstat {
131 __u32 tsize; /* Server transfer size */
132 __u32 bsize; /* Filesystem block size */
133 __u32 blocks; /* No. of "bsize" blocks on filesystem */
134 __u32 bfree; /* No. of free "bsize" blocks */
135 __u32 bavail; /* No. of available "bsize" blocks */
138 struct nfs_pathconf {
139 struct nfs_fattr *fattr; /* Post-op attributes */
140 __u32 max_link; /* max # of hard links */
141 __u32 max_namelen; /* max name length */
144 struct nfs4_change_info {
145 u32 atomic;
146 u64 before;
147 u64 after;
150 struct nfs_seqid;
152 /* nfs41 sessions channel attributes */
153 struct nfs4_channel_attrs {
154 u32 headerpadsz;
155 u32 max_rqst_sz;
156 u32 max_resp_sz;
157 u32 max_resp_sz_cached;
158 u32 max_ops;
159 u32 max_reqs;
162 /* nfs41 sessions slot seqid */
163 struct nfs4_slot {
164 u32 seq_nr;
167 struct nfs4_sequence_args {
168 struct nfs4_session *sa_session;
169 u8 sa_slotid;
170 u8 sa_cache_this;
173 struct nfs4_sequence_res {
174 struct nfs4_session *sr_session;
175 struct nfs4_slot *sr_slot; /* slot used to send request */
176 int sr_status; /* sequence operation status */
177 unsigned long sr_renewal_time;
178 u32 sr_status_flags;
181 struct nfs4_get_lease_time_args {
182 struct nfs4_sequence_args la_seq_args;
185 struct nfs4_get_lease_time_res {
186 struct nfs_fsinfo *lr_fsinfo;
187 struct nfs4_sequence_res lr_seq_res;
191 * Arguments to the open call.
193 struct nfs_openargs {
194 const struct nfs_fh * fh;
195 struct nfs_seqid * seqid;
196 int open_flags;
197 fmode_t fmode;
198 __u64 clientid;
199 __u64 id;
200 union {
201 struct {
202 struct iattr * attrs; /* UNCHECKED, GUARDED */
203 nfs4_verifier verifier; /* EXCLUSIVE */
205 nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */
206 fmode_t delegation_type; /* CLAIM_PREVIOUS */
207 } u;
208 const struct qstr * name;
209 const struct nfs_server *server; /* Needed for ID mapping */
210 const u32 * bitmask;
211 __u32 claim;
212 struct nfs4_sequence_args seq_args;
215 struct nfs_openres {
216 nfs4_stateid stateid;
217 struct nfs_fh fh;
218 struct nfs4_change_info cinfo;
219 __u32 rflags;
220 struct nfs_fattr * f_attr;
221 struct nfs_fattr * dir_attr;
222 struct nfs_seqid * seqid;
223 const struct nfs_server *server;
224 fmode_t delegation_type;
225 nfs4_stateid delegation;
226 __u32 do_recall;
227 __u64 maxsize;
228 __u32 attrset[NFS4_BITMAP_SIZE];
229 struct nfs4_sequence_res seq_res;
233 * Arguments to the open_confirm call.
235 struct nfs_open_confirmargs {
236 const struct nfs_fh * fh;
237 nfs4_stateid * stateid;
238 struct nfs_seqid * seqid;
241 struct nfs_open_confirmres {
242 nfs4_stateid stateid;
243 struct nfs_seqid * seqid;
247 * Arguments to the close call.
249 struct nfs_closeargs {
250 struct nfs_fh * fh;
251 nfs4_stateid * stateid;
252 struct nfs_seqid * seqid;
253 fmode_t fmode;
254 const u32 * bitmask;
255 struct nfs4_sequence_args seq_args;
258 struct nfs_closeres {
259 nfs4_stateid stateid;
260 struct nfs_fattr * fattr;
261 struct nfs_seqid * seqid;
262 const struct nfs_server *server;
263 struct nfs4_sequence_res seq_res;
266 * * Arguments to the lock,lockt, and locku call.
267 * */
268 struct nfs_lowner {
269 __u64 clientid;
270 __u64 id;
273 struct nfs_lock_args {
274 struct nfs_fh * fh;
275 struct file_lock * fl;
276 struct nfs_seqid * lock_seqid;
277 nfs4_stateid * lock_stateid;
278 struct nfs_seqid * open_seqid;
279 nfs4_stateid * open_stateid;
280 struct nfs_lowner lock_owner;
281 unsigned char block : 1;
282 unsigned char reclaim : 1;
283 unsigned char new_lock_owner : 1;
284 struct nfs4_sequence_args seq_args;
287 struct nfs_lock_res {
288 nfs4_stateid stateid;
289 struct nfs_seqid * lock_seqid;
290 struct nfs_seqid * open_seqid;
291 struct nfs4_sequence_res seq_res;
294 struct nfs_locku_args {
295 struct nfs_fh * fh;
296 struct file_lock * fl;
297 struct nfs_seqid * seqid;
298 nfs4_stateid * stateid;
299 struct nfs4_sequence_args seq_args;
302 struct nfs_locku_res {
303 nfs4_stateid stateid;
304 struct nfs_seqid * seqid;
305 struct nfs4_sequence_res seq_res;
308 struct nfs_lockt_args {
309 struct nfs_fh * fh;
310 struct file_lock * fl;
311 struct nfs_lowner lock_owner;
312 struct nfs4_sequence_args seq_args;
315 struct nfs_lockt_res {
316 struct file_lock * denied; /* LOCK, LOCKT failed */
317 struct nfs4_sequence_res seq_res;
320 struct nfs_release_lockowner_args {
321 struct nfs_lowner lock_owner;
324 struct nfs4_delegreturnargs {
325 const struct nfs_fh *fhandle;
326 const nfs4_stateid *stateid;
327 const u32 * bitmask;
328 struct nfs4_sequence_args seq_args;
331 struct nfs4_delegreturnres {
332 struct nfs_fattr * fattr;
333 const struct nfs_server *server;
334 struct nfs4_sequence_res seq_res;
338 * Arguments to the read call.
340 struct nfs_readargs {
341 struct nfs_fh * fh;
342 struct nfs_open_context *context;
343 struct nfs_lock_context *lock_context;
344 __u64 offset;
345 __u32 count;
346 unsigned int pgbase;
347 struct page ** pages;
348 struct nfs4_sequence_args seq_args;
351 struct nfs_readres {
352 struct nfs_fattr * fattr;
353 __u32 count;
354 int eof;
355 struct nfs4_sequence_res seq_res;
359 * Arguments to the write call.
361 struct nfs_writeargs {
362 struct nfs_fh * fh;
363 struct nfs_open_context *context;
364 struct nfs_lock_context *lock_context;
365 __u64 offset;
366 __u32 count;
367 enum nfs3_stable_how stable;
368 unsigned int pgbase;
369 struct page ** pages;
370 const u32 * bitmask;
371 struct nfs4_sequence_args seq_args;
374 struct nfs_writeverf {
375 enum nfs3_stable_how committed;
376 __be32 verifier[2];
379 struct nfs_writeres {
380 struct nfs_fattr * fattr;
381 struct nfs_writeverf * verf;
382 __u32 count;
383 const struct nfs_server *server;
384 struct nfs4_sequence_res seq_res;
388 * Common arguments to the unlink call
390 struct nfs_removeargs {
391 const struct nfs_fh *fh;
392 struct qstr name;
393 const u32 * bitmask;
394 struct nfs4_sequence_args seq_args;
397 struct nfs_removeres {
398 const struct nfs_server *server;
399 struct nfs_fattr *dir_attr;
400 struct nfs4_change_info cinfo;
401 struct nfs4_sequence_res seq_res;
405 * Common arguments to the rename call
407 struct nfs_renameargs {
408 const struct nfs_fh *old_dir;
409 const struct nfs_fh *new_dir;
410 const struct qstr *old_name;
411 const struct qstr *new_name;
412 const u32 *bitmask;
413 struct nfs4_sequence_args seq_args;
416 struct nfs_renameres {
417 const struct nfs_server *server;
418 struct nfs4_change_info old_cinfo;
419 struct nfs_fattr *old_fattr;
420 struct nfs4_change_info new_cinfo;
421 struct nfs_fattr *new_fattr;
422 struct nfs4_sequence_res seq_res;
426 * Argument struct for decode_entry function
428 struct nfs_entry {
429 __u64 ino;
430 __u64 cookie,
431 prev_cookie;
432 const char * name;
433 unsigned int len;
434 int eof;
435 struct nfs_fh * fh;
436 struct nfs_fattr * fattr;
440 * The following types are for NFSv2 only.
442 struct nfs_sattrargs {
443 struct nfs_fh * fh;
444 struct iattr * sattr;
447 struct nfs_diropargs {
448 struct nfs_fh * fh;
449 const char * name;
450 unsigned int len;
453 struct nfs_createargs {
454 struct nfs_fh * fh;
455 const char * name;
456 unsigned int len;
457 struct iattr * sattr;
460 struct nfs_setattrargs {
461 struct nfs_fh * fh;
462 nfs4_stateid stateid;
463 struct iattr * iap;
464 const struct nfs_server * server; /* Needed for name mapping */
465 const u32 * bitmask;
466 struct nfs4_sequence_args seq_args;
469 struct nfs_setaclargs {
470 struct nfs_fh * fh;
471 size_t acl_len;
472 unsigned int acl_pgbase;
473 struct page ** acl_pages;
474 struct nfs4_sequence_args seq_args;
477 struct nfs_setaclres {
478 struct nfs4_sequence_res seq_res;
481 struct nfs_getaclargs {
482 struct nfs_fh * fh;
483 size_t acl_len;
484 unsigned int acl_pgbase;
485 struct page ** acl_pages;
486 struct nfs4_sequence_args seq_args;
489 struct nfs_getaclres {
490 size_t acl_len;
491 struct nfs4_sequence_res seq_res;
494 struct nfs_setattrres {
495 struct nfs_fattr * fattr;
496 const struct nfs_server * server;
497 struct nfs4_sequence_res seq_res;
500 struct nfs_linkargs {
501 struct nfs_fh * fromfh;
502 struct nfs_fh * tofh;
503 const char * toname;
504 unsigned int tolen;
507 struct nfs_symlinkargs {
508 struct nfs_fh * fromfh;
509 const char * fromname;
510 unsigned int fromlen;
511 struct page ** pages;
512 unsigned int pathlen;
513 struct iattr * sattr;
516 struct nfs_readdirargs {
517 struct nfs_fh * fh;
518 __u32 cookie;
519 unsigned int count;
520 struct page ** pages;
523 struct nfs3_getaclargs {
524 struct nfs_fh * fh;
525 int mask;
526 struct page ** pages;
529 struct nfs3_setaclargs {
530 struct inode * inode;
531 int mask;
532 struct posix_acl * acl_access;
533 struct posix_acl * acl_default;
534 size_t len;
535 unsigned int npages;
536 struct page ** pages;
539 struct nfs_diropok {
540 struct nfs_fh * fh;
541 struct nfs_fattr * fattr;
544 struct nfs_readlinkargs {
545 struct nfs_fh * fh;
546 unsigned int pgbase;
547 unsigned int pglen;
548 struct page ** pages;
551 struct nfs3_sattrargs {
552 struct nfs_fh * fh;
553 struct iattr * sattr;
554 unsigned int guard;
555 struct timespec guardtime;
558 struct nfs3_diropargs {
559 struct nfs_fh * fh;
560 const char * name;
561 unsigned int len;
564 struct nfs3_accessargs {
565 struct nfs_fh * fh;
566 __u32 access;
569 struct nfs3_createargs {
570 struct nfs_fh * fh;
571 const char * name;
572 unsigned int len;
573 struct iattr * sattr;
574 enum nfs3_createmode createmode;
575 __be32 verifier[2];
578 struct nfs3_mkdirargs {
579 struct nfs_fh * fh;
580 const char * name;
581 unsigned int len;
582 struct iattr * sattr;
585 struct nfs3_symlinkargs {
586 struct nfs_fh * fromfh;
587 const char * fromname;
588 unsigned int fromlen;
589 struct page ** pages;
590 unsigned int pathlen;
591 struct iattr * sattr;
594 struct nfs3_mknodargs {
595 struct nfs_fh * fh;
596 const char * name;
597 unsigned int len;
598 enum nfs3_ftype type;
599 struct iattr * sattr;
600 dev_t rdev;
603 struct nfs3_linkargs {
604 struct nfs_fh * fromfh;
605 struct nfs_fh * tofh;
606 const char * toname;
607 unsigned int tolen;
610 struct nfs3_readdirargs {
611 struct nfs_fh * fh;
612 __u64 cookie;
613 __be32 verf[2];
614 int plus;
615 unsigned int count;
616 struct page ** pages;
619 struct nfs3_diropres {
620 struct nfs_fattr * dir_attr;
621 struct nfs_fh * fh;
622 struct nfs_fattr * fattr;
625 struct nfs3_accessres {
626 struct nfs_fattr * fattr;
627 __u32 access;
630 struct nfs3_readlinkargs {
631 struct nfs_fh * fh;
632 unsigned int pgbase;
633 unsigned int pglen;
634 struct page ** pages;
637 struct nfs3_linkres {
638 struct nfs_fattr * dir_attr;
639 struct nfs_fattr * fattr;
642 struct nfs3_readdirres {
643 struct nfs_fattr * dir_attr;
644 __be32 * verf;
645 int plus;
648 struct nfs3_getaclres {
649 struct nfs_fattr * fattr;
650 int mask;
651 unsigned int acl_access_count;
652 unsigned int acl_default_count;
653 struct posix_acl * acl_access;
654 struct posix_acl * acl_default;
657 #ifdef CONFIG_NFS_V4
659 typedef u64 clientid4;
661 struct nfs4_accessargs {
662 const struct nfs_fh * fh;
663 const u32 * bitmask;
664 u32 access;
665 struct nfs4_sequence_args seq_args;
668 struct nfs4_accessres {
669 const struct nfs_server * server;
670 struct nfs_fattr * fattr;
671 u32 supported;
672 u32 access;
673 struct nfs4_sequence_res seq_res;
676 struct nfs4_create_arg {
677 u32 ftype;
678 union {
679 struct {
680 struct page ** pages;
681 unsigned int len;
682 } symlink; /* NF4LNK */
683 struct {
684 u32 specdata1;
685 u32 specdata2;
686 } device; /* NF4BLK, NF4CHR */
687 } u;
688 const struct qstr * name;
689 const struct nfs_server * server;
690 const struct iattr * attrs;
691 const struct nfs_fh * dir_fh;
692 const u32 * bitmask;
693 struct nfs4_sequence_args seq_args;
696 struct nfs4_create_res {
697 const struct nfs_server * server;
698 struct nfs_fh * fh;
699 struct nfs_fattr * fattr;
700 struct nfs4_change_info dir_cinfo;
701 struct nfs_fattr * dir_fattr;
702 struct nfs4_sequence_res seq_res;
705 struct nfs4_fsinfo_arg {
706 const struct nfs_fh * fh;
707 const u32 * bitmask;
708 struct nfs4_sequence_args seq_args;
711 struct nfs4_fsinfo_res {
712 struct nfs_fsinfo *fsinfo;
713 struct nfs4_sequence_res seq_res;
716 struct nfs4_getattr_arg {
717 const struct nfs_fh * fh;
718 const u32 * bitmask;
719 struct nfs4_sequence_args seq_args;
722 struct nfs4_getattr_res {
723 const struct nfs_server * server;
724 struct nfs_fattr * fattr;
725 struct nfs4_sequence_res seq_res;
728 struct nfs4_link_arg {
729 const struct nfs_fh * fh;
730 const struct nfs_fh * dir_fh;
731 const struct qstr * name;
732 const u32 * bitmask;
733 struct nfs4_sequence_args seq_args;
736 struct nfs4_link_res {
737 const struct nfs_server * server;
738 struct nfs_fattr * fattr;
739 struct nfs4_change_info cinfo;
740 struct nfs_fattr * dir_attr;
741 struct nfs4_sequence_res seq_res;
745 struct nfs4_lookup_arg {
746 const struct nfs_fh * dir_fh;
747 const struct qstr * name;
748 const u32 * bitmask;
749 struct nfs4_sequence_args seq_args;
752 struct nfs4_lookup_res {
753 const struct nfs_server * server;
754 struct nfs_fattr * fattr;
755 struct nfs_fh * fh;
756 struct nfs4_sequence_res seq_res;
759 struct nfs4_lookup_root_arg {
760 const u32 * bitmask;
761 struct nfs4_sequence_args seq_args;
764 struct nfs4_pathconf_arg {
765 const struct nfs_fh * fh;
766 const u32 * bitmask;
767 struct nfs4_sequence_args seq_args;
770 struct nfs4_pathconf_res {
771 struct nfs_pathconf *pathconf;
772 struct nfs4_sequence_res seq_res;
775 struct nfs4_readdir_arg {
776 const struct nfs_fh * fh;
777 u64 cookie;
778 nfs4_verifier verifier;
779 u32 count;
780 struct page ** pages; /* zero-copy data */
781 unsigned int pgbase; /* zero-copy data */
782 const u32 * bitmask;
783 int plus;
784 struct nfs4_sequence_args seq_args;
787 struct nfs4_readdir_res {
788 nfs4_verifier verifier;
789 unsigned int pgbase;
790 struct nfs4_sequence_res seq_res;
793 struct nfs4_readlink {
794 const struct nfs_fh * fh;
795 unsigned int pgbase;
796 unsigned int pglen; /* zero-copy data */
797 struct page ** pages; /* zero-copy data */
798 struct nfs4_sequence_args seq_args;
801 struct nfs4_readlink_res {
802 struct nfs4_sequence_res seq_res;
805 #define NFS4_SETCLIENTID_NAMELEN (127)
806 struct nfs4_setclientid {
807 const nfs4_verifier * sc_verifier;
808 unsigned int sc_name_len;
809 char sc_name[NFS4_SETCLIENTID_NAMELEN + 1];
810 u32 sc_prog;
811 unsigned int sc_netid_len;
812 char sc_netid[RPCBIND_MAXNETIDLEN + 1];
813 unsigned int sc_uaddr_len;
814 char sc_uaddr[RPCBIND_MAXUADDRLEN + 1];
815 u32 sc_cb_ident;
818 struct nfs4_setclientid_res {
819 u64 clientid;
820 nfs4_verifier confirm;
823 struct nfs4_statfs_arg {
824 const struct nfs_fh * fh;
825 const u32 * bitmask;
826 struct nfs4_sequence_args seq_args;
829 struct nfs4_statfs_res {
830 struct nfs_fsstat *fsstat;
831 struct nfs4_sequence_res seq_res;
834 struct nfs4_server_caps_arg {
835 struct nfs_fh *fhandle;
836 struct nfs4_sequence_args seq_args;
839 struct nfs4_server_caps_res {
840 u32 attr_bitmask[2];
841 u32 acl_bitmask;
842 u32 has_links;
843 u32 has_symlinks;
844 struct nfs4_sequence_res seq_res;
847 struct nfs4_string {
848 unsigned int len;
849 char *data;
852 #define NFS4_PATHNAME_MAXCOMPONENTS 512
853 struct nfs4_pathname {
854 unsigned int ncomponents;
855 struct nfs4_string components[NFS4_PATHNAME_MAXCOMPONENTS];
858 #define NFS4_FS_LOCATION_MAXSERVERS 10
859 struct nfs4_fs_location {
860 unsigned int nservers;
861 struct nfs4_string servers[NFS4_FS_LOCATION_MAXSERVERS];
862 struct nfs4_pathname rootpath;
865 #define NFS4_FS_LOCATIONS_MAXENTRIES 10
866 struct nfs4_fs_locations {
867 struct nfs_fattr fattr;
868 const struct nfs_server *server;
869 struct nfs4_pathname fs_path;
870 int nlocations;
871 struct nfs4_fs_location locations[NFS4_FS_LOCATIONS_MAXENTRIES];
874 struct nfs4_fs_locations_arg {
875 const struct nfs_fh *dir_fh;
876 const struct qstr *name;
877 struct page *page;
878 const u32 *bitmask;
879 struct nfs4_sequence_args seq_args;
882 struct nfs4_fs_locations_res {
883 struct nfs4_fs_locations *fs_locations;
884 struct nfs4_sequence_res seq_res;
887 #endif /* CONFIG_NFS_V4 */
889 struct nfstime4 {
890 u64 seconds;
891 u32 nseconds;
894 #ifdef CONFIG_NFS_V4_1
895 struct nfs_impl_id4 {
896 u32 domain_len;
897 char *domain;
898 u32 name_len;
899 char *name;
900 struct nfstime4 date;
903 #define NFS4_EXCHANGE_ID_LEN (48)
904 struct nfs41_exchange_id_args {
905 struct nfs_client *client;
906 nfs4_verifier *verifier;
907 unsigned int id_len;
908 char id[NFS4_EXCHANGE_ID_LEN];
909 u32 flags;
912 struct server_owner {
913 uint64_t minor_id;
914 uint32_t major_id_sz;
915 char major_id[NFS4_OPAQUE_LIMIT];
918 struct server_scope {
919 uint32_t server_scope_sz;
920 char server_scope[NFS4_OPAQUE_LIMIT];
923 struct nfs41_exchange_id_res {
924 struct nfs_client *client;
925 u32 flags;
928 struct nfs41_create_session_args {
929 struct nfs_client *client;
930 uint32_t flags;
931 uint32_t cb_program;
932 struct nfs4_channel_attrs fc_attrs; /* Fore Channel */
933 struct nfs4_channel_attrs bc_attrs; /* Back Channel */
936 struct nfs41_create_session_res {
937 struct nfs_client *client;
940 struct nfs41_reclaim_complete_args {
941 /* In the future extend to include curr_fh for use with migration */
942 unsigned char one_fs:1;
943 struct nfs4_sequence_args seq_args;
946 struct nfs41_reclaim_complete_res {
947 struct nfs4_sequence_res seq_res;
949 #endif /* CONFIG_NFS_V4_1 */
951 struct nfs_page;
953 #define NFS_PAGEVEC_SIZE (8U)
955 struct nfs_read_data {
956 int flags;
957 struct rpc_task task;
958 struct inode *inode;
959 struct rpc_cred *cred;
960 struct nfs_fattr fattr; /* fattr storage */
961 struct list_head pages; /* Coalesced read requests */
962 struct nfs_page *req; /* multi ops per nfs_page */
963 struct page **pagevec;
964 unsigned int npages; /* Max length of pagevec */
965 struct nfs_readargs args;
966 struct nfs_readres res;
967 #ifdef CONFIG_NFS_V4
968 unsigned long timestamp; /* For lease renewal */
969 #endif
970 struct page *page_array[NFS_PAGEVEC_SIZE];
973 struct nfs_write_data {
974 int flags;
975 struct rpc_task task;
976 struct inode *inode;
977 struct rpc_cred *cred;
978 struct nfs_fattr fattr;
979 struct nfs_writeverf verf;
980 struct list_head pages; /* Coalesced requests we wish to flush */
981 struct nfs_page *req; /* multi ops per nfs_page */
982 struct page **pagevec;
983 unsigned int npages; /* Max length of pagevec */
984 struct nfs_writeargs args; /* argument struct */
985 struct nfs_writeres res; /* result struct */
986 #ifdef CONFIG_NFS_V4
987 unsigned long timestamp; /* For lease renewal */
988 #endif
989 struct page *page_array[NFS_PAGEVEC_SIZE];
992 struct nfs_access_entry;
995 * RPC procedure vector for NFSv2/NFSv3 demuxing
997 struct nfs_rpc_ops {
998 u32 version; /* Protocol version */
999 const struct dentry_operations *dentry_ops;
1000 const struct inode_operations *dir_inode_ops;
1001 const struct inode_operations *file_inode_ops;
1003 int (*getroot) (struct nfs_server *, struct nfs_fh *,
1004 struct nfs_fsinfo *);
1005 int (*lookupfh)(struct nfs_server *, struct nfs_fh *,
1006 struct qstr *, struct nfs_fh *,
1007 struct nfs_fattr *);
1008 int (*getattr) (struct nfs_server *, struct nfs_fh *,
1009 struct nfs_fattr *);
1010 int (*setattr) (struct dentry *, struct nfs_fattr *,
1011 struct iattr *);
1012 int (*lookup) (struct inode *, struct qstr *,
1013 struct nfs_fh *, struct nfs_fattr *);
1014 int (*access) (struct inode *, struct nfs_access_entry *);
1015 int (*readlink)(struct inode *, struct page *, unsigned int,
1016 unsigned int);
1017 int (*create) (struct inode *, struct dentry *,
1018 struct iattr *, int, struct nfs_open_context *);
1019 int (*remove) (struct inode *, struct qstr *);
1020 void (*unlink_setup) (struct rpc_message *, struct inode *dir);
1021 int (*unlink_done) (struct rpc_task *, struct inode *);
1022 int (*rename) (struct inode *, struct qstr *,
1023 struct inode *, struct qstr *);
1024 void (*rename_setup) (struct rpc_message *msg, struct inode *dir);
1025 int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir);
1026 int (*link) (struct inode *, struct inode *, struct qstr *);
1027 int (*symlink) (struct inode *, struct dentry *, struct page *,
1028 unsigned int, struct iattr *);
1029 int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
1030 int (*rmdir) (struct inode *, struct qstr *);
1031 int (*readdir) (struct dentry *, struct rpc_cred *,
1032 u64, struct page **, unsigned int, int);
1033 int (*mknod) (struct inode *, struct dentry *, struct iattr *,
1034 dev_t);
1035 int (*statfs) (struct nfs_server *, struct nfs_fh *,
1036 struct nfs_fsstat *);
1037 int (*fsinfo) (struct nfs_server *, struct nfs_fh *,
1038 struct nfs_fsinfo *);
1039 int (*pathconf) (struct nfs_server *, struct nfs_fh *,
1040 struct nfs_pathconf *);
1041 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
1042 __be32 *(*decode_dirent)(struct xdr_stream *, struct nfs_entry *, struct nfs_server *, int plus);
1043 void (*read_setup) (struct nfs_read_data *, struct rpc_message *);
1044 int (*read_done) (struct rpc_task *, struct nfs_read_data *);
1045 void (*write_setup) (struct nfs_write_data *, struct rpc_message *);
1046 int (*write_done) (struct rpc_task *, struct nfs_write_data *);
1047 void (*commit_setup) (struct nfs_write_data *, struct rpc_message *);
1048 int (*commit_done) (struct rpc_task *, struct nfs_write_data *);
1049 int (*lock)(struct file *, int, struct file_lock *);
1050 int (*lock_check_bounds)(const struct file_lock *);
1051 void (*clear_acl_cache)(struct inode *);
1052 void (*close_context)(struct nfs_open_context *ctx, int);
1053 struct inode * (*open_context) (struct inode *dir,
1054 struct nfs_open_context *ctx,
1055 int open_flags,
1056 struct iattr *iattr);
1060 * NFS_CALL(getattr, inode, (fattr));
1061 * into
1062 * NFS_PROTO(inode)->getattr(fattr);
1064 #define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args
1067 * Function vectors etc. for the NFS client
1069 extern const struct nfs_rpc_ops nfs_v2_clientops;
1070 extern const struct nfs_rpc_ops nfs_v3_clientops;
1071 extern const struct nfs_rpc_ops nfs_v4_clientops;
1072 extern struct rpc_version nfs_version2;
1073 extern struct rpc_version nfs_version3;
1074 extern struct rpc_version nfs_version4;
1076 extern struct rpc_version nfsacl_version3;
1077 extern struct rpc_program nfsacl_program;
1079 #endif