1 #ifndef _LINUX_NFS_XDR_H
2 #define _LINUX_NFS_XDR_H
4 #include <linux/nfsacl.h>
5 #include <linux/nfs3.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)
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;
31 unsigned int valid; /* which fields are valid */
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
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 */
115 struct timespec time_delta; /* server time granularity */
116 __u32 lease_time; /* in seconds */
117 __u32 layouttype; /* supported pnfs layout driver */
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 */
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 {
152 /* nfs41 sessions channel attributes */
153 struct nfs4_channel_attrs {
157 u32 max_resp_sz_cached;
162 /* nfs41 sessions slot seqid */
167 struct nfs4_sequence_args {
168 struct nfs4_session *sa_session;
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;
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;
190 #define PNFS_LAYOUT_MAXSIZE 4096
192 struct nfs4_layoutdriver_data {
198 struct pnfs_layout_range {
204 struct nfs4_layoutget_args {
206 struct pnfs_layout_range range;
210 struct nfs_open_context *ctx;
211 struct nfs4_sequence_args seq_args;
212 nfs4_stateid stateid;
213 struct nfs4_layoutdriver_data layout;
216 struct nfs4_layoutget_res {
217 __u32 return_on_close;
218 struct pnfs_layout_range range;
220 nfs4_stateid stateid;
221 struct nfs4_sequence_res seq_res;
222 struct nfs4_layoutdriver_data *layoutp;
225 struct nfs4_layoutget {
226 struct nfs4_layoutget_args args;
227 struct nfs4_layoutget_res res;
228 struct pnfs_layout_segment **lsegpp;
231 struct nfs4_getdeviceinfo_args {
232 struct pnfs_device *pdev;
233 struct nfs4_sequence_args seq_args;
236 struct nfs4_getdeviceinfo_res {
237 struct pnfs_device *pdev;
238 struct nfs4_sequence_res seq_res;
241 struct nfs4_layoutcommit_args {
242 nfs4_stateid stateid;
243 __u64 lastbytewritten;
246 struct nfs4_sequence_args seq_args;
249 struct nfs4_layoutcommit_res {
250 struct nfs_fattr *fattr;
251 const struct nfs_server *server;
252 struct nfs4_sequence_res seq_res;
255 struct nfs4_layoutcommit_data {
256 struct rpc_task task;
257 struct nfs_fattr fattr;
258 struct pnfs_layout_segment *lseg;
259 struct rpc_cred *cred;
260 struct nfs4_layoutcommit_args args;
261 struct nfs4_layoutcommit_res res;
265 * Arguments to the open call.
267 struct nfs_openargs {
268 const struct nfs_fh * fh;
269 struct nfs_seqid * seqid;
276 struct iattr * attrs; /* UNCHECKED, GUARDED */
277 nfs4_verifier verifier; /* EXCLUSIVE */
279 nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */
280 fmode_t delegation_type; /* CLAIM_PREVIOUS */
282 const struct qstr * name;
283 const struct nfs_server *server; /* Needed for ID mapping */
286 struct nfs4_sequence_args seq_args;
290 nfs4_stateid stateid;
292 struct nfs4_change_info cinfo;
294 struct nfs_fattr * f_attr;
295 struct nfs_fattr * dir_attr;
296 struct nfs_seqid * seqid;
297 const struct nfs_server *server;
298 fmode_t delegation_type;
299 nfs4_stateid delegation;
302 __u32 attrset[NFS4_BITMAP_SIZE];
303 struct nfs4_sequence_res seq_res;
307 * Arguments to the open_confirm call.
309 struct nfs_open_confirmargs {
310 const struct nfs_fh * fh;
311 nfs4_stateid * stateid;
312 struct nfs_seqid * seqid;
315 struct nfs_open_confirmres {
316 nfs4_stateid stateid;
317 struct nfs_seqid * seqid;
321 * Arguments to the close call.
323 struct nfs_closeargs {
325 nfs4_stateid * stateid;
326 struct nfs_seqid * seqid;
329 struct nfs4_sequence_args seq_args;
332 struct nfs_closeres {
333 nfs4_stateid stateid;
334 struct nfs_fattr * fattr;
335 struct nfs_seqid * seqid;
336 const struct nfs_server *server;
337 struct nfs4_sequence_res seq_res;
340 * * Arguments to the lock,lockt, and locku call.
348 struct nfs_lock_args {
350 struct file_lock * fl;
351 struct nfs_seqid * lock_seqid;
352 nfs4_stateid * lock_stateid;
353 struct nfs_seqid * open_seqid;
354 nfs4_stateid * open_stateid;
355 struct nfs_lowner lock_owner;
356 unsigned char block : 1;
357 unsigned char reclaim : 1;
358 unsigned char new_lock_owner : 1;
359 struct nfs4_sequence_args seq_args;
362 struct nfs_lock_res {
363 nfs4_stateid stateid;
364 struct nfs_seqid * lock_seqid;
365 struct nfs_seqid * open_seqid;
366 struct nfs4_sequence_res seq_res;
369 struct nfs_locku_args {
371 struct file_lock * fl;
372 struct nfs_seqid * seqid;
373 nfs4_stateid * stateid;
374 struct nfs4_sequence_args seq_args;
377 struct nfs_locku_res {
378 nfs4_stateid stateid;
379 struct nfs_seqid * seqid;
380 struct nfs4_sequence_res seq_res;
383 struct nfs_lockt_args {
385 struct file_lock * fl;
386 struct nfs_lowner lock_owner;
387 struct nfs4_sequence_args seq_args;
390 struct nfs_lockt_res {
391 struct file_lock * denied; /* LOCK, LOCKT failed */
392 struct nfs4_sequence_res seq_res;
395 struct nfs_release_lockowner_args {
396 struct nfs_lowner lock_owner;
399 struct nfs4_delegreturnargs {
400 const struct nfs_fh *fhandle;
401 const nfs4_stateid *stateid;
403 struct nfs4_sequence_args seq_args;
406 struct nfs4_delegreturnres {
407 struct nfs_fattr * fattr;
408 const struct nfs_server *server;
409 struct nfs4_sequence_res seq_res;
413 * Arguments to the read call.
415 struct nfs_readargs {
417 struct nfs_open_context *context;
418 struct nfs_lock_context *lock_context;
422 struct page ** pages;
423 struct nfs4_sequence_args seq_args;
427 struct nfs_fattr * fattr;
430 struct nfs4_sequence_res seq_res;
434 * Arguments to the write call.
436 struct nfs_writeargs {
438 struct nfs_open_context *context;
439 struct nfs_lock_context *lock_context;
442 enum nfs3_stable_how stable;
444 struct page ** pages;
446 struct nfs4_sequence_args seq_args;
449 struct nfs_writeverf {
450 enum nfs3_stable_how committed;
454 struct nfs_writeres {
455 struct nfs_fattr * fattr;
456 struct nfs_writeverf * verf;
458 const struct nfs_server *server;
459 struct nfs4_sequence_res seq_res;
463 * Common arguments to the unlink call
465 struct nfs_removeargs {
466 const struct nfs_fh *fh;
469 struct nfs4_sequence_args seq_args;
472 struct nfs_removeres {
473 const struct nfs_server *server;
474 struct nfs_fattr *dir_attr;
475 struct nfs4_change_info cinfo;
476 struct nfs4_sequence_res seq_res;
480 * Common arguments to the rename call
482 struct nfs_renameargs {
483 const struct nfs_fh *old_dir;
484 const struct nfs_fh *new_dir;
485 const struct qstr *old_name;
486 const struct qstr *new_name;
488 struct nfs4_sequence_args seq_args;
491 struct nfs_renameres {
492 const struct nfs_server *server;
493 struct nfs4_change_info old_cinfo;
494 struct nfs_fattr *old_fattr;
495 struct nfs4_change_info new_cinfo;
496 struct nfs_fattr *new_fattr;
497 struct nfs4_sequence_res seq_res;
501 * Argument struct for decode_entry function
511 struct nfs_fattr * fattr;
512 unsigned char d_type;
513 struct nfs_server * server;
517 * The following types are for NFSv2 only.
519 struct nfs_sattrargs {
521 struct iattr * sattr;
524 struct nfs_diropargs {
530 struct nfs_createargs {
534 struct iattr * sattr;
537 struct nfs_setattrargs {
539 nfs4_stateid stateid;
541 const struct nfs_server * server; /* Needed for name mapping */
543 struct nfs4_sequence_args seq_args;
546 struct nfs_setaclargs {
549 unsigned int acl_pgbase;
550 struct page ** acl_pages;
551 struct nfs4_sequence_args seq_args;
554 struct nfs_setaclres {
555 struct nfs4_sequence_res seq_res;
558 struct nfs_getaclargs {
561 unsigned int acl_pgbase;
562 struct page ** acl_pages;
563 struct nfs4_sequence_args seq_args;
566 struct nfs_getaclres {
568 struct nfs4_sequence_res seq_res;
571 struct nfs_setattrres {
572 struct nfs_fattr * fattr;
573 const struct nfs_server * server;
574 struct nfs4_sequence_res seq_res;
577 struct nfs_linkargs {
578 struct nfs_fh * fromfh;
579 struct nfs_fh * tofh;
584 struct nfs_symlinkargs {
585 struct nfs_fh * fromfh;
586 const char * fromname;
587 unsigned int fromlen;
588 struct page ** pages;
589 unsigned int pathlen;
590 struct iattr * sattr;
593 struct nfs_readdirargs {
597 struct page ** pages;
600 struct nfs3_getaclargs {
603 struct page ** pages;
606 struct nfs3_setaclargs {
607 struct inode * inode;
609 struct posix_acl * acl_access;
610 struct posix_acl * acl_default;
613 struct page ** pages;
618 struct nfs_fattr * fattr;
621 struct nfs_readlinkargs {
625 struct page ** pages;
628 struct nfs3_sattrargs {
630 struct iattr * sattr;
632 struct timespec guardtime;
635 struct nfs3_diropargs {
641 struct nfs3_accessargs {
646 struct nfs3_createargs {
650 struct iattr * sattr;
651 enum nfs3_createmode createmode;
655 struct nfs3_mkdirargs {
659 struct iattr * sattr;
662 struct nfs3_symlinkargs {
663 struct nfs_fh * fromfh;
664 const char * fromname;
665 unsigned int fromlen;
666 struct page ** pages;
667 unsigned int pathlen;
668 struct iattr * sattr;
671 struct nfs3_mknodargs {
675 enum nfs3_ftype type;
676 struct iattr * sattr;
680 struct nfs3_linkargs {
681 struct nfs_fh * fromfh;
682 struct nfs_fh * tofh;
687 struct nfs3_readdirargs {
693 struct page ** pages;
696 struct nfs3_diropres {
697 struct nfs_fattr * dir_attr;
699 struct nfs_fattr * fattr;
702 struct nfs3_accessres {
703 struct nfs_fattr * fattr;
707 struct nfs3_readlinkargs {
711 struct page ** pages;
714 struct nfs3_linkres {
715 struct nfs_fattr * dir_attr;
716 struct nfs_fattr * fattr;
719 struct nfs3_readdirres {
720 struct nfs_fattr * dir_attr;
725 struct nfs3_getaclres {
726 struct nfs_fattr * fattr;
728 unsigned int acl_access_count;
729 unsigned int acl_default_count;
730 struct posix_acl * acl_access;
731 struct posix_acl * acl_default;
736 typedef u64 clientid4;
738 struct nfs4_accessargs {
739 const struct nfs_fh * fh;
742 struct nfs4_sequence_args seq_args;
745 struct nfs4_accessres {
746 const struct nfs_server * server;
747 struct nfs_fattr * fattr;
750 struct nfs4_sequence_res seq_res;
753 struct nfs4_create_arg {
757 struct page ** pages;
759 } symlink; /* NF4LNK */
763 } device; /* NF4BLK, NF4CHR */
765 const struct qstr * name;
766 const struct nfs_server * server;
767 const struct iattr * attrs;
768 const struct nfs_fh * dir_fh;
770 struct nfs4_sequence_args seq_args;
773 struct nfs4_create_res {
774 const struct nfs_server * server;
776 struct nfs_fattr * fattr;
777 struct nfs4_change_info dir_cinfo;
778 struct nfs_fattr * dir_fattr;
779 struct nfs4_sequence_res seq_res;
782 struct nfs4_fsinfo_arg {
783 const struct nfs_fh * fh;
785 struct nfs4_sequence_args seq_args;
788 struct nfs4_fsinfo_res {
789 struct nfs_fsinfo *fsinfo;
790 struct nfs4_sequence_res seq_res;
793 struct nfs4_getattr_arg {
794 const struct nfs_fh * fh;
796 struct nfs4_sequence_args seq_args;
799 struct nfs4_getattr_res {
800 const struct nfs_server * server;
801 struct nfs_fattr * fattr;
802 struct nfs4_sequence_res seq_res;
805 struct nfs4_link_arg {
806 const struct nfs_fh * fh;
807 const struct nfs_fh * dir_fh;
808 const struct qstr * name;
810 struct nfs4_sequence_args seq_args;
813 struct nfs4_link_res {
814 const struct nfs_server * server;
815 struct nfs_fattr * fattr;
816 struct nfs4_change_info cinfo;
817 struct nfs_fattr * dir_attr;
818 struct nfs4_sequence_res seq_res;
822 struct nfs4_lookup_arg {
823 const struct nfs_fh * dir_fh;
824 const struct qstr * name;
826 struct nfs4_sequence_args seq_args;
829 struct nfs4_lookup_res {
830 const struct nfs_server * server;
831 struct nfs_fattr * fattr;
833 struct nfs4_sequence_res seq_res;
836 struct nfs4_lookup_root_arg {
838 struct nfs4_sequence_args seq_args;
841 struct nfs4_pathconf_arg {
842 const struct nfs_fh * fh;
844 struct nfs4_sequence_args seq_args;
847 struct nfs4_pathconf_res {
848 struct nfs_pathconf *pathconf;
849 struct nfs4_sequence_res seq_res;
852 struct nfs4_readdir_arg {
853 const struct nfs_fh * fh;
855 nfs4_verifier verifier;
857 struct page ** pages; /* zero-copy data */
858 unsigned int pgbase; /* zero-copy data */
861 struct nfs4_sequence_args seq_args;
864 struct nfs4_readdir_res {
865 nfs4_verifier verifier;
867 struct nfs4_sequence_res seq_res;
870 struct nfs4_readlink {
871 const struct nfs_fh * fh;
873 unsigned int pglen; /* zero-copy data */
874 struct page ** pages; /* zero-copy data */
875 struct nfs4_sequence_args seq_args;
878 struct nfs4_readlink_res {
879 struct nfs4_sequence_res seq_res;
882 #define NFS4_SETCLIENTID_NAMELEN (127)
883 struct nfs4_setclientid {
884 const nfs4_verifier * sc_verifier;
885 unsigned int sc_name_len;
886 char sc_name[NFS4_SETCLIENTID_NAMELEN + 1];
888 unsigned int sc_netid_len;
889 char sc_netid[RPCBIND_MAXNETIDLEN + 1];
890 unsigned int sc_uaddr_len;
891 char sc_uaddr[RPCBIND_MAXUADDRLEN + 1];
895 struct nfs4_setclientid_res {
897 nfs4_verifier confirm;
900 struct nfs4_statfs_arg {
901 const struct nfs_fh * fh;
903 struct nfs4_sequence_args seq_args;
906 struct nfs4_statfs_res {
907 struct nfs_fsstat *fsstat;
908 struct nfs4_sequence_res seq_res;
911 struct nfs4_server_caps_arg {
912 struct nfs_fh *fhandle;
913 struct nfs4_sequence_args seq_args;
916 struct nfs4_server_caps_res {
921 struct nfs4_sequence_res seq_res;
929 #define NFS4_PATHNAME_MAXCOMPONENTS 512
930 struct nfs4_pathname {
931 unsigned int ncomponents;
932 struct nfs4_string components[NFS4_PATHNAME_MAXCOMPONENTS];
935 #define NFS4_FS_LOCATION_MAXSERVERS 10
936 struct nfs4_fs_location {
937 unsigned int nservers;
938 struct nfs4_string servers[NFS4_FS_LOCATION_MAXSERVERS];
939 struct nfs4_pathname rootpath;
942 #define NFS4_FS_LOCATIONS_MAXENTRIES 10
943 struct nfs4_fs_locations {
944 struct nfs_fattr fattr;
945 const struct nfs_server *server;
946 struct nfs4_pathname fs_path;
948 struct nfs4_fs_location locations[NFS4_FS_LOCATIONS_MAXENTRIES];
951 struct nfs4_fs_locations_arg {
952 const struct nfs_fh *dir_fh;
953 const struct qstr *name;
956 struct nfs4_sequence_args seq_args;
959 struct nfs4_fs_locations_res {
960 struct nfs4_fs_locations *fs_locations;
961 struct nfs4_sequence_res seq_res;
964 #endif /* CONFIG_NFS_V4 */
971 #ifdef CONFIG_NFS_V4_1
972 struct nfs_impl_id4 {
977 struct nfstime4 date;
980 #define NFS4_EXCHANGE_ID_LEN (48)
981 struct nfs41_exchange_id_args {
982 struct nfs_client *client;
983 nfs4_verifier *verifier;
985 char id[NFS4_EXCHANGE_ID_LEN];
989 struct server_owner {
991 uint32_t major_id_sz;
992 char major_id[NFS4_OPAQUE_LIMIT];
995 struct server_scope {
996 uint32_t server_scope_sz;
997 char server_scope[NFS4_OPAQUE_LIMIT];
1000 struct nfs41_exchange_id_res {
1001 struct nfs_client *client;
1005 struct nfs41_create_session_args {
1006 struct nfs_client *client;
1008 uint32_t cb_program;
1009 struct nfs4_channel_attrs fc_attrs; /* Fore Channel */
1010 struct nfs4_channel_attrs bc_attrs; /* Back Channel */
1013 struct nfs41_create_session_res {
1014 struct nfs_client *client;
1017 struct nfs41_reclaim_complete_args {
1018 /* In the future extend to include curr_fh for use with migration */
1019 unsigned char one_fs:1;
1020 struct nfs4_sequence_args seq_args;
1023 struct nfs41_reclaim_complete_res {
1024 struct nfs4_sequence_res seq_res;
1026 #endif /* CONFIG_NFS_V4_1 */
1030 #define NFS_PAGEVEC_SIZE (8U)
1032 struct nfs_read_data {
1034 struct rpc_task task;
1035 struct inode *inode;
1036 struct rpc_cred *cred;
1037 struct nfs_fattr fattr; /* fattr storage */
1038 struct list_head pages; /* Coalesced read requests */
1039 struct nfs_page *req; /* multi ops per nfs_page */
1040 struct page **pagevec;
1041 unsigned int npages; /* Max length of pagevec */
1042 struct nfs_readargs args;
1043 struct nfs_readres res;
1044 unsigned long timestamp; /* For lease renewal */
1045 struct pnfs_layout_segment *lseg;
1046 struct nfs_client *ds_clp; /* pNFS data server */
1047 const struct rpc_call_ops *mds_ops;
1048 int (*read_done_cb) (struct rpc_task *task, struct nfs_read_data *data);
1050 struct page *page_array[NFS_PAGEVEC_SIZE];
1053 struct nfs_write_data {
1055 struct rpc_task task;
1056 struct inode *inode;
1057 struct rpc_cred *cred;
1058 struct nfs_fattr fattr;
1059 struct nfs_writeverf verf;
1060 struct list_head pages; /* Coalesced requests we wish to flush */
1061 struct nfs_page *req; /* multi ops per nfs_page */
1062 struct page **pagevec;
1063 unsigned int npages; /* Max length of pagevec */
1064 struct nfs_writeargs args; /* argument struct */
1065 struct nfs_writeres res; /* result struct */
1066 struct pnfs_layout_segment *lseg;
1067 struct nfs_client *ds_clp; /* pNFS data server */
1068 int ds_commit_index;
1069 const struct rpc_call_ops *mds_ops;
1070 int (*write_done_cb) (struct rpc_task *task, struct nfs_write_data *data);
1071 #ifdef CONFIG_NFS_V4
1072 unsigned long timestamp; /* For lease renewal */
1074 __u64 mds_offset; /* Filelayout dense stripe */
1075 struct page *page_array[NFS_PAGEVEC_SIZE];
1078 struct nfs_access_entry;
1083 * RPC procedure vector for NFSv2/NFSv3 demuxing
1085 struct nfs_rpc_ops {
1086 u32 version; /* Protocol version */
1087 const struct dentry_operations *dentry_ops;
1088 const struct inode_operations *dir_inode_ops;
1089 const struct inode_operations *file_inode_ops;
1091 int (*getroot) (struct nfs_server *, struct nfs_fh *,
1092 struct nfs_fsinfo *);
1093 int (*lookupfh)(struct nfs_server *, struct nfs_fh *,
1094 struct qstr *, struct nfs_fh *,
1095 struct nfs_fattr *);
1096 int (*getattr) (struct nfs_server *, struct nfs_fh *,
1097 struct nfs_fattr *);
1098 int (*setattr) (struct dentry *, struct nfs_fattr *,
1100 int (*lookup) (struct inode *, struct qstr *,
1101 struct nfs_fh *, struct nfs_fattr *);
1102 int (*access) (struct inode *, struct nfs_access_entry *);
1103 int (*readlink)(struct inode *, struct page *, unsigned int,
1105 int (*create) (struct inode *, struct dentry *,
1106 struct iattr *, int, struct nfs_open_context *);
1107 int (*remove) (struct inode *, struct qstr *);
1108 void (*unlink_setup) (struct rpc_message *, struct inode *dir);
1109 int (*unlink_done) (struct rpc_task *, struct inode *);
1110 int (*rename) (struct inode *, struct qstr *,
1111 struct inode *, struct qstr *);
1112 void (*rename_setup) (struct rpc_message *msg, struct inode *dir);
1113 int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir);
1114 int (*link) (struct inode *, struct inode *, struct qstr *);
1115 int (*symlink) (struct inode *, struct dentry *, struct page *,
1116 unsigned int, struct iattr *);
1117 int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
1118 int (*rmdir) (struct inode *, struct qstr *);
1119 int (*readdir) (struct dentry *, struct rpc_cred *,
1120 u64, struct page **, unsigned int, int);
1121 int (*mknod) (struct inode *, struct dentry *, struct iattr *,
1123 int (*statfs) (struct nfs_server *, struct nfs_fh *,
1124 struct nfs_fsstat *);
1125 int (*fsinfo) (struct nfs_server *, struct nfs_fh *,
1126 struct nfs_fsinfo *);
1127 int (*pathconf) (struct nfs_server *, struct nfs_fh *,
1128 struct nfs_pathconf *);
1129 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
1130 int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, int);
1131 void (*read_setup) (struct nfs_read_data *, struct rpc_message *);
1132 int (*read_done) (struct rpc_task *, struct nfs_read_data *);
1133 void (*write_setup) (struct nfs_write_data *, struct rpc_message *);
1134 int (*write_done) (struct rpc_task *, struct nfs_write_data *);
1135 void (*commit_setup) (struct nfs_write_data *, struct rpc_message *);
1136 int (*commit_done) (struct rpc_task *, struct nfs_write_data *);
1137 int (*lock)(struct file *, int, struct file_lock *);
1138 int (*lock_check_bounds)(const struct file_lock *);
1139 void (*clear_acl_cache)(struct inode *);
1140 void (*close_context)(struct nfs_open_context *ctx, int);
1141 struct inode * (*open_context) (struct inode *dir,
1142 struct nfs_open_context *ctx,
1144 struct iattr *iattr);
1145 int (*init_client) (struct nfs_client *, const struct rpc_timeout *,
1146 const char *, rpc_authflavor_t, int);
1150 * NFS_CALL(getattr, inode, (fattr));
1152 * NFS_PROTO(inode)->getattr(fattr);
1154 #define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args
1157 * Function vectors etc. for the NFS client
1159 extern const struct nfs_rpc_ops nfs_v2_clientops;
1160 extern const struct nfs_rpc_ops nfs_v3_clientops;
1161 extern const struct nfs_rpc_ops nfs_v4_clientops;
1162 extern struct rpc_version nfs_version2;
1163 extern struct rpc_version nfs_version3;
1164 extern struct rpc_version nfs_version4;
1166 extern struct rpc_version nfsacl_version3;
1167 extern struct rpc_program nfsacl_program;