1 #ifndef _LINUX_NFS_XDR_H
2 #define _LINUX_NFS_XDR_H
4 #include <linux/nfsacl.h>
5 #include <linux/sunrpc/gss_api.h>
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 /* Forward declaration for NFS v3 */
18 struct nfs4_secinfo_flavors;
31 * Helper for checking equality between 2 fsids.
33 static inline int nfs_fsid_equal(const struct nfs_fsid *a, const struct nfs_fsid *b)
35 return a->major == b->major && a->minor == b->minor;
39 unsigned int valid; /* which fields are valid */
57 __u64 mounted_on_fileid;
58 struct timespec atime;
59 struct timespec mtime;
60 struct timespec ctime;
61 __u64 change_attr; /* NFSv4 change attribute */
62 __u64 pre_change_attr;/* pre-op NFSv4 change attribute */
63 __u64 pre_size; /* pre_op_attr.size */
64 struct timespec pre_mtime; /* pre_op_attr.mtime */
65 struct timespec pre_ctime; /* pre_op_attr.ctime */
66 unsigned long time_start;
67 unsigned long gencount;
68 struct nfs4_string *owner_name;
69 struct nfs4_string *group_name;
72 #define NFS_ATTR_FATTR_TYPE (1U << 0)
73 #define NFS_ATTR_FATTR_MODE (1U << 1)
74 #define NFS_ATTR_FATTR_NLINK (1U << 2)
75 #define NFS_ATTR_FATTR_OWNER (1U << 3)
76 #define NFS_ATTR_FATTR_GROUP (1U << 4)
77 #define NFS_ATTR_FATTR_RDEV (1U << 5)
78 #define NFS_ATTR_FATTR_SIZE (1U << 6)
79 #define NFS_ATTR_FATTR_PRESIZE (1U << 7)
80 #define NFS_ATTR_FATTR_BLOCKS_USED (1U << 8)
81 #define NFS_ATTR_FATTR_SPACE_USED (1U << 9)
82 #define NFS_ATTR_FATTR_FSID (1U << 10)
83 #define NFS_ATTR_FATTR_FILEID (1U << 11)
84 #define NFS_ATTR_FATTR_ATIME (1U << 12)
85 #define NFS_ATTR_FATTR_MTIME (1U << 13)
86 #define NFS_ATTR_FATTR_CTIME (1U << 14)
87 #define NFS_ATTR_FATTR_PREMTIME (1U << 15)
88 #define NFS_ATTR_FATTR_PRECTIME (1U << 16)
89 #define NFS_ATTR_FATTR_CHANGE (1U << 17)
90 #define NFS_ATTR_FATTR_PRECHANGE (1U << 18)
91 #define NFS_ATTR_FATTR_V4_REFERRAL (1U << 19) /* NFSv4 referral */
92 #define NFS_ATTR_FATTR_MOUNTPOINT (1U << 20) /* Treat as mountpoint */
93 #define NFS_ATTR_FATTR_MOUNTED_ON_FILEID (1U << 21)
94 #define NFS_ATTR_FATTR_OWNER_NAME (1U << 22)
95 #define NFS_ATTR_FATTR_GROUP_NAME (1U << 23)
97 #define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \
98 | NFS_ATTR_FATTR_MODE \
99 | NFS_ATTR_FATTR_NLINK \
100 | NFS_ATTR_FATTR_OWNER \
101 | NFS_ATTR_FATTR_GROUP \
102 | NFS_ATTR_FATTR_RDEV \
103 | NFS_ATTR_FATTR_SIZE \
104 | NFS_ATTR_FATTR_FSID \
105 | NFS_ATTR_FATTR_FILEID \
106 | NFS_ATTR_FATTR_ATIME \
107 | NFS_ATTR_FATTR_MTIME \
108 | NFS_ATTR_FATTR_CTIME)
109 #define NFS_ATTR_FATTR_V2 (NFS_ATTR_FATTR \
110 | NFS_ATTR_FATTR_BLOCKS_USED)
111 #define NFS_ATTR_FATTR_V3 (NFS_ATTR_FATTR \
112 | NFS_ATTR_FATTR_SPACE_USED)
113 #define NFS_ATTR_FATTR_V4 (NFS_ATTR_FATTR \
114 | NFS_ATTR_FATTR_SPACE_USED \
115 | NFS_ATTR_FATTR_CHANGE)
118 * Info on the file system
121 struct nfs_fattr *fattr; /* Post-op attributes */
122 __u32 rtmax; /* max. read transfer size */
123 __u32 rtpref; /* pref. read transfer size */
124 __u32 rtmult; /* reads should be multiple of this */
125 __u32 wtmax; /* max. write transfer size */
126 __u32 wtpref; /* pref. write transfer size */
127 __u32 wtmult; /* writes should be multiple of this */
128 __u32 dtpref; /* pref. readdir transfer size */
130 struct timespec time_delta; /* server time granularity */
131 __u32 lease_time; /* in seconds */
132 __u32 layouttype; /* supported pnfs layout driver */
133 __u32 blksize; /* preferred pnfs io block size */
137 struct nfs_fattr *fattr; /* Post-op attributes */
138 __u64 tbytes; /* total size in bytes */
139 __u64 fbytes; /* # of free bytes */
140 __u64 abytes; /* # of bytes available to user */
141 __u64 tfiles; /* # of files */
142 __u64 ffiles; /* # of free files */
143 __u64 afiles; /* # of files available to user */
147 __u32 tsize; /* Server transfer size */
148 __u32 bsize; /* Filesystem block size */
149 __u32 blocks; /* No. of "bsize" blocks on filesystem */
150 __u32 bfree; /* No. of free "bsize" blocks */
151 __u32 bavail; /* No. of available "bsize" blocks */
154 struct nfs_pathconf {
155 struct nfs_fattr *fattr; /* Post-op attributes */
156 __u32 max_link; /* max # of hard links */
157 __u32 max_namelen; /* max name length */
160 struct nfs4_change_info {
168 /* nfs41 sessions channel attributes */
169 struct nfs4_channel_attrs {
172 u32 max_resp_sz_cached;
177 /* nfs41 sessions slot seqid */
182 struct nfs4_sequence_args {
183 struct nfs4_session *sa_session;
188 struct nfs4_sequence_res {
189 struct nfs4_session *sr_session;
190 struct nfs4_slot *sr_slot; /* slot used to send request */
191 int sr_status; /* sequence operation status */
192 unsigned long sr_renewal_time;
196 struct nfs4_get_lease_time_args {
197 struct nfs4_sequence_args la_seq_args;
200 struct nfs4_get_lease_time_res {
201 struct nfs_fsinfo *lr_fsinfo;
202 struct nfs4_sequence_res lr_seq_res;
205 #define PNFS_LAYOUT_MAXSIZE 4096
207 struct nfs4_layoutdriver_data {
213 struct pnfs_layout_range {
219 struct nfs4_layoutget_args {
221 struct pnfs_layout_range range;
225 struct nfs_open_context *ctx;
226 struct nfs4_sequence_args seq_args;
227 nfs4_stateid stateid;
228 struct nfs4_layoutdriver_data layout;
231 struct nfs4_layoutget_res {
232 __u32 return_on_close;
233 struct pnfs_layout_range range;
235 nfs4_stateid stateid;
236 struct nfs4_sequence_res seq_res;
237 struct nfs4_layoutdriver_data *layoutp;
240 struct nfs4_layoutget {
241 struct nfs4_layoutget_args args;
242 struct nfs4_layoutget_res res;
243 struct pnfs_layout_segment **lsegpp;
247 struct nfs4_getdevicelist_args {
248 const struct nfs_fh *fh;
250 struct nfs4_sequence_args seq_args;
253 struct nfs4_getdevicelist_res {
254 struct pnfs_devicelist *devlist;
255 struct nfs4_sequence_res seq_res;
258 struct nfs4_getdeviceinfo_args {
259 struct pnfs_device *pdev;
260 struct nfs4_sequence_args seq_args;
263 struct nfs4_getdeviceinfo_res {
264 struct pnfs_device *pdev;
265 struct nfs4_sequence_res seq_res;
268 struct nfs4_layoutcommit_args {
269 nfs4_stateid stateid;
270 __u64 lastbytewritten;
273 struct nfs4_sequence_args seq_args;
276 struct nfs4_layoutcommit_res {
277 struct nfs_fattr *fattr;
278 const struct nfs_server *server;
279 struct nfs4_sequence_res seq_res;
283 struct nfs4_layoutcommit_data {
284 struct rpc_task task;
285 struct nfs_fattr fattr;
286 struct list_head lseg_list;
287 struct rpc_cred *cred;
288 struct nfs4_layoutcommit_args args;
289 struct nfs4_layoutcommit_res res;
292 struct nfs4_layoutreturn_args {
293 struct pnfs_layout_hdr *layout;
295 nfs4_stateid stateid;
297 struct nfs4_sequence_args seq_args;
300 struct nfs4_layoutreturn_res {
301 struct nfs4_sequence_res seq_res;
303 nfs4_stateid stateid;
306 struct nfs4_layoutreturn {
307 struct nfs4_layoutreturn_args args;
308 struct nfs4_layoutreturn_res res;
309 struct rpc_cred *cred;
310 struct nfs_client *clp;
315 * Arguments to the open call.
317 struct nfs_openargs {
318 const struct nfs_fh * fh;
319 struct nfs_seqid * seqid;
326 struct iattr * attrs; /* UNCHECKED, GUARDED */
327 nfs4_verifier verifier; /* EXCLUSIVE */
329 nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */
330 fmode_t delegation_type; /* CLAIM_PREVIOUS */
332 const struct qstr * name;
333 const struct nfs_server *server; /* Needed for ID mapping */
335 const u32 * dir_bitmask;
337 struct nfs4_sequence_args seq_args;
341 nfs4_stateid stateid;
343 struct nfs4_change_info cinfo;
345 struct nfs_fattr * f_attr;
346 struct nfs_fattr * dir_attr;
347 struct nfs_seqid * seqid;
348 const struct nfs_server *server;
349 fmode_t delegation_type;
350 nfs4_stateid delegation;
353 __u32 attrset[NFS4_BITMAP_SIZE];
354 struct nfs4_string *owner;
355 struct nfs4_string *group_owner;
356 struct nfs4_sequence_res seq_res;
360 * Arguments to the open_confirm call.
362 struct nfs_open_confirmargs {
363 const struct nfs_fh * fh;
364 nfs4_stateid * stateid;
365 struct nfs_seqid * seqid;
368 struct nfs_open_confirmres {
369 nfs4_stateid stateid;
370 struct nfs_seqid * seqid;
374 * Arguments to the close call.
376 struct nfs_closeargs {
378 nfs4_stateid * stateid;
379 struct nfs_seqid * seqid;
382 struct nfs4_sequence_args seq_args;
385 struct nfs_closeres {
386 nfs4_stateid stateid;
387 struct nfs_fattr * fattr;
388 struct nfs_seqid * seqid;
389 const struct nfs_server *server;
390 struct nfs4_sequence_res seq_res;
393 * * Arguments to the lock,lockt, and locku call.
401 struct nfs_lock_args {
403 struct file_lock * fl;
404 struct nfs_seqid * lock_seqid;
405 nfs4_stateid * lock_stateid;
406 struct nfs_seqid * open_seqid;
407 nfs4_stateid * open_stateid;
408 struct nfs_lowner lock_owner;
409 unsigned char block : 1;
410 unsigned char reclaim : 1;
411 unsigned char new_lock_owner : 1;
412 struct nfs4_sequence_args seq_args;
415 struct nfs_lock_res {
416 nfs4_stateid stateid;
417 struct nfs_seqid * lock_seqid;
418 struct nfs_seqid * open_seqid;
419 struct nfs4_sequence_res seq_res;
422 struct nfs_locku_args {
424 struct file_lock * fl;
425 struct nfs_seqid * seqid;
426 nfs4_stateid * stateid;
427 struct nfs4_sequence_args seq_args;
430 struct nfs_locku_res {
431 nfs4_stateid stateid;
432 struct nfs_seqid * seqid;
433 struct nfs4_sequence_res seq_res;
436 struct nfs_lockt_args {
438 struct file_lock * fl;
439 struct nfs_lowner lock_owner;
440 struct nfs4_sequence_args seq_args;
443 struct nfs_lockt_res {
444 struct file_lock * denied; /* LOCK, LOCKT failed */
445 struct nfs4_sequence_res seq_res;
448 struct nfs_release_lockowner_args {
449 struct nfs_lowner lock_owner;
452 struct nfs4_delegreturnargs {
453 const struct nfs_fh *fhandle;
454 const nfs4_stateid *stateid;
456 struct nfs4_sequence_args seq_args;
459 struct nfs4_delegreturnres {
460 struct nfs_fattr * fattr;
461 const struct nfs_server *server;
462 struct nfs4_sequence_res seq_res;
466 * Arguments to the read call.
468 struct nfs_readargs {
470 struct nfs_open_context *context;
471 struct nfs_lock_context *lock_context;
475 struct page ** pages;
476 struct nfs4_sequence_args seq_args;
480 struct nfs_fattr * fattr;
483 struct nfs4_sequence_res seq_res;
487 * Arguments to the write call.
489 struct nfs_writeargs {
491 struct nfs_open_context *context;
492 struct nfs_lock_context *lock_context;
495 enum nfs3_stable_how stable;
497 struct page ** pages;
499 struct nfs4_sequence_args seq_args;
502 struct nfs_writeverf {
503 enum nfs3_stable_how committed;
507 struct nfs_writeres {
508 struct nfs_fattr * fattr;
509 struct nfs_writeverf * verf;
511 const struct nfs_server *server;
512 struct nfs4_sequence_res seq_res;
516 * Common arguments to the unlink call
518 struct nfs_removeargs {
519 const struct nfs_fh *fh;
522 struct nfs4_sequence_args seq_args;
525 struct nfs_removeres {
526 const struct nfs_server *server;
527 struct nfs_fattr *dir_attr;
528 struct nfs4_change_info cinfo;
529 struct nfs4_sequence_res seq_res;
533 * Common arguments to the rename call
535 struct nfs_renameargs {
536 const struct nfs_fh *old_dir;
537 const struct nfs_fh *new_dir;
538 const struct qstr *old_name;
539 const struct qstr *new_name;
541 struct nfs4_sequence_args seq_args;
544 struct nfs_renameres {
545 const struct nfs_server *server;
546 struct nfs4_change_info old_cinfo;
547 struct nfs_fattr *old_fattr;
548 struct nfs4_change_info new_cinfo;
549 struct nfs_fattr *new_fattr;
550 struct nfs4_sequence_res seq_res;
554 * Argument struct for decode_entry function
564 struct nfs_fattr * fattr;
565 unsigned char d_type;
566 struct nfs_server * server;
570 * The following types are for NFSv2 only.
572 struct nfs_sattrargs {
574 struct iattr * sattr;
577 struct nfs_diropargs {
583 struct nfs_createargs {
587 struct iattr * sattr;
590 struct nfs_setattrargs {
592 nfs4_stateid stateid;
594 const struct nfs_server * server; /* Needed for name mapping */
596 struct nfs4_sequence_args seq_args;
599 struct nfs_setaclargs {
602 unsigned int acl_pgbase;
603 struct page ** acl_pages;
604 struct nfs4_sequence_args seq_args;
607 struct nfs_setaclres {
608 struct nfs4_sequence_res seq_res;
611 struct nfs_getaclargs {
614 unsigned int acl_pgbase;
615 struct page ** acl_pages;
616 struct page * acl_scratch;
617 struct nfs4_sequence_args seq_args;
620 /* getxattr ACL interface flags */
621 #define NFS4_ACL_LEN_REQUEST 0x0001 /* zero length getxattr buffer */
622 struct nfs_getaclres {
624 size_t acl_data_offset;
626 struct nfs4_sequence_res seq_res;
629 struct nfs_setattrres {
630 struct nfs_fattr * fattr;
631 const struct nfs_server * server;
632 struct nfs4_sequence_res seq_res;
635 struct nfs_linkargs {
636 struct nfs_fh * fromfh;
637 struct nfs_fh * tofh;
642 struct nfs_symlinkargs {
643 struct nfs_fh * fromfh;
644 const char * fromname;
645 unsigned int fromlen;
646 struct page ** pages;
647 unsigned int pathlen;
648 struct iattr * sattr;
651 struct nfs_readdirargs {
655 struct page ** pages;
658 struct nfs3_getaclargs {
661 struct page ** pages;
664 struct nfs3_setaclargs {
665 struct inode * inode;
667 struct posix_acl * acl_access;
668 struct posix_acl * acl_default;
671 struct page ** pages;
676 struct nfs_fattr * fattr;
679 struct nfs_readlinkargs {
683 struct page ** pages;
686 struct nfs3_sattrargs {
688 struct iattr * sattr;
690 struct timespec guardtime;
693 struct nfs3_diropargs {
699 struct nfs3_accessargs {
704 struct nfs3_createargs {
708 struct iattr * sattr;
709 enum nfs3_createmode createmode;
713 struct nfs3_mkdirargs {
717 struct iattr * sattr;
720 struct nfs3_symlinkargs {
721 struct nfs_fh * fromfh;
722 const char * fromname;
723 unsigned int fromlen;
724 struct page ** pages;
725 unsigned int pathlen;
726 struct iattr * sattr;
729 struct nfs3_mknodargs {
733 enum nfs3_ftype type;
734 struct iattr * sattr;
738 struct nfs3_linkargs {
739 struct nfs_fh * fromfh;
740 struct nfs_fh * tofh;
745 struct nfs3_readdirargs {
751 struct page ** pages;
754 struct nfs3_diropres {
755 struct nfs_fattr * dir_attr;
757 struct nfs_fattr * fattr;
760 struct nfs3_accessres {
761 struct nfs_fattr * fattr;
765 struct nfs3_readlinkargs {
769 struct page ** pages;
772 struct nfs3_linkres {
773 struct nfs_fattr * dir_attr;
774 struct nfs_fattr * fattr;
777 struct nfs3_readdirres {
778 struct nfs_fattr * dir_attr;
783 struct nfs3_getaclres {
784 struct nfs_fattr * fattr;
786 unsigned int acl_access_count;
787 unsigned int acl_default_count;
788 struct posix_acl * acl_access;
789 struct posix_acl * acl_default;
794 typedef u64 clientid4;
796 struct nfs4_accessargs {
797 const struct nfs_fh * fh;
800 struct nfs4_sequence_args seq_args;
803 struct nfs4_accessres {
804 const struct nfs_server * server;
805 struct nfs_fattr * fattr;
808 struct nfs4_sequence_res seq_res;
811 struct nfs4_create_arg {
815 struct page ** pages;
817 } symlink; /* NF4LNK */
821 } device; /* NF4BLK, NF4CHR */
823 const struct qstr * name;
824 const struct nfs_server * server;
825 const struct iattr * attrs;
826 const struct nfs_fh * dir_fh;
828 struct nfs4_sequence_args seq_args;
831 struct nfs4_create_res {
832 const struct nfs_server * server;
834 struct nfs_fattr * fattr;
835 struct nfs4_change_info dir_cinfo;
836 struct nfs_fattr * dir_fattr;
837 struct nfs4_sequence_res seq_res;
840 struct nfs4_fsinfo_arg {
841 const struct nfs_fh * fh;
843 struct nfs4_sequence_args seq_args;
846 struct nfs4_fsinfo_res {
847 struct nfs_fsinfo *fsinfo;
848 struct nfs4_sequence_res seq_res;
851 struct nfs4_getattr_arg {
852 const struct nfs_fh * fh;
854 struct nfs4_sequence_args seq_args;
857 struct nfs4_getattr_res {
858 const struct nfs_server * server;
859 struct nfs_fattr * fattr;
860 struct nfs4_sequence_res seq_res;
863 struct nfs4_link_arg {
864 const struct nfs_fh * fh;
865 const struct nfs_fh * dir_fh;
866 const struct qstr * name;
868 struct nfs4_sequence_args seq_args;
871 struct nfs4_link_res {
872 const struct nfs_server * server;
873 struct nfs_fattr * fattr;
874 struct nfs4_change_info cinfo;
875 struct nfs_fattr * dir_attr;
876 struct nfs4_sequence_res seq_res;
880 struct nfs4_lookup_arg {
881 const struct nfs_fh * dir_fh;
882 const struct qstr * name;
884 struct nfs4_sequence_args seq_args;
887 struct nfs4_lookup_res {
888 const struct nfs_server * server;
889 struct nfs_fattr * fattr;
891 struct nfs4_sequence_res seq_res;
894 struct nfs4_lookup_root_arg {
896 struct nfs4_sequence_args seq_args;
899 struct nfs4_pathconf_arg {
900 const struct nfs_fh * fh;
902 struct nfs4_sequence_args seq_args;
905 struct nfs4_pathconf_res {
906 struct nfs_pathconf *pathconf;
907 struct nfs4_sequence_res seq_res;
910 struct nfs4_readdir_arg {
911 const struct nfs_fh * fh;
913 nfs4_verifier verifier;
915 struct page ** pages; /* zero-copy data */
916 unsigned int pgbase; /* zero-copy data */
919 struct nfs4_sequence_args seq_args;
922 struct nfs4_readdir_res {
923 nfs4_verifier verifier;
925 struct nfs4_sequence_res seq_res;
928 struct nfs4_readlink {
929 const struct nfs_fh * fh;
931 unsigned int pglen; /* zero-copy data */
932 struct page ** pages; /* zero-copy data */
933 struct nfs4_sequence_args seq_args;
936 struct nfs4_readlink_res {
937 struct nfs4_sequence_res seq_res;
940 #define NFS4_SETCLIENTID_NAMELEN (127)
941 struct nfs4_setclientid {
942 const nfs4_verifier * sc_verifier;
943 unsigned int sc_name_len;
944 char sc_name[NFS4_SETCLIENTID_NAMELEN + 1];
946 unsigned int sc_netid_len;
947 char sc_netid[RPCBIND_MAXNETIDLEN + 1];
948 unsigned int sc_uaddr_len;
949 char sc_uaddr[RPCBIND_MAXUADDRLEN + 1];
953 struct nfs4_setclientid_res {
955 nfs4_verifier confirm;
958 struct nfs4_statfs_arg {
959 const struct nfs_fh * fh;
961 struct nfs4_sequence_args seq_args;
964 struct nfs4_statfs_res {
965 struct nfs_fsstat *fsstat;
966 struct nfs4_sequence_res seq_res;
969 struct nfs4_server_caps_arg {
970 struct nfs_fh *fhandle;
971 struct nfs4_sequence_args seq_args;
974 struct nfs4_server_caps_res {
979 struct nfs4_sequence_res seq_res;
982 #define NFS4_PATHNAME_MAXCOMPONENTS 512
983 struct nfs4_pathname {
984 unsigned int ncomponents;
985 struct nfs4_string components[NFS4_PATHNAME_MAXCOMPONENTS];
988 #define NFS4_FS_LOCATION_MAXSERVERS 10
989 struct nfs4_fs_location {
990 unsigned int nservers;
991 struct nfs4_string servers[NFS4_FS_LOCATION_MAXSERVERS];
992 struct nfs4_pathname rootpath;
995 #define NFS4_FS_LOCATIONS_MAXENTRIES 10
996 struct nfs4_fs_locations {
997 struct nfs_fattr fattr;
998 const struct nfs_server *server;
999 struct nfs4_pathname fs_path;
1001 struct nfs4_fs_location locations[NFS4_FS_LOCATIONS_MAXENTRIES];
1004 struct nfs4_fs_locations_arg {
1005 const struct nfs_fh *dir_fh;
1006 const struct qstr *name;
1009 struct nfs4_sequence_args seq_args;
1012 struct nfs4_fs_locations_res {
1013 struct nfs4_fs_locations *fs_locations;
1014 struct nfs4_sequence_res seq_res;
1017 struct nfs4_secinfo_oid {
1019 char data[GSS_OID_MAX_LEN];
1022 struct nfs4_secinfo_gss {
1023 struct nfs4_secinfo_oid sec_oid4;
1025 unsigned int service;
1028 struct nfs4_secinfo_flavor {
1029 unsigned int flavor;
1030 struct nfs4_secinfo_gss gss;
1033 struct nfs4_secinfo_flavors {
1034 unsigned int num_flavors;
1035 struct nfs4_secinfo_flavor flavors[0];
1038 struct nfs4_secinfo_arg {
1039 const struct nfs_fh *dir_fh;
1040 const struct qstr *name;
1041 struct nfs4_sequence_args seq_args;
1044 struct nfs4_secinfo_res {
1045 struct nfs4_secinfo_flavors *flavors;
1046 struct nfs4_sequence_res seq_res;
1049 #endif /* CONFIG_NFS_V4 */
1056 #ifdef CONFIG_NFS_V4_1
1057 struct nfs_impl_id4 {
1062 struct nfstime4 date;
1065 #define NFS4_EXCHANGE_ID_LEN (48)
1066 struct nfs41_exchange_id_args {
1067 struct nfs_client *client;
1068 nfs4_verifier *verifier;
1069 unsigned int id_len;
1070 char id[NFS4_EXCHANGE_ID_LEN];
1074 struct server_owner {
1076 uint32_t major_id_sz;
1077 char major_id[NFS4_OPAQUE_LIMIT];
1080 struct server_scope {
1081 uint32_t server_scope_sz;
1082 char server_scope[NFS4_OPAQUE_LIMIT];
1085 struct nfs41_exchange_id_res {
1086 struct nfs_client *client;
1088 struct server_scope *server_scope;
1091 struct nfs41_create_session_args {
1092 struct nfs_client *client;
1094 uint32_t cb_program;
1095 struct nfs4_channel_attrs fc_attrs; /* Fore Channel */
1096 struct nfs4_channel_attrs bc_attrs; /* Back Channel */
1099 struct nfs41_create_session_res {
1100 struct nfs_client *client;
1103 struct nfs41_reclaim_complete_args {
1104 /* In the future extend to include curr_fh for use with migration */
1105 unsigned char one_fs:1;
1106 struct nfs4_sequence_args seq_args;
1109 struct nfs41_reclaim_complete_res {
1110 struct nfs4_sequence_res seq_res;
1113 #define SECINFO_STYLE_CURRENT_FH 0
1114 #define SECINFO_STYLE_PARENT 1
1115 struct nfs41_secinfo_no_name_args {
1117 struct nfs4_sequence_args seq_args;
1120 struct nfs41_test_stateid_args {
1121 nfs4_stateid *stateid;
1122 struct nfs4_sequence_args seq_args;
1125 struct nfs41_test_stateid_res {
1126 unsigned int status;
1127 struct nfs4_sequence_res seq_res;
1130 struct nfs41_free_stateid_args {
1131 nfs4_stateid *stateid;
1132 struct nfs4_sequence_args seq_args;
1135 struct nfs41_free_stateid_res {
1136 unsigned int status;
1137 struct nfs4_sequence_res seq_res;
1140 #endif /* CONFIG_NFS_V4_1 */
1144 #define NFS_PAGEVEC_SIZE (8U)
1146 struct nfs_read_data {
1147 struct rpc_task task;
1148 struct inode *inode;
1149 struct rpc_cred *cred;
1150 struct nfs_fattr fattr; /* fattr storage */
1151 struct list_head pages; /* Coalesced read requests */
1152 struct list_head list; /* lists of struct nfs_read_data */
1153 struct nfs_page *req; /* multi ops per nfs_page */
1154 struct page **pagevec;
1155 unsigned int npages; /* Max length of pagevec */
1156 struct nfs_readargs args;
1157 struct nfs_readres res;
1158 unsigned long timestamp; /* For lease renewal */
1159 struct pnfs_layout_segment *lseg;
1160 struct nfs_client *ds_clp; /* pNFS data server */
1161 const struct rpc_call_ops *mds_ops;
1162 int (*read_done_cb) (struct rpc_task *task, struct nfs_read_data *data);
1165 struct page *page_array[NFS_PAGEVEC_SIZE];
1168 struct nfs_write_data {
1169 struct rpc_task task;
1170 struct inode *inode;
1171 struct rpc_cred *cred;
1172 struct nfs_fattr fattr;
1173 struct nfs_writeverf verf;
1174 struct list_head pages; /* Coalesced requests we wish to flush */
1175 struct list_head list; /* lists of struct nfs_write_data */
1176 struct nfs_page *req; /* multi ops per nfs_page */
1177 struct page **pagevec;
1178 unsigned int npages; /* Max length of pagevec */
1179 struct nfs_writeargs args; /* argument struct */
1180 struct nfs_writeres res; /* result struct */
1181 struct pnfs_layout_segment *lseg;
1182 struct nfs_client *ds_clp; /* pNFS data server */
1183 int ds_commit_index;
1184 const struct rpc_call_ops *mds_ops;
1185 int (*write_done_cb) (struct rpc_task *task, struct nfs_write_data *data);
1186 #ifdef CONFIG_NFS_V4
1187 unsigned long timestamp; /* For lease renewal */
1189 __u64 mds_offset; /* Filelayout dense stripe */
1191 struct page *page_array[NFS_PAGEVEC_SIZE];
1194 struct nfs_access_entry;
1199 * RPC procedure vector for NFSv2/NFSv3 demuxing
1201 struct nfs_rpc_ops {
1202 u32 version; /* Protocol version */
1203 const struct dentry_operations *dentry_ops;
1204 const struct inode_operations *dir_inode_ops;
1205 const struct inode_operations *file_inode_ops;
1206 const struct file_operations *file_ops;
1208 int (*getroot) (struct nfs_server *, struct nfs_fh *,
1209 struct nfs_fsinfo *);
1210 int (*getattr) (struct nfs_server *, struct nfs_fh *,
1211 struct nfs_fattr *);
1212 int (*setattr) (struct dentry *, struct nfs_fattr *,
1214 int (*lookup) (struct rpc_clnt *clnt, struct inode *, struct qstr *,
1215 struct nfs_fh *, struct nfs_fattr *);
1216 int (*access) (struct inode *, struct nfs_access_entry *);
1217 int (*readlink)(struct inode *, struct page *, unsigned int,
1219 int (*create) (struct inode *, struct dentry *,
1220 struct iattr *, int, struct nfs_open_context *);
1221 int (*remove) (struct inode *, struct qstr *);
1222 void (*unlink_setup) (struct rpc_message *, struct inode *dir);
1223 int (*unlink_done) (struct rpc_task *, struct inode *);
1224 int (*rename) (struct inode *, struct qstr *,
1225 struct inode *, struct qstr *);
1226 void (*rename_setup) (struct rpc_message *msg, struct inode *dir);
1227 int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir);
1228 int (*link) (struct inode *, struct inode *, struct qstr *);
1229 int (*symlink) (struct inode *, struct dentry *, struct page *,
1230 unsigned int, struct iattr *);
1231 int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
1232 int (*rmdir) (struct inode *, struct qstr *);
1233 int (*readdir) (struct dentry *, struct rpc_cred *,
1234 u64, struct page **, unsigned int, int);
1235 int (*mknod) (struct inode *, struct dentry *, struct iattr *,
1237 int (*statfs) (struct nfs_server *, struct nfs_fh *,
1238 struct nfs_fsstat *);
1239 int (*fsinfo) (struct nfs_server *, struct nfs_fh *,
1240 struct nfs_fsinfo *);
1241 int (*pathconf) (struct nfs_server *, struct nfs_fh *,
1242 struct nfs_pathconf *);
1243 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
1244 int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, int);
1245 void (*read_setup) (struct nfs_read_data *, struct rpc_message *);
1246 int (*read_done) (struct rpc_task *, struct nfs_read_data *);
1247 void (*write_setup) (struct nfs_write_data *, struct rpc_message *);
1248 int (*write_done) (struct rpc_task *, struct nfs_write_data *);
1249 void (*commit_setup) (struct nfs_write_data *, struct rpc_message *);
1250 int (*commit_done) (struct rpc_task *, struct nfs_write_data *);
1251 int (*lock)(struct file *, int, struct file_lock *);
1252 int (*lock_check_bounds)(const struct file_lock *);
1253 void (*clear_acl_cache)(struct inode *);
1254 void (*close_context)(struct nfs_open_context *ctx, int);
1255 struct inode * (*open_context) (struct inode *dir,
1256 struct nfs_open_context *ctx,
1258 struct iattr *iattr);
1259 int (*init_client) (struct nfs_client *, const struct rpc_timeout *,
1260 const char *, rpc_authflavor_t, int);
1261 int (*secinfo)(struct inode *, const struct qstr *, struct nfs4_secinfo_flavors *);
1265 * NFS_CALL(getattr, inode, (fattr));
1267 * NFS_PROTO(inode)->getattr(fattr);
1269 #define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args
1272 * Function vectors etc. for the NFS client
1274 extern const struct nfs_rpc_ops nfs_v2_clientops;
1275 extern const struct nfs_rpc_ops nfs_v3_clientops;
1276 extern const struct nfs_rpc_ops nfs_v4_clientops;
1277 extern const struct rpc_version nfs_version2;
1278 extern const struct rpc_version nfs_version3;
1279 extern const struct rpc_version nfs_version4;
1281 extern const struct rpc_version nfsacl_version3;
1282 extern const struct rpc_program nfsacl_program;