1 #ifndef _LINUX_NFS_XDR_H
2 #define _LINUX_NFS_XDR_H
4 #include <linux/nfsacl.h>
5 #include <linux/nfs3.h>
6 #include <linux/sunrpc/gss_api.h>
9 * To change the maximum rsize and wsize supported by the NFS client, adjust
10 * NFS_MAX_FILE_IO_SIZE. 64KB is a typical maximum, but some servers can
11 * support a megabyte or more. The default is left at 4096 bytes, which is
12 * reasonable for NFS over UDP.
14 #define NFS_MAX_FILE_IO_SIZE (1048576U)
15 #define NFS_DEF_FILE_IO_SIZE (4096U)
16 #define NFS_MIN_FILE_IO_SIZE (1024U)
18 /* Forward declaration for NFS v3 */
19 struct nfs4_secinfo_flavors;
27 * Helper for checking equality between 2 fsids.
29 static inline int nfs_fsid_equal(const struct nfs_fsid *a, const struct nfs_fsid *b)
31 return a->major == b->major && a->minor == b->minor;
35 unsigned int valid; /* which fields are valid */
53 struct timespec atime;
54 struct timespec mtime;
55 struct timespec ctime;
56 __u64 change_attr; /* NFSv4 change attribute */
57 __u64 pre_change_attr;/* pre-op NFSv4 change attribute */
58 __u64 pre_size; /* pre_op_attr.size */
59 struct timespec pre_mtime; /* pre_op_attr.mtime */
60 struct timespec pre_ctime; /* pre_op_attr.ctime */
61 unsigned long time_start;
62 unsigned long gencount;
65 #define NFS_ATTR_FATTR_TYPE (1U << 0)
66 #define NFS_ATTR_FATTR_MODE (1U << 1)
67 #define NFS_ATTR_FATTR_NLINK (1U << 2)
68 #define NFS_ATTR_FATTR_OWNER (1U << 3)
69 #define NFS_ATTR_FATTR_GROUP (1U << 4)
70 #define NFS_ATTR_FATTR_RDEV (1U << 5)
71 #define NFS_ATTR_FATTR_SIZE (1U << 6)
72 #define NFS_ATTR_FATTR_PRESIZE (1U << 7)
73 #define NFS_ATTR_FATTR_BLOCKS_USED (1U << 8)
74 #define NFS_ATTR_FATTR_SPACE_USED (1U << 9)
75 #define NFS_ATTR_FATTR_FSID (1U << 10)
76 #define NFS_ATTR_FATTR_FILEID (1U << 11)
77 #define NFS_ATTR_FATTR_ATIME (1U << 12)
78 #define NFS_ATTR_FATTR_MTIME (1U << 13)
79 #define NFS_ATTR_FATTR_CTIME (1U << 14)
80 #define NFS_ATTR_FATTR_PREMTIME (1U << 15)
81 #define NFS_ATTR_FATTR_PRECTIME (1U << 16)
82 #define NFS_ATTR_FATTR_CHANGE (1U << 17)
83 #define NFS_ATTR_FATTR_PRECHANGE (1U << 18)
84 #define NFS_ATTR_FATTR_V4_REFERRAL (1U << 19) /* NFSv4 referral */
85 #define NFS_ATTR_FATTR_MOUNTPOINT (1U << 20) /* Treat as mountpoint */
87 #define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \
88 | NFS_ATTR_FATTR_MODE \
89 | NFS_ATTR_FATTR_NLINK \
90 | NFS_ATTR_FATTR_OWNER \
91 | NFS_ATTR_FATTR_GROUP \
92 | NFS_ATTR_FATTR_RDEV \
93 | NFS_ATTR_FATTR_SIZE \
94 | NFS_ATTR_FATTR_FSID \
95 | NFS_ATTR_FATTR_FILEID \
96 | NFS_ATTR_FATTR_ATIME \
97 | NFS_ATTR_FATTR_MTIME \
98 | NFS_ATTR_FATTR_CTIME)
99 #define NFS_ATTR_FATTR_V2 (NFS_ATTR_FATTR \
100 | NFS_ATTR_FATTR_BLOCKS_USED)
101 #define NFS_ATTR_FATTR_V3 (NFS_ATTR_FATTR \
102 | NFS_ATTR_FATTR_SPACE_USED)
103 #define NFS_ATTR_FATTR_V4 (NFS_ATTR_FATTR \
104 | NFS_ATTR_FATTR_SPACE_USED \
105 | NFS_ATTR_FATTR_CHANGE)
108 * Info on the file system
111 struct nfs_fattr *fattr; /* Post-op attributes */
112 __u32 rtmax; /* max. read transfer size */
113 __u32 rtpref; /* pref. read transfer size */
114 __u32 rtmult; /* reads should be multiple of this */
115 __u32 wtmax; /* max. write transfer size */
116 __u32 wtpref; /* pref. write transfer size */
117 __u32 wtmult; /* writes should be multiple of this */
118 __u32 dtpref; /* pref. readdir transfer size */
120 struct timespec time_delta; /* server time granularity */
121 __u32 lease_time; /* in seconds */
122 __u32 layouttype; /* supported pnfs layout driver */
126 struct nfs_fattr *fattr; /* Post-op attributes */
127 __u64 tbytes; /* total size in bytes */
128 __u64 fbytes; /* # of free bytes */
129 __u64 abytes; /* # of bytes available to user */
130 __u64 tfiles; /* # of files */
131 __u64 ffiles; /* # of free files */
132 __u64 afiles; /* # of files available to user */
136 __u32 tsize; /* Server transfer size */
137 __u32 bsize; /* Filesystem block size */
138 __u32 blocks; /* No. of "bsize" blocks on filesystem */
139 __u32 bfree; /* No. of free "bsize" blocks */
140 __u32 bavail; /* No. of available "bsize" blocks */
143 struct nfs_pathconf {
144 struct nfs_fattr *fattr; /* Post-op attributes */
145 __u32 max_link; /* max # of hard links */
146 __u32 max_namelen; /* max name length */
149 struct nfs4_change_info {
157 /* nfs41 sessions channel attributes */
158 struct nfs4_channel_attrs {
162 u32 max_resp_sz_cached;
167 /* nfs41 sessions slot seqid */
172 struct nfs4_sequence_args {
173 struct nfs4_session *sa_session;
178 struct nfs4_sequence_res {
179 struct nfs4_session *sr_session;
180 struct nfs4_slot *sr_slot; /* slot used to send request */
181 int sr_status; /* sequence operation status */
182 unsigned long sr_renewal_time;
186 struct nfs4_get_lease_time_args {
187 struct nfs4_sequence_args la_seq_args;
190 struct nfs4_get_lease_time_res {
191 struct nfs_fsinfo *lr_fsinfo;
192 struct nfs4_sequence_res lr_seq_res;
195 #define PNFS_LAYOUT_MAXSIZE 4096
197 struct nfs4_layoutdriver_data {
202 struct pnfs_layout_range {
208 struct nfs4_layoutget_args {
210 struct pnfs_layout_range range;
214 struct nfs_open_context *ctx;
215 struct nfs4_sequence_args seq_args;
216 nfs4_stateid stateid;
219 struct nfs4_layoutget_res {
220 __u32 return_on_close;
221 struct pnfs_layout_range range;
223 nfs4_stateid stateid;
224 struct nfs4_layoutdriver_data layout;
225 struct nfs4_sequence_res seq_res;
228 struct nfs4_layoutget {
229 struct nfs4_layoutget_args args;
230 struct nfs4_layoutget_res res;
231 struct pnfs_layout_segment **lsegpp;
234 struct nfs4_getdeviceinfo_args {
235 struct pnfs_device *pdev;
236 struct nfs4_sequence_args seq_args;
239 struct nfs4_getdeviceinfo_res {
240 struct pnfs_device *pdev;
241 struct nfs4_sequence_res seq_res;
245 * Arguments to the open call.
247 struct nfs_openargs {
248 const struct nfs_fh * fh;
249 struct nfs_seqid * seqid;
256 struct iattr * attrs; /* UNCHECKED, GUARDED */
257 nfs4_verifier verifier; /* EXCLUSIVE */
259 nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */
260 fmode_t delegation_type; /* CLAIM_PREVIOUS */
262 const struct qstr * name;
263 const struct nfs_server *server; /* Needed for ID mapping */
266 struct nfs4_sequence_args seq_args;
270 nfs4_stateid stateid;
272 struct nfs4_change_info cinfo;
274 struct nfs_fattr * f_attr;
275 struct nfs_fattr * dir_attr;
276 struct nfs_seqid * seqid;
277 const struct nfs_server *server;
278 fmode_t delegation_type;
279 nfs4_stateid delegation;
282 __u32 attrset[NFS4_BITMAP_SIZE];
283 struct nfs4_sequence_res seq_res;
287 * Arguments to the open_confirm call.
289 struct nfs_open_confirmargs {
290 const struct nfs_fh * fh;
291 nfs4_stateid * stateid;
292 struct nfs_seqid * seqid;
295 struct nfs_open_confirmres {
296 nfs4_stateid stateid;
297 struct nfs_seqid * seqid;
301 * Arguments to the close call.
303 struct nfs_closeargs {
305 nfs4_stateid * stateid;
306 struct nfs_seqid * seqid;
309 struct nfs4_sequence_args seq_args;
312 struct nfs_closeres {
313 nfs4_stateid stateid;
314 struct nfs_fattr * fattr;
315 struct nfs_seqid * seqid;
316 const struct nfs_server *server;
317 struct nfs4_sequence_res seq_res;
320 * * Arguments to the lock,lockt, and locku call.
328 struct nfs_lock_args {
330 struct file_lock * fl;
331 struct nfs_seqid * lock_seqid;
332 nfs4_stateid * lock_stateid;
333 struct nfs_seqid * open_seqid;
334 nfs4_stateid * open_stateid;
335 struct nfs_lowner lock_owner;
336 unsigned char block : 1;
337 unsigned char reclaim : 1;
338 unsigned char new_lock_owner : 1;
339 struct nfs4_sequence_args seq_args;
342 struct nfs_lock_res {
343 nfs4_stateid stateid;
344 struct nfs_seqid * lock_seqid;
345 struct nfs_seqid * open_seqid;
346 struct nfs4_sequence_res seq_res;
349 struct nfs_locku_args {
351 struct file_lock * fl;
352 struct nfs_seqid * seqid;
353 nfs4_stateid * stateid;
354 struct nfs4_sequence_args seq_args;
357 struct nfs_locku_res {
358 nfs4_stateid stateid;
359 struct nfs_seqid * seqid;
360 struct nfs4_sequence_res seq_res;
363 struct nfs_lockt_args {
365 struct file_lock * fl;
366 struct nfs_lowner lock_owner;
367 struct nfs4_sequence_args seq_args;
370 struct nfs_lockt_res {
371 struct file_lock * denied; /* LOCK, LOCKT failed */
372 struct nfs4_sequence_res seq_res;
375 struct nfs_release_lockowner_args {
376 struct nfs_lowner lock_owner;
379 struct nfs4_delegreturnargs {
380 const struct nfs_fh *fhandle;
381 const nfs4_stateid *stateid;
383 struct nfs4_sequence_args seq_args;
386 struct nfs4_delegreturnres {
387 struct nfs_fattr * fattr;
388 const struct nfs_server *server;
389 struct nfs4_sequence_res seq_res;
393 * Arguments to the read call.
395 struct nfs_readargs {
397 struct nfs_open_context *context;
398 struct nfs_lock_context *lock_context;
402 struct page ** pages;
403 struct nfs4_sequence_args seq_args;
407 struct nfs_fattr * fattr;
410 struct nfs4_sequence_res seq_res;
414 * Arguments to the write call.
416 struct nfs_writeargs {
418 struct nfs_open_context *context;
419 struct nfs_lock_context *lock_context;
422 enum nfs3_stable_how stable;
424 struct page ** pages;
426 struct nfs4_sequence_args seq_args;
429 struct nfs_writeverf {
430 enum nfs3_stable_how committed;
434 struct nfs_writeres {
435 struct nfs_fattr * fattr;
436 struct nfs_writeverf * verf;
438 const struct nfs_server *server;
439 struct nfs4_sequence_res seq_res;
443 * Common arguments to the unlink call
445 struct nfs_removeargs {
446 const struct nfs_fh *fh;
449 struct nfs4_sequence_args seq_args;
452 struct nfs_removeres {
453 const struct nfs_server *server;
454 struct nfs_fattr *dir_attr;
455 struct nfs4_change_info cinfo;
456 struct nfs4_sequence_res seq_res;
460 * Common arguments to the rename call
462 struct nfs_renameargs {
463 const struct nfs_fh *old_dir;
464 const struct nfs_fh *new_dir;
465 const struct qstr *old_name;
466 const struct qstr *new_name;
468 struct nfs4_sequence_args seq_args;
471 struct nfs_renameres {
472 const struct nfs_server *server;
473 struct nfs4_change_info old_cinfo;
474 struct nfs_fattr *old_fattr;
475 struct nfs4_change_info new_cinfo;
476 struct nfs_fattr *new_fattr;
477 struct nfs4_sequence_res seq_res;
481 * Argument struct for decode_entry function
491 struct nfs_fattr * fattr;
492 unsigned char d_type;
493 struct nfs_server * server;
497 * The following types are for NFSv2 only.
499 struct nfs_sattrargs {
501 struct iattr * sattr;
504 struct nfs_diropargs {
510 struct nfs_createargs {
514 struct iattr * sattr;
517 struct nfs_setattrargs {
519 nfs4_stateid stateid;
521 const struct nfs_server * server; /* Needed for name mapping */
523 struct nfs4_sequence_args seq_args;
526 struct nfs_setaclargs {
529 unsigned int acl_pgbase;
530 struct page ** acl_pages;
531 struct nfs4_sequence_args seq_args;
534 struct nfs_setaclres {
535 struct nfs4_sequence_res seq_res;
538 struct nfs_getaclargs {
541 unsigned int acl_pgbase;
542 struct page ** acl_pages;
543 struct nfs4_sequence_args seq_args;
546 struct nfs_getaclres {
548 struct nfs4_sequence_res seq_res;
551 struct nfs_setattrres {
552 struct nfs_fattr * fattr;
553 const struct nfs_server * server;
554 struct nfs4_sequence_res seq_res;
557 struct nfs_linkargs {
558 struct nfs_fh * fromfh;
559 struct nfs_fh * tofh;
564 struct nfs_symlinkargs {
565 struct nfs_fh * fromfh;
566 const char * fromname;
567 unsigned int fromlen;
568 struct page ** pages;
569 unsigned int pathlen;
570 struct iattr * sattr;
573 struct nfs_readdirargs {
577 struct page ** pages;
580 struct nfs3_getaclargs {
583 struct page ** pages;
586 struct nfs3_setaclargs {
587 struct inode * inode;
589 struct posix_acl * acl_access;
590 struct posix_acl * acl_default;
593 struct page ** pages;
598 struct nfs_fattr * fattr;
601 struct nfs_readlinkargs {
605 struct page ** pages;
608 struct nfs3_sattrargs {
610 struct iattr * sattr;
612 struct timespec guardtime;
615 struct nfs3_diropargs {
621 struct nfs3_accessargs {
626 struct nfs3_createargs {
630 struct iattr * sattr;
631 enum nfs3_createmode createmode;
635 struct nfs3_mkdirargs {
639 struct iattr * sattr;
642 struct nfs3_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 nfs3_mknodargs {
655 enum nfs3_ftype type;
656 struct iattr * sattr;
660 struct nfs3_linkargs {
661 struct nfs_fh * fromfh;
662 struct nfs_fh * tofh;
667 struct nfs3_readdirargs {
673 struct page ** pages;
676 struct nfs3_diropres {
677 struct nfs_fattr * dir_attr;
679 struct nfs_fattr * fattr;
682 struct nfs3_accessres {
683 struct nfs_fattr * fattr;
687 struct nfs3_readlinkargs {
691 struct page ** pages;
694 struct nfs3_linkres {
695 struct nfs_fattr * dir_attr;
696 struct nfs_fattr * fattr;
699 struct nfs3_readdirres {
700 struct nfs_fattr * dir_attr;
705 struct nfs3_getaclres {
706 struct nfs_fattr * fattr;
708 unsigned int acl_access_count;
709 unsigned int acl_default_count;
710 struct posix_acl * acl_access;
711 struct posix_acl * acl_default;
716 typedef u64 clientid4;
718 struct nfs4_accessargs {
719 const struct nfs_fh * fh;
722 struct nfs4_sequence_args seq_args;
725 struct nfs4_accessres {
726 const struct nfs_server * server;
727 struct nfs_fattr * fattr;
730 struct nfs4_sequence_res seq_res;
733 struct nfs4_create_arg {
737 struct page ** pages;
739 } symlink; /* NF4LNK */
743 } device; /* NF4BLK, NF4CHR */
745 const struct qstr * name;
746 const struct nfs_server * server;
747 const struct iattr * attrs;
748 const struct nfs_fh * dir_fh;
750 struct nfs4_sequence_args seq_args;
753 struct nfs4_create_res {
754 const struct nfs_server * server;
756 struct nfs_fattr * fattr;
757 struct nfs4_change_info dir_cinfo;
758 struct nfs_fattr * dir_fattr;
759 struct nfs4_sequence_res seq_res;
762 struct nfs4_fsinfo_arg {
763 const struct nfs_fh * fh;
765 struct nfs4_sequence_args seq_args;
768 struct nfs4_fsinfo_res {
769 struct nfs_fsinfo *fsinfo;
770 struct nfs4_sequence_res seq_res;
773 struct nfs4_getattr_arg {
774 const struct nfs_fh * fh;
776 struct nfs4_sequence_args seq_args;
779 struct nfs4_getattr_res {
780 const struct nfs_server * server;
781 struct nfs_fattr * fattr;
782 struct nfs4_sequence_res seq_res;
785 struct nfs4_link_arg {
786 const struct nfs_fh * fh;
787 const struct nfs_fh * dir_fh;
788 const struct qstr * name;
790 struct nfs4_sequence_args seq_args;
793 struct nfs4_link_res {
794 const struct nfs_server * server;
795 struct nfs_fattr * fattr;
796 struct nfs4_change_info cinfo;
797 struct nfs_fattr * dir_attr;
798 struct nfs4_sequence_res seq_res;
802 struct nfs4_lookup_arg {
803 const struct nfs_fh * dir_fh;
804 const struct qstr * name;
806 struct nfs4_sequence_args seq_args;
809 struct nfs4_lookup_res {
810 const struct nfs_server * server;
811 struct nfs_fattr * fattr;
813 struct nfs4_sequence_res seq_res;
816 struct nfs4_lookup_root_arg {
818 struct nfs4_sequence_args seq_args;
821 struct nfs4_pathconf_arg {
822 const struct nfs_fh * fh;
824 struct nfs4_sequence_args seq_args;
827 struct nfs4_pathconf_res {
828 struct nfs_pathconf *pathconf;
829 struct nfs4_sequence_res seq_res;
832 struct nfs4_readdir_arg {
833 const struct nfs_fh * fh;
835 nfs4_verifier verifier;
837 struct page ** pages; /* zero-copy data */
838 unsigned int pgbase; /* zero-copy data */
841 struct nfs4_sequence_args seq_args;
844 struct nfs4_readdir_res {
845 nfs4_verifier verifier;
847 struct nfs4_sequence_res seq_res;
850 struct nfs4_readlink {
851 const struct nfs_fh * fh;
853 unsigned int pglen; /* zero-copy data */
854 struct page ** pages; /* zero-copy data */
855 struct nfs4_sequence_args seq_args;
858 struct nfs4_readlink_res {
859 struct nfs4_sequence_res seq_res;
862 #define NFS4_SETCLIENTID_NAMELEN (127)
863 struct nfs4_setclientid {
864 const nfs4_verifier * sc_verifier;
865 unsigned int sc_name_len;
866 char sc_name[NFS4_SETCLIENTID_NAMELEN + 1];
868 unsigned int sc_netid_len;
869 char sc_netid[RPCBIND_MAXNETIDLEN + 1];
870 unsigned int sc_uaddr_len;
871 char sc_uaddr[RPCBIND_MAXUADDRLEN + 1];
875 struct nfs4_setclientid_res {
877 nfs4_verifier confirm;
880 struct nfs4_statfs_arg {
881 const struct nfs_fh * fh;
883 struct nfs4_sequence_args seq_args;
886 struct nfs4_statfs_res {
887 struct nfs_fsstat *fsstat;
888 struct nfs4_sequence_res seq_res;
891 struct nfs4_server_caps_arg {
892 struct nfs_fh *fhandle;
893 struct nfs4_sequence_args seq_args;
896 struct nfs4_server_caps_res {
901 struct nfs4_sequence_res seq_res;
909 #define NFS4_PATHNAME_MAXCOMPONENTS 512
910 struct nfs4_pathname {
911 unsigned int ncomponents;
912 struct nfs4_string components[NFS4_PATHNAME_MAXCOMPONENTS];
915 #define NFS4_FS_LOCATION_MAXSERVERS 10
916 struct nfs4_fs_location {
917 unsigned int nservers;
918 struct nfs4_string servers[NFS4_FS_LOCATION_MAXSERVERS];
919 struct nfs4_pathname rootpath;
922 #define NFS4_FS_LOCATIONS_MAXENTRIES 10
923 struct nfs4_fs_locations {
924 struct nfs_fattr fattr;
925 const struct nfs_server *server;
926 struct nfs4_pathname fs_path;
928 struct nfs4_fs_location locations[NFS4_FS_LOCATIONS_MAXENTRIES];
931 struct nfs4_fs_locations_arg {
932 const struct nfs_fh *dir_fh;
933 const struct qstr *name;
936 struct nfs4_sequence_args seq_args;
939 struct nfs4_fs_locations_res {
940 struct nfs4_fs_locations *fs_locations;
941 struct nfs4_sequence_res seq_res;
944 struct nfs4_secinfo_oid {
946 char data[GSS_OID_MAX_LEN];
949 struct nfs4_secinfo_gss {
950 struct nfs4_secinfo_oid sec_oid4;
952 unsigned int service;
955 struct nfs4_secinfo_flavor {
957 struct nfs4_secinfo_gss gss;
960 struct nfs4_secinfo_flavors {
961 unsigned int num_flavors;
962 struct nfs4_secinfo_flavor flavors[0];
965 struct nfs4_secinfo_arg {
966 const struct nfs_fh *dir_fh;
967 const struct qstr *name;
968 struct nfs4_sequence_args seq_args;
971 struct nfs4_secinfo_res {
972 struct nfs4_secinfo_flavors *flavors;
973 struct nfs4_sequence_res seq_res;
976 #endif /* CONFIG_NFS_V4 */
983 #ifdef CONFIG_NFS_V4_1
984 struct nfs_impl_id4 {
989 struct nfstime4 date;
992 #define NFS4_EXCHANGE_ID_LEN (48)
993 struct nfs41_exchange_id_args {
994 struct nfs_client *client;
995 nfs4_verifier *verifier;
997 char id[NFS4_EXCHANGE_ID_LEN];
1001 struct server_owner {
1003 uint32_t major_id_sz;
1004 char major_id[NFS4_OPAQUE_LIMIT];
1007 struct server_scope {
1008 uint32_t server_scope_sz;
1009 char server_scope[NFS4_OPAQUE_LIMIT];
1012 struct nfs41_exchange_id_res {
1013 struct nfs_client *client;
1017 struct nfs41_create_session_args {
1018 struct nfs_client *client;
1020 uint32_t cb_program;
1021 struct nfs4_channel_attrs fc_attrs; /* Fore Channel */
1022 struct nfs4_channel_attrs bc_attrs; /* Back Channel */
1025 struct nfs41_create_session_res {
1026 struct nfs_client *client;
1029 struct nfs41_reclaim_complete_args {
1030 /* In the future extend to include curr_fh for use with migration */
1031 unsigned char one_fs:1;
1032 struct nfs4_sequence_args seq_args;
1035 struct nfs41_reclaim_complete_res {
1036 struct nfs4_sequence_res seq_res;
1038 #endif /* CONFIG_NFS_V4_1 */
1042 #define NFS_PAGEVEC_SIZE (8U)
1044 struct nfs_read_data {
1046 struct rpc_task task;
1047 struct inode *inode;
1048 struct rpc_cred *cred;
1049 struct nfs_fattr fattr; /* fattr storage */
1050 struct list_head pages; /* Coalesced read requests */
1051 struct nfs_page *req; /* multi ops per nfs_page */
1052 struct page **pagevec;
1053 unsigned int npages; /* Max length of pagevec */
1054 struct nfs_readargs args;
1055 struct nfs_readres res;
1056 unsigned long timestamp; /* For lease renewal */
1057 struct pnfs_layout_segment *lseg;
1058 struct nfs_client *ds_clp; /* pNFS data server */
1059 const struct rpc_call_ops *mds_ops;
1060 int (*read_done_cb) (struct rpc_task *task, struct nfs_read_data *data);
1062 struct page *page_array[NFS_PAGEVEC_SIZE];
1065 struct nfs_write_data {
1067 struct rpc_task task;
1068 struct inode *inode;
1069 struct rpc_cred *cred;
1070 struct nfs_fattr fattr;
1071 struct nfs_writeverf verf;
1072 struct list_head pages; /* Coalesced requests we wish to flush */
1073 struct nfs_page *req; /* multi ops per nfs_page */
1074 struct page **pagevec;
1075 unsigned int npages; /* Max length of pagevec */
1076 struct nfs_writeargs args; /* argument struct */
1077 struct nfs_writeres res; /* result struct */
1078 struct pnfs_layout_segment *lseg;
1079 struct nfs_client *ds_clp; /* pNFS data server */
1080 const struct rpc_call_ops *mds_ops;
1081 int (*write_done_cb) (struct rpc_task *task, struct nfs_write_data *data);
1082 #ifdef CONFIG_NFS_V4
1083 unsigned long timestamp; /* For lease renewal */
1085 __u64 mds_offset; /* Filelayout dense stripe */
1086 struct page *page_array[NFS_PAGEVEC_SIZE];
1089 struct nfs_access_entry;
1094 * RPC procedure vector for NFSv2/NFSv3 demuxing
1096 struct nfs_rpc_ops {
1097 u32 version; /* Protocol version */
1098 const struct dentry_operations *dentry_ops;
1099 const struct inode_operations *dir_inode_ops;
1100 const struct inode_operations *file_inode_ops;
1102 int (*getroot) (struct nfs_server *, struct nfs_fh *,
1103 struct nfs_fsinfo *);
1104 int (*lookupfh)(struct nfs_server *, struct nfs_fh *,
1105 struct qstr *, struct nfs_fh *,
1106 struct nfs_fattr *);
1107 int (*getattr) (struct nfs_server *, struct nfs_fh *,
1108 struct nfs_fattr *);
1109 int (*setattr) (struct dentry *, struct nfs_fattr *,
1111 int (*lookup) (struct rpc_clnt *clnt, struct inode *, struct qstr *,
1112 struct nfs_fh *, struct nfs_fattr *);
1113 int (*access) (struct inode *, struct nfs_access_entry *);
1114 int (*readlink)(struct inode *, struct page *, unsigned int,
1116 int (*create) (struct inode *, struct dentry *,
1117 struct iattr *, int, struct nfs_open_context *);
1118 int (*remove) (struct inode *, struct qstr *);
1119 void (*unlink_setup) (struct rpc_message *, struct inode *dir);
1120 int (*unlink_done) (struct rpc_task *, struct inode *);
1121 int (*rename) (struct inode *, struct qstr *,
1122 struct inode *, struct qstr *);
1123 void (*rename_setup) (struct rpc_message *msg, struct inode *dir);
1124 int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir);
1125 int (*link) (struct inode *, struct inode *, struct qstr *);
1126 int (*symlink) (struct inode *, struct dentry *, struct page *,
1127 unsigned int, struct iattr *);
1128 int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
1129 int (*rmdir) (struct inode *, struct qstr *);
1130 int (*readdir) (struct dentry *, struct rpc_cred *,
1131 u64, struct page **, unsigned int, int);
1132 int (*mknod) (struct inode *, struct dentry *, struct iattr *,
1134 int (*statfs) (struct nfs_server *, struct nfs_fh *,
1135 struct nfs_fsstat *);
1136 int (*fsinfo) (struct nfs_server *, struct nfs_fh *,
1137 struct nfs_fsinfo *);
1138 int (*pathconf) (struct nfs_server *, struct nfs_fh *,
1139 struct nfs_pathconf *);
1140 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
1141 int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, int);
1142 void (*read_setup) (struct nfs_read_data *, struct rpc_message *);
1143 int (*read_done) (struct rpc_task *, struct nfs_read_data *);
1144 void (*write_setup) (struct nfs_write_data *, struct rpc_message *);
1145 int (*write_done) (struct rpc_task *, struct nfs_write_data *);
1146 void (*commit_setup) (struct nfs_write_data *, struct rpc_message *);
1147 int (*commit_done) (struct rpc_task *, struct nfs_write_data *);
1148 int (*lock)(struct file *, int, struct file_lock *);
1149 int (*lock_check_bounds)(const struct file_lock *);
1150 void (*clear_acl_cache)(struct inode *);
1151 void (*close_context)(struct nfs_open_context *ctx, int);
1152 struct inode * (*open_context) (struct inode *dir,
1153 struct nfs_open_context *ctx,
1155 struct iattr *iattr);
1156 int (*init_client) (struct nfs_client *, const struct rpc_timeout *,
1157 const char *, rpc_authflavor_t, int);
1158 int (*secinfo)(struct inode *, const struct qstr *, struct nfs4_secinfo_flavors *);
1162 * NFS_CALL(getattr, inode, (fattr));
1164 * NFS_PROTO(inode)->getattr(fattr);
1166 #define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args
1169 * Function vectors etc. for the NFS client
1171 extern const struct nfs_rpc_ops nfs_v2_clientops;
1172 extern const struct nfs_rpc_ops nfs_v3_clientops;
1173 extern const struct nfs_rpc_ops nfs_v4_clientops;
1174 extern struct rpc_version nfs_version2;
1175 extern struct rpc_version nfs_version3;
1176 extern struct rpc_version nfs_version4;
1178 extern struct rpc_version nfsacl_version3;
1179 extern struct rpc_program nfsacl_program;