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
{
203 struct pnfs_layout_range
{
209 struct nfs4_layoutget_args
{
211 struct pnfs_layout_range range
;
215 struct nfs_open_context
*ctx
;
216 struct nfs4_sequence_args seq_args
;
217 nfs4_stateid stateid
;
218 struct nfs4_layoutdriver_data layout
;
221 struct nfs4_layoutget_res
{
222 __u32 return_on_close
;
223 struct pnfs_layout_range range
;
225 nfs4_stateid stateid
;
226 struct nfs4_sequence_res seq_res
;
227 struct nfs4_layoutdriver_data
*layoutp
;
230 struct nfs4_layoutget
{
231 struct nfs4_layoutget_args args
;
232 struct nfs4_layoutget_res res
;
233 struct pnfs_layout_segment
**lsegpp
;
236 struct nfs4_getdeviceinfo_args
{
237 struct pnfs_device
*pdev
;
238 struct nfs4_sequence_args seq_args
;
241 struct nfs4_getdeviceinfo_res
{
242 struct pnfs_device
*pdev
;
243 struct nfs4_sequence_res seq_res
;
246 struct nfs4_layoutcommit_args
{
247 nfs4_stateid stateid
;
248 __u64 lastbytewritten
;
251 struct nfs4_sequence_args seq_args
;
254 struct nfs4_layoutcommit_res
{
255 struct nfs_fattr
*fattr
;
256 const struct nfs_server
*server
;
257 struct nfs4_sequence_res seq_res
;
260 struct nfs4_layoutcommit_data
{
261 struct rpc_task task
;
262 struct nfs_fattr fattr
;
263 struct pnfs_layout_segment
*lseg
;
264 struct rpc_cred
*cred
;
265 struct nfs4_layoutcommit_args args
;
266 struct nfs4_layoutcommit_res res
;
270 * Arguments to the open call.
272 struct nfs_openargs
{
273 const struct nfs_fh
* fh
;
274 struct nfs_seqid
* seqid
;
281 struct iattr
* attrs
; /* UNCHECKED, GUARDED */
282 nfs4_verifier verifier
; /* EXCLUSIVE */
284 nfs4_stateid delegation
; /* CLAIM_DELEGATE_CUR */
285 fmode_t delegation_type
; /* CLAIM_PREVIOUS */
287 const struct qstr
* name
;
288 const struct nfs_server
*server
; /* Needed for ID mapping */
291 struct nfs4_sequence_args seq_args
;
295 nfs4_stateid stateid
;
297 struct nfs4_change_info cinfo
;
299 struct nfs_fattr
* f_attr
;
300 struct nfs_fattr
* dir_attr
;
301 struct nfs_seqid
* seqid
;
302 const struct nfs_server
*server
;
303 fmode_t delegation_type
;
304 nfs4_stateid delegation
;
307 __u32 attrset
[NFS4_BITMAP_SIZE
];
308 struct nfs4_sequence_res seq_res
;
312 * Arguments to the open_confirm call.
314 struct nfs_open_confirmargs
{
315 const struct nfs_fh
* fh
;
316 nfs4_stateid
* stateid
;
317 struct nfs_seqid
* seqid
;
320 struct nfs_open_confirmres
{
321 nfs4_stateid stateid
;
322 struct nfs_seqid
* seqid
;
326 * Arguments to the close call.
328 struct nfs_closeargs
{
330 nfs4_stateid
* stateid
;
331 struct nfs_seqid
* seqid
;
334 struct nfs4_sequence_args seq_args
;
337 struct nfs_closeres
{
338 nfs4_stateid stateid
;
339 struct nfs_fattr
* fattr
;
340 struct nfs_seqid
* seqid
;
341 const struct nfs_server
*server
;
342 struct nfs4_sequence_res seq_res
;
345 * * Arguments to the lock,lockt, and locku call.
353 struct nfs_lock_args
{
355 struct file_lock
* fl
;
356 struct nfs_seqid
* lock_seqid
;
357 nfs4_stateid
* lock_stateid
;
358 struct nfs_seqid
* open_seqid
;
359 nfs4_stateid
* open_stateid
;
360 struct nfs_lowner lock_owner
;
361 unsigned char block
: 1;
362 unsigned char reclaim
: 1;
363 unsigned char new_lock_owner
: 1;
364 struct nfs4_sequence_args seq_args
;
367 struct nfs_lock_res
{
368 nfs4_stateid stateid
;
369 struct nfs_seqid
* lock_seqid
;
370 struct nfs_seqid
* open_seqid
;
371 struct nfs4_sequence_res seq_res
;
374 struct nfs_locku_args
{
376 struct file_lock
* fl
;
377 struct nfs_seqid
* seqid
;
378 nfs4_stateid
* stateid
;
379 struct nfs4_sequence_args seq_args
;
382 struct nfs_locku_res
{
383 nfs4_stateid stateid
;
384 struct nfs_seqid
* seqid
;
385 struct nfs4_sequence_res seq_res
;
388 struct nfs_lockt_args
{
390 struct file_lock
* fl
;
391 struct nfs_lowner lock_owner
;
392 struct nfs4_sequence_args seq_args
;
395 struct nfs_lockt_res
{
396 struct file_lock
* denied
; /* LOCK, LOCKT failed */
397 struct nfs4_sequence_res seq_res
;
400 struct nfs_release_lockowner_args
{
401 struct nfs_lowner lock_owner
;
404 struct nfs4_delegreturnargs
{
405 const struct nfs_fh
*fhandle
;
406 const nfs4_stateid
*stateid
;
408 struct nfs4_sequence_args seq_args
;
411 struct nfs4_delegreturnres
{
412 struct nfs_fattr
* fattr
;
413 const struct nfs_server
*server
;
414 struct nfs4_sequence_res seq_res
;
418 * Arguments to the read call.
420 struct nfs_readargs
{
422 struct nfs_open_context
*context
;
423 struct nfs_lock_context
*lock_context
;
427 struct page
** pages
;
428 struct nfs4_sequence_args seq_args
;
432 struct nfs_fattr
* fattr
;
435 struct nfs4_sequence_res seq_res
;
439 * Arguments to the write call.
441 struct nfs_writeargs
{
443 struct nfs_open_context
*context
;
444 struct nfs_lock_context
*lock_context
;
447 enum nfs3_stable_how stable
;
449 struct page
** pages
;
451 struct nfs4_sequence_args seq_args
;
454 struct nfs_writeverf
{
455 enum nfs3_stable_how committed
;
459 struct nfs_writeres
{
460 struct nfs_fattr
* fattr
;
461 struct nfs_writeverf
* verf
;
463 const struct nfs_server
*server
;
464 struct nfs4_sequence_res seq_res
;
468 * Common arguments to the unlink call
470 struct nfs_removeargs
{
471 const struct nfs_fh
*fh
;
474 struct nfs4_sequence_args seq_args
;
477 struct nfs_removeres
{
478 const struct nfs_server
*server
;
479 struct nfs_fattr
*dir_attr
;
480 struct nfs4_change_info cinfo
;
481 struct nfs4_sequence_res seq_res
;
485 * Common arguments to the rename call
487 struct nfs_renameargs
{
488 const struct nfs_fh
*old_dir
;
489 const struct nfs_fh
*new_dir
;
490 const struct qstr
*old_name
;
491 const struct qstr
*new_name
;
493 struct nfs4_sequence_args seq_args
;
496 struct nfs_renameres
{
497 const struct nfs_server
*server
;
498 struct nfs4_change_info old_cinfo
;
499 struct nfs_fattr
*old_fattr
;
500 struct nfs4_change_info new_cinfo
;
501 struct nfs_fattr
*new_fattr
;
502 struct nfs4_sequence_res seq_res
;
506 * Argument struct for decode_entry function
516 struct nfs_fattr
* fattr
;
517 unsigned char d_type
;
518 struct nfs_server
* server
;
522 * The following types are for NFSv2 only.
524 struct nfs_sattrargs
{
526 struct iattr
* sattr
;
529 struct nfs_diropargs
{
535 struct nfs_createargs
{
539 struct iattr
* sattr
;
542 struct nfs_setattrargs
{
544 nfs4_stateid stateid
;
546 const struct nfs_server
* server
; /* Needed for name mapping */
548 struct nfs4_sequence_args seq_args
;
551 struct nfs_setaclargs
{
554 unsigned int acl_pgbase
;
555 struct page
** acl_pages
;
556 struct nfs4_sequence_args seq_args
;
559 struct nfs_setaclres
{
560 struct nfs4_sequence_res seq_res
;
563 struct nfs_getaclargs
{
566 unsigned int acl_pgbase
;
567 struct page
** acl_pages
;
568 struct nfs4_sequence_args seq_args
;
571 struct nfs_getaclres
{
573 struct nfs4_sequence_res seq_res
;
576 struct nfs_setattrres
{
577 struct nfs_fattr
* fattr
;
578 const struct nfs_server
* server
;
579 struct nfs4_sequence_res seq_res
;
582 struct nfs_linkargs
{
583 struct nfs_fh
* fromfh
;
584 struct nfs_fh
* tofh
;
589 struct nfs_symlinkargs
{
590 struct nfs_fh
* fromfh
;
591 const char * fromname
;
592 unsigned int fromlen
;
593 struct page
** pages
;
594 unsigned int pathlen
;
595 struct iattr
* sattr
;
598 struct nfs_readdirargs
{
602 struct page
** pages
;
605 struct nfs3_getaclargs
{
608 struct page
** pages
;
611 struct nfs3_setaclargs
{
612 struct inode
* inode
;
614 struct posix_acl
* acl_access
;
615 struct posix_acl
* acl_default
;
618 struct page
** pages
;
623 struct nfs_fattr
* fattr
;
626 struct nfs_readlinkargs
{
630 struct page
** pages
;
633 struct nfs3_sattrargs
{
635 struct iattr
* sattr
;
637 struct timespec guardtime
;
640 struct nfs3_diropargs
{
646 struct nfs3_accessargs
{
651 struct nfs3_createargs
{
655 struct iattr
* sattr
;
656 enum nfs3_createmode createmode
;
660 struct nfs3_mkdirargs
{
664 struct iattr
* sattr
;
667 struct nfs3_symlinkargs
{
668 struct nfs_fh
* fromfh
;
669 const char * fromname
;
670 unsigned int fromlen
;
671 struct page
** pages
;
672 unsigned int pathlen
;
673 struct iattr
* sattr
;
676 struct nfs3_mknodargs
{
680 enum nfs3_ftype type
;
681 struct iattr
* sattr
;
685 struct nfs3_linkargs
{
686 struct nfs_fh
* fromfh
;
687 struct nfs_fh
* tofh
;
692 struct nfs3_readdirargs
{
698 struct page
** pages
;
701 struct nfs3_diropres
{
702 struct nfs_fattr
* dir_attr
;
704 struct nfs_fattr
* fattr
;
707 struct nfs3_accessres
{
708 struct nfs_fattr
* fattr
;
712 struct nfs3_readlinkargs
{
716 struct page
** pages
;
719 struct nfs3_linkres
{
720 struct nfs_fattr
* dir_attr
;
721 struct nfs_fattr
* fattr
;
724 struct nfs3_readdirres
{
725 struct nfs_fattr
* dir_attr
;
730 struct nfs3_getaclres
{
731 struct nfs_fattr
* fattr
;
733 unsigned int acl_access_count
;
734 unsigned int acl_default_count
;
735 struct posix_acl
* acl_access
;
736 struct posix_acl
* acl_default
;
741 typedef u64 clientid4
;
743 struct nfs4_accessargs
{
744 const struct nfs_fh
* fh
;
747 struct nfs4_sequence_args seq_args
;
750 struct nfs4_accessres
{
751 const struct nfs_server
* server
;
752 struct nfs_fattr
* fattr
;
755 struct nfs4_sequence_res seq_res
;
758 struct nfs4_create_arg
{
762 struct page
** pages
;
764 } symlink
; /* NF4LNK */
768 } device
; /* NF4BLK, NF4CHR */
770 const struct qstr
* name
;
771 const struct nfs_server
* server
;
772 const struct iattr
* attrs
;
773 const struct nfs_fh
* dir_fh
;
775 struct nfs4_sequence_args seq_args
;
778 struct nfs4_create_res
{
779 const struct nfs_server
* server
;
781 struct nfs_fattr
* fattr
;
782 struct nfs4_change_info dir_cinfo
;
783 struct nfs_fattr
* dir_fattr
;
784 struct nfs4_sequence_res seq_res
;
787 struct nfs4_fsinfo_arg
{
788 const struct nfs_fh
* fh
;
790 struct nfs4_sequence_args seq_args
;
793 struct nfs4_fsinfo_res
{
794 struct nfs_fsinfo
*fsinfo
;
795 struct nfs4_sequence_res seq_res
;
798 struct nfs4_getattr_arg
{
799 const struct nfs_fh
* fh
;
801 struct nfs4_sequence_args seq_args
;
804 struct nfs4_getattr_res
{
805 const struct nfs_server
* server
;
806 struct nfs_fattr
* fattr
;
807 struct nfs4_sequence_res seq_res
;
810 struct nfs4_link_arg
{
811 const struct nfs_fh
* fh
;
812 const struct nfs_fh
* dir_fh
;
813 const struct qstr
* name
;
815 struct nfs4_sequence_args seq_args
;
818 struct nfs4_link_res
{
819 const struct nfs_server
* server
;
820 struct nfs_fattr
* fattr
;
821 struct nfs4_change_info cinfo
;
822 struct nfs_fattr
* dir_attr
;
823 struct nfs4_sequence_res seq_res
;
827 struct nfs4_lookup_arg
{
828 const struct nfs_fh
* dir_fh
;
829 const struct qstr
* name
;
831 struct nfs4_sequence_args seq_args
;
834 struct nfs4_lookup_res
{
835 const struct nfs_server
* server
;
836 struct nfs_fattr
* fattr
;
838 struct nfs4_sequence_res seq_res
;
841 struct nfs4_lookup_root_arg
{
843 struct nfs4_sequence_args seq_args
;
846 struct nfs4_pathconf_arg
{
847 const struct nfs_fh
* fh
;
849 struct nfs4_sequence_args seq_args
;
852 struct nfs4_pathconf_res
{
853 struct nfs_pathconf
*pathconf
;
854 struct nfs4_sequence_res seq_res
;
857 struct nfs4_readdir_arg
{
858 const struct nfs_fh
* fh
;
860 nfs4_verifier verifier
;
862 struct page
** pages
; /* zero-copy data */
863 unsigned int pgbase
; /* zero-copy data */
866 struct nfs4_sequence_args seq_args
;
869 struct nfs4_readdir_res
{
870 nfs4_verifier verifier
;
872 struct nfs4_sequence_res seq_res
;
875 struct nfs4_readlink
{
876 const struct nfs_fh
* fh
;
878 unsigned int pglen
; /* zero-copy data */
879 struct page
** pages
; /* zero-copy data */
880 struct nfs4_sequence_args seq_args
;
883 struct nfs4_readlink_res
{
884 struct nfs4_sequence_res seq_res
;
887 #define NFS4_SETCLIENTID_NAMELEN (127)
888 struct nfs4_setclientid
{
889 const nfs4_verifier
* sc_verifier
;
890 unsigned int sc_name_len
;
891 char sc_name
[NFS4_SETCLIENTID_NAMELEN
+ 1];
893 unsigned int sc_netid_len
;
894 char sc_netid
[RPCBIND_MAXNETIDLEN
+ 1];
895 unsigned int sc_uaddr_len
;
896 char sc_uaddr
[RPCBIND_MAXUADDRLEN
+ 1];
900 struct nfs4_setclientid_res
{
902 nfs4_verifier confirm
;
905 struct nfs4_statfs_arg
{
906 const struct nfs_fh
* fh
;
908 struct nfs4_sequence_args seq_args
;
911 struct nfs4_statfs_res
{
912 struct nfs_fsstat
*fsstat
;
913 struct nfs4_sequence_res seq_res
;
916 struct nfs4_server_caps_arg
{
917 struct nfs_fh
*fhandle
;
918 struct nfs4_sequence_args seq_args
;
921 struct nfs4_server_caps_res
{
926 struct nfs4_sequence_res seq_res
;
934 #define NFS4_PATHNAME_MAXCOMPONENTS 512
935 struct nfs4_pathname
{
936 unsigned int ncomponents
;
937 struct nfs4_string components
[NFS4_PATHNAME_MAXCOMPONENTS
];
940 #define NFS4_FS_LOCATION_MAXSERVERS 10
941 struct nfs4_fs_location
{
942 unsigned int nservers
;
943 struct nfs4_string servers
[NFS4_FS_LOCATION_MAXSERVERS
];
944 struct nfs4_pathname rootpath
;
947 #define NFS4_FS_LOCATIONS_MAXENTRIES 10
948 struct nfs4_fs_locations
{
949 struct nfs_fattr fattr
;
950 const struct nfs_server
*server
;
951 struct nfs4_pathname fs_path
;
953 struct nfs4_fs_location locations
[NFS4_FS_LOCATIONS_MAXENTRIES
];
956 struct nfs4_fs_locations_arg
{
957 const struct nfs_fh
*dir_fh
;
958 const struct qstr
*name
;
961 struct nfs4_sequence_args seq_args
;
964 struct nfs4_fs_locations_res
{
965 struct nfs4_fs_locations
*fs_locations
;
966 struct nfs4_sequence_res seq_res
;
969 struct nfs4_secinfo_oid
{
971 char data
[GSS_OID_MAX_LEN
];
974 struct nfs4_secinfo_gss
{
975 struct nfs4_secinfo_oid sec_oid4
;
977 unsigned int service
;
980 struct nfs4_secinfo_flavor
{
982 struct nfs4_secinfo_gss gss
;
985 struct nfs4_secinfo_flavors
{
986 unsigned int num_flavors
;
987 struct nfs4_secinfo_flavor flavors
[0];
990 struct nfs4_secinfo_arg
{
991 const struct nfs_fh
*dir_fh
;
992 const struct qstr
*name
;
993 struct nfs4_sequence_args seq_args
;
996 struct nfs4_secinfo_res
{
997 struct nfs4_secinfo_flavors
*flavors
;
998 struct nfs4_sequence_res seq_res
;
1001 #endif /* CONFIG_NFS_V4 */
1008 #ifdef CONFIG_NFS_V4_1
1009 struct nfs_impl_id4
{
1014 struct nfstime4 date
;
1017 #define NFS4_EXCHANGE_ID_LEN (48)
1018 struct nfs41_exchange_id_args
{
1019 struct nfs_client
*client
;
1020 nfs4_verifier
*verifier
;
1021 unsigned int id_len
;
1022 char id
[NFS4_EXCHANGE_ID_LEN
];
1026 struct server_owner
{
1028 uint32_t major_id_sz
;
1029 char major_id
[NFS4_OPAQUE_LIMIT
];
1032 struct server_scope
{
1033 uint32_t server_scope_sz
;
1034 char server_scope
[NFS4_OPAQUE_LIMIT
];
1037 struct nfs41_exchange_id_res
{
1038 struct nfs_client
*client
;
1042 struct nfs41_create_session_args
{
1043 struct nfs_client
*client
;
1045 uint32_t cb_program
;
1046 struct nfs4_channel_attrs fc_attrs
; /* Fore Channel */
1047 struct nfs4_channel_attrs bc_attrs
; /* Back Channel */
1050 struct nfs41_create_session_res
{
1051 struct nfs_client
*client
;
1054 struct nfs41_reclaim_complete_args
{
1055 /* In the future extend to include curr_fh for use with migration */
1056 unsigned char one_fs
:1;
1057 struct nfs4_sequence_args seq_args
;
1060 struct nfs41_reclaim_complete_res
{
1061 struct nfs4_sequence_res seq_res
;
1063 #endif /* CONFIG_NFS_V4_1 */
1067 #define NFS_PAGEVEC_SIZE (8U)
1069 struct nfs_read_data
{
1071 struct rpc_task task
;
1072 struct inode
*inode
;
1073 struct rpc_cred
*cred
;
1074 struct nfs_fattr fattr
; /* fattr storage */
1075 struct list_head pages
; /* Coalesced read requests */
1076 struct nfs_page
*req
; /* multi ops per nfs_page */
1077 struct page
**pagevec
;
1078 unsigned int npages
; /* Max length of pagevec */
1079 struct nfs_readargs args
;
1080 struct nfs_readres res
;
1081 unsigned long timestamp
; /* For lease renewal */
1082 struct pnfs_layout_segment
*lseg
;
1083 struct nfs_client
*ds_clp
; /* pNFS data server */
1084 const struct rpc_call_ops
*mds_ops
;
1085 int (*read_done_cb
) (struct rpc_task
*task
, struct nfs_read_data
*data
);
1087 struct page
*page_array
[NFS_PAGEVEC_SIZE
];
1090 struct nfs_write_data
{
1092 struct rpc_task task
;
1093 struct inode
*inode
;
1094 struct rpc_cred
*cred
;
1095 struct nfs_fattr fattr
;
1096 struct nfs_writeverf verf
;
1097 struct list_head pages
; /* Coalesced requests we wish to flush */
1098 struct nfs_page
*req
; /* multi ops per nfs_page */
1099 struct page
**pagevec
;
1100 unsigned int npages
; /* Max length of pagevec */
1101 struct nfs_writeargs args
; /* argument struct */
1102 struct nfs_writeres res
; /* result struct */
1103 struct pnfs_layout_segment
*lseg
;
1104 struct nfs_client
*ds_clp
; /* pNFS data server */
1105 int ds_commit_index
;
1106 const struct rpc_call_ops
*mds_ops
;
1107 int (*write_done_cb
) (struct rpc_task
*task
, struct nfs_write_data
*data
);
1108 #ifdef CONFIG_NFS_V4
1109 unsigned long timestamp
; /* For lease renewal */
1111 __u64 mds_offset
; /* Filelayout dense stripe */
1112 struct page
*page_array
[NFS_PAGEVEC_SIZE
];
1115 struct nfs_access_entry
;
1120 * RPC procedure vector for NFSv2/NFSv3 demuxing
1122 struct nfs_rpc_ops
{
1123 u32 version
; /* Protocol version */
1124 const struct dentry_operations
*dentry_ops
;
1125 const struct inode_operations
*dir_inode_ops
;
1126 const struct inode_operations
*file_inode_ops
;
1128 int (*getroot
) (struct nfs_server
*, struct nfs_fh
*,
1129 struct nfs_fsinfo
*);
1130 int (*lookupfh
)(struct nfs_server
*, struct nfs_fh
*,
1131 struct qstr
*, struct nfs_fh
*,
1132 struct nfs_fattr
*);
1133 int (*getattr
) (struct nfs_server
*, struct nfs_fh
*,
1134 struct nfs_fattr
*);
1135 int (*setattr
) (struct dentry
*, struct nfs_fattr
*,
1137 int (*lookup
) (struct rpc_clnt
*clnt
, struct inode
*, struct qstr
*,
1138 struct nfs_fh
*, struct nfs_fattr
*);
1139 int (*access
) (struct inode
*, struct nfs_access_entry
*);
1140 int (*readlink
)(struct inode
*, struct page
*, unsigned int,
1142 int (*create
) (struct inode
*, struct dentry
*,
1143 struct iattr
*, int, struct nfs_open_context
*);
1144 int (*remove
) (struct inode
*, struct qstr
*);
1145 void (*unlink_setup
) (struct rpc_message
*, struct inode
*dir
);
1146 int (*unlink_done
) (struct rpc_task
*, struct inode
*);
1147 int (*rename
) (struct inode
*, struct qstr
*,
1148 struct inode
*, struct qstr
*);
1149 void (*rename_setup
) (struct rpc_message
*msg
, struct inode
*dir
);
1150 int (*rename_done
) (struct rpc_task
*task
, struct inode
*old_dir
, struct inode
*new_dir
);
1151 int (*link
) (struct inode
*, struct inode
*, struct qstr
*);
1152 int (*symlink
) (struct inode
*, struct dentry
*, struct page
*,
1153 unsigned int, struct iattr
*);
1154 int (*mkdir
) (struct inode
*, struct dentry
*, struct iattr
*);
1155 int (*rmdir
) (struct inode
*, struct qstr
*);
1156 int (*readdir
) (struct dentry
*, struct rpc_cred
*,
1157 u64
, struct page
**, unsigned int, int);
1158 int (*mknod
) (struct inode
*, struct dentry
*, struct iattr
*,
1160 int (*statfs
) (struct nfs_server
*, struct nfs_fh
*,
1161 struct nfs_fsstat
*);
1162 int (*fsinfo
) (struct nfs_server
*, struct nfs_fh
*,
1163 struct nfs_fsinfo
*);
1164 int (*pathconf
) (struct nfs_server
*, struct nfs_fh
*,
1165 struct nfs_pathconf
*);
1166 int (*set_capabilities
)(struct nfs_server
*, struct nfs_fh
*);
1167 int (*decode_dirent
)(struct xdr_stream
*, struct nfs_entry
*, int);
1168 void (*read_setup
) (struct nfs_read_data
*, struct rpc_message
*);
1169 int (*read_done
) (struct rpc_task
*, struct nfs_read_data
*);
1170 void (*write_setup
) (struct nfs_write_data
*, struct rpc_message
*);
1171 int (*write_done
) (struct rpc_task
*, struct nfs_write_data
*);
1172 void (*commit_setup
) (struct nfs_write_data
*, struct rpc_message
*);
1173 int (*commit_done
) (struct rpc_task
*, struct nfs_write_data
*);
1174 int (*lock
)(struct file
*, int, struct file_lock
*);
1175 int (*lock_check_bounds
)(const struct file_lock
*);
1176 void (*clear_acl_cache
)(struct inode
*);
1177 void (*close_context
)(struct nfs_open_context
*ctx
, int);
1178 struct inode
* (*open_context
) (struct inode
*dir
,
1179 struct nfs_open_context
*ctx
,
1181 struct iattr
*iattr
);
1182 int (*init_client
) (struct nfs_client
*, const struct rpc_timeout
*,
1183 const char *, rpc_authflavor_t
, int);
1184 int (*secinfo
)(struct inode
*, const struct qstr
*, struct nfs4_secinfo_flavors
*);
1188 * NFS_CALL(getattr, inode, (fattr));
1190 * NFS_PROTO(inode)->getattr(fattr);
1192 #define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args
1195 * Function vectors etc. for the NFS client
1197 extern const struct nfs_rpc_ops nfs_v2_clientops
;
1198 extern const struct nfs_rpc_ops nfs_v3_clientops
;
1199 extern const struct nfs_rpc_ops nfs_v4_clientops
;
1200 extern struct rpc_version nfs_version2
;
1201 extern struct rpc_version nfs_version3
;
1202 extern struct rpc_version nfs_version4
;
1204 extern struct rpc_version nfsacl_version3
;
1205 extern struct rpc_program nfsacl_program
;