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
;
191 * Arguments to the open call.
193 struct nfs_openargs
{
194 const struct nfs_fh
* fh
;
195 struct nfs_seqid
* seqid
;
202 struct iattr
* attrs
; /* UNCHECKED, GUARDED */
203 nfs4_verifier verifier
; /* EXCLUSIVE */
205 nfs4_stateid delegation
; /* CLAIM_DELEGATE_CUR */
206 fmode_t delegation_type
; /* CLAIM_PREVIOUS */
208 const struct qstr
* name
;
209 const struct nfs_server
*server
; /* Needed for ID mapping */
212 struct nfs4_sequence_args seq_args
;
216 nfs4_stateid stateid
;
218 struct nfs4_change_info cinfo
;
220 struct nfs_fattr
* f_attr
;
221 struct nfs_fattr
* dir_attr
;
222 struct nfs_seqid
* seqid
;
223 const struct nfs_server
*server
;
224 fmode_t delegation_type
;
225 nfs4_stateid delegation
;
228 __u32 attrset
[NFS4_BITMAP_SIZE
];
229 struct nfs4_sequence_res seq_res
;
233 * Arguments to the open_confirm call.
235 struct nfs_open_confirmargs
{
236 const struct nfs_fh
* fh
;
237 nfs4_stateid
* stateid
;
238 struct nfs_seqid
* seqid
;
241 struct nfs_open_confirmres
{
242 nfs4_stateid stateid
;
243 struct nfs_seqid
* seqid
;
247 * Arguments to the close call.
249 struct nfs_closeargs
{
251 nfs4_stateid
* stateid
;
252 struct nfs_seqid
* seqid
;
255 struct nfs4_sequence_args seq_args
;
258 struct nfs_closeres
{
259 nfs4_stateid stateid
;
260 struct nfs_fattr
* fattr
;
261 struct nfs_seqid
* seqid
;
262 const struct nfs_server
*server
;
263 struct nfs4_sequence_res seq_res
;
266 * * Arguments to the lock,lockt, and locku call.
273 struct nfs_lock_args
{
275 struct file_lock
* fl
;
276 struct nfs_seqid
* lock_seqid
;
277 nfs4_stateid
* lock_stateid
;
278 struct nfs_seqid
* open_seqid
;
279 nfs4_stateid
* open_stateid
;
280 struct nfs_lowner lock_owner
;
281 unsigned char block
: 1;
282 unsigned char reclaim
: 1;
283 unsigned char new_lock_owner
: 1;
284 struct nfs4_sequence_args seq_args
;
287 struct nfs_lock_res
{
288 nfs4_stateid stateid
;
289 struct nfs_seqid
* lock_seqid
;
290 struct nfs_seqid
* open_seqid
;
291 struct nfs4_sequence_res seq_res
;
294 struct nfs_locku_args
{
296 struct file_lock
* fl
;
297 struct nfs_seqid
* seqid
;
298 nfs4_stateid
* stateid
;
299 struct nfs4_sequence_args seq_args
;
302 struct nfs_locku_res
{
303 nfs4_stateid stateid
;
304 struct nfs_seqid
* seqid
;
305 struct nfs4_sequence_res seq_res
;
308 struct nfs_lockt_args
{
310 struct file_lock
* fl
;
311 struct nfs_lowner lock_owner
;
312 struct nfs4_sequence_args seq_args
;
315 struct nfs_lockt_res
{
316 struct file_lock
* denied
; /* LOCK, LOCKT failed */
317 struct nfs4_sequence_res seq_res
;
320 struct nfs_release_lockowner_args
{
321 struct nfs_lowner lock_owner
;
324 struct nfs4_delegreturnargs
{
325 const struct nfs_fh
*fhandle
;
326 const nfs4_stateid
*stateid
;
328 struct nfs4_sequence_args seq_args
;
331 struct nfs4_delegreturnres
{
332 struct nfs_fattr
* fattr
;
333 const struct nfs_server
*server
;
334 struct nfs4_sequence_res seq_res
;
338 * Arguments to the read call.
340 struct nfs_readargs
{
342 struct nfs_open_context
*context
;
343 struct nfs_lock_context
*lock_context
;
347 struct page
** pages
;
348 struct nfs4_sequence_args seq_args
;
352 struct nfs_fattr
* fattr
;
355 struct nfs4_sequence_res seq_res
;
359 * Arguments to the write call.
361 struct nfs_writeargs
{
363 struct nfs_open_context
*context
;
364 struct nfs_lock_context
*lock_context
;
367 enum nfs3_stable_how stable
;
369 struct page
** pages
;
371 struct nfs4_sequence_args seq_args
;
374 struct nfs_writeverf
{
375 enum nfs3_stable_how committed
;
379 struct nfs_writeres
{
380 struct nfs_fattr
* fattr
;
381 struct nfs_writeverf
* verf
;
383 const struct nfs_server
*server
;
384 struct nfs4_sequence_res seq_res
;
388 * Common arguments to the unlink call
390 struct nfs_removeargs
{
391 const struct nfs_fh
*fh
;
394 struct nfs4_sequence_args seq_args
;
397 struct nfs_removeres
{
398 const struct nfs_server
*server
;
399 struct nfs_fattr
*dir_attr
;
400 struct nfs4_change_info cinfo
;
401 struct nfs4_sequence_res seq_res
;
405 * Common arguments to the rename call
407 struct nfs_renameargs
{
408 const struct nfs_fh
*old_dir
;
409 const struct nfs_fh
*new_dir
;
410 const struct qstr
*old_name
;
411 const struct qstr
*new_name
;
413 struct nfs4_sequence_args seq_args
;
416 struct nfs_renameres
{
417 const struct nfs_server
*server
;
418 struct nfs4_change_info old_cinfo
;
419 struct nfs_fattr
*old_fattr
;
420 struct nfs4_change_info new_cinfo
;
421 struct nfs_fattr
*new_fattr
;
422 struct nfs4_sequence_res seq_res
;
426 * Argument struct for decode_entry function
436 struct nfs_fattr
* fattr
;
440 * The following types are for NFSv2 only.
442 struct nfs_sattrargs
{
444 struct iattr
* sattr
;
447 struct nfs_diropargs
{
453 struct nfs_createargs
{
457 struct iattr
* sattr
;
460 struct nfs_setattrargs
{
462 nfs4_stateid stateid
;
464 const struct nfs_server
* server
; /* Needed for name mapping */
466 struct nfs4_sequence_args seq_args
;
469 struct nfs_setaclargs
{
472 unsigned int acl_pgbase
;
473 struct page
** acl_pages
;
474 struct nfs4_sequence_args seq_args
;
477 struct nfs_setaclres
{
478 struct nfs4_sequence_res seq_res
;
481 struct nfs_getaclargs
{
484 unsigned int acl_pgbase
;
485 struct page
** acl_pages
;
486 struct nfs4_sequence_args seq_args
;
489 struct nfs_getaclres
{
491 struct nfs4_sequence_res seq_res
;
494 struct nfs_setattrres
{
495 struct nfs_fattr
* fattr
;
496 const struct nfs_server
* server
;
497 struct nfs4_sequence_res seq_res
;
500 struct nfs_linkargs
{
501 struct nfs_fh
* fromfh
;
502 struct nfs_fh
* tofh
;
507 struct nfs_symlinkargs
{
508 struct nfs_fh
* fromfh
;
509 const char * fromname
;
510 unsigned int fromlen
;
511 struct page
** pages
;
512 unsigned int pathlen
;
513 struct iattr
* sattr
;
516 struct nfs_readdirargs
{
520 struct page
** pages
;
523 struct nfs3_getaclargs
{
526 struct page
** pages
;
529 struct nfs3_setaclargs
{
530 struct inode
* inode
;
532 struct posix_acl
* acl_access
;
533 struct posix_acl
* acl_default
;
536 struct page
** pages
;
541 struct nfs_fattr
* fattr
;
544 struct nfs_readlinkargs
{
548 struct page
** pages
;
551 struct nfs3_sattrargs
{
553 struct iattr
* sattr
;
555 struct timespec guardtime
;
558 struct nfs3_diropargs
{
564 struct nfs3_accessargs
{
569 struct nfs3_createargs
{
573 struct iattr
* sattr
;
574 enum nfs3_createmode createmode
;
578 struct nfs3_mkdirargs
{
582 struct iattr
* sattr
;
585 struct nfs3_symlinkargs
{
586 struct nfs_fh
* fromfh
;
587 const char * fromname
;
588 unsigned int fromlen
;
589 struct page
** pages
;
590 unsigned int pathlen
;
591 struct iattr
* sattr
;
594 struct nfs3_mknodargs
{
598 enum nfs3_ftype type
;
599 struct iattr
* sattr
;
603 struct nfs3_linkargs
{
604 struct nfs_fh
* fromfh
;
605 struct nfs_fh
* tofh
;
610 struct nfs3_readdirargs
{
616 struct page
** pages
;
619 struct nfs3_diropres
{
620 struct nfs_fattr
* dir_attr
;
622 struct nfs_fattr
* fattr
;
625 struct nfs3_accessres
{
626 struct nfs_fattr
* fattr
;
630 struct nfs3_readlinkargs
{
634 struct page
** pages
;
637 struct nfs3_linkres
{
638 struct nfs_fattr
* dir_attr
;
639 struct nfs_fattr
* fattr
;
642 struct nfs3_readdirres
{
643 struct nfs_fattr
* dir_attr
;
648 struct nfs3_getaclres
{
649 struct nfs_fattr
* fattr
;
651 unsigned int acl_access_count
;
652 unsigned int acl_default_count
;
653 struct posix_acl
* acl_access
;
654 struct posix_acl
* acl_default
;
659 typedef u64 clientid4
;
661 struct nfs4_accessargs
{
662 const struct nfs_fh
* fh
;
665 struct nfs4_sequence_args seq_args
;
668 struct nfs4_accessres
{
669 const struct nfs_server
* server
;
670 struct nfs_fattr
* fattr
;
673 struct nfs4_sequence_res seq_res
;
676 struct nfs4_create_arg
{
680 struct page
** pages
;
682 } symlink
; /* NF4LNK */
686 } device
; /* NF4BLK, NF4CHR */
688 const struct qstr
* name
;
689 const struct nfs_server
* server
;
690 const struct iattr
* attrs
;
691 const struct nfs_fh
* dir_fh
;
693 struct nfs4_sequence_args seq_args
;
696 struct nfs4_create_res
{
697 const struct nfs_server
* server
;
699 struct nfs_fattr
* fattr
;
700 struct nfs4_change_info dir_cinfo
;
701 struct nfs_fattr
* dir_fattr
;
702 struct nfs4_sequence_res seq_res
;
705 struct nfs4_fsinfo_arg
{
706 const struct nfs_fh
* fh
;
708 struct nfs4_sequence_args seq_args
;
711 struct nfs4_fsinfo_res
{
712 struct nfs_fsinfo
*fsinfo
;
713 struct nfs4_sequence_res seq_res
;
716 struct nfs4_getattr_arg
{
717 const struct nfs_fh
* fh
;
719 struct nfs4_sequence_args seq_args
;
722 struct nfs4_getattr_res
{
723 const struct nfs_server
* server
;
724 struct nfs_fattr
* fattr
;
725 struct nfs4_sequence_res seq_res
;
728 struct nfs4_link_arg
{
729 const struct nfs_fh
* fh
;
730 const struct nfs_fh
* dir_fh
;
731 const struct qstr
* name
;
733 struct nfs4_sequence_args seq_args
;
736 struct nfs4_link_res
{
737 const struct nfs_server
* server
;
738 struct nfs_fattr
* fattr
;
739 struct nfs4_change_info cinfo
;
740 struct nfs_fattr
* dir_attr
;
741 struct nfs4_sequence_res seq_res
;
745 struct nfs4_lookup_arg
{
746 const struct nfs_fh
* dir_fh
;
747 const struct qstr
* name
;
749 struct nfs4_sequence_args seq_args
;
752 struct nfs4_lookup_res
{
753 const struct nfs_server
* server
;
754 struct nfs_fattr
* fattr
;
756 struct nfs4_sequence_res seq_res
;
759 struct nfs4_lookup_root_arg
{
761 struct nfs4_sequence_args seq_args
;
764 struct nfs4_pathconf_arg
{
765 const struct nfs_fh
* fh
;
767 struct nfs4_sequence_args seq_args
;
770 struct nfs4_pathconf_res
{
771 struct nfs_pathconf
*pathconf
;
772 struct nfs4_sequence_res seq_res
;
775 struct nfs4_readdir_arg
{
776 const struct nfs_fh
* fh
;
778 nfs4_verifier verifier
;
780 struct page
** pages
; /* zero-copy data */
781 unsigned int pgbase
; /* zero-copy data */
784 struct nfs4_sequence_args seq_args
;
787 struct nfs4_readdir_res
{
788 nfs4_verifier verifier
;
790 struct nfs4_sequence_res seq_res
;
793 struct nfs4_readlink
{
794 const struct nfs_fh
* fh
;
796 unsigned int pglen
; /* zero-copy data */
797 struct page
** pages
; /* zero-copy data */
798 struct nfs4_sequence_args seq_args
;
801 struct nfs4_readlink_res
{
802 struct nfs4_sequence_res seq_res
;
805 #define NFS4_SETCLIENTID_NAMELEN (127)
806 struct nfs4_setclientid
{
807 const nfs4_verifier
* sc_verifier
;
808 unsigned int sc_name_len
;
809 char sc_name
[NFS4_SETCLIENTID_NAMELEN
+ 1];
811 unsigned int sc_netid_len
;
812 char sc_netid
[RPCBIND_MAXNETIDLEN
+ 1];
813 unsigned int sc_uaddr_len
;
814 char sc_uaddr
[RPCBIND_MAXUADDRLEN
+ 1];
818 struct nfs4_setclientid_res
{
820 nfs4_verifier confirm
;
823 struct nfs4_statfs_arg
{
824 const struct nfs_fh
* fh
;
826 struct nfs4_sequence_args seq_args
;
829 struct nfs4_statfs_res
{
830 struct nfs_fsstat
*fsstat
;
831 struct nfs4_sequence_res seq_res
;
834 struct nfs4_server_caps_arg
{
835 struct nfs_fh
*fhandle
;
836 struct nfs4_sequence_args seq_args
;
839 struct nfs4_server_caps_res
{
844 struct nfs4_sequence_res seq_res
;
852 #define NFS4_PATHNAME_MAXCOMPONENTS 512
853 struct nfs4_pathname
{
854 unsigned int ncomponents
;
855 struct nfs4_string components
[NFS4_PATHNAME_MAXCOMPONENTS
];
858 #define NFS4_FS_LOCATION_MAXSERVERS 10
859 struct nfs4_fs_location
{
860 unsigned int nservers
;
861 struct nfs4_string servers
[NFS4_FS_LOCATION_MAXSERVERS
];
862 struct nfs4_pathname rootpath
;
865 #define NFS4_FS_LOCATIONS_MAXENTRIES 10
866 struct nfs4_fs_locations
{
867 struct nfs_fattr fattr
;
868 const struct nfs_server
*server
;
869 struct nfs4_pathname fs_path
;
871 struct nfs4_fs_location locations
[NFS4_FS_LOCATIONS_MAXENTRIES
];
874 struct nfs4_fs_locations_arg
{
875 const struct nfs_fh
*dir_fh
;
876 const struct qstr
*name
;
879 struct nfs4_sequence_args seq_args
;
882 struct nfs4_fs_locations_res
{
883 struct nfs4_fs_locations
*fs_locations
;
884 struct nfs4_sequence_res seq_res
;
887 #endif /* CONFIG_NFS_V4 */
894 #ifdef CONFIG_NFS_V4_1
895 struct nfs_impl_id4
{
900 struct nfstime4 date
;
903 #define NFS4_EXCHANGE_ID_LEN (48)
904 struct nfs41_exchange_id_args
{
905 struct nfs_client
*client
;
906 nfs4_verifier
*verifier
;
908 char id
[NFS4_EXCHANGE_ID_LEN
];
912 struct server_owner
{
914 uint32_t major_id_sz
;
915 char major_id
[NFS4_OPAQUE_LIMIT
];
918 struct server_scope
{
919 uint32_t server_scope_sz
;
920 char server_scope
[NFS4_OPAQUE_LIMIT
];
923 struct nfs41_exchange_id_res
{
924 struct nfs_client
*client
;
928 struct nfs41_create_session_args
{
929 struct nfs_client
*client
;
932 struct nfs4_channel_attrs fc_attrs
; /* Fore Channel */
933 struct nfs4_channel_attrs bc_attrs
; /* Back Channel */
936 struct nfs41_create_session_res
{
937 struct nfs_client
*client
;
940 struct nfs41_reclaim_complete_args
{
941 /* In the future extend to include curr_fh for use with migration */
942 unsigned char one_fs
:1;
943 struct nfs4_sequence_args seq_args
;
946 struct nfs41_reclaim_complete_res
{
947 struct nfs4_sequence_res seq_res
;
949 #endif /* CONFIG_NFS_V4_1 */
953 #define NFS_PAGEVEC_SIZE (8U)
955 struct nfs_read_data
{
957 struct rpc_task task
;
959 struct rpc_cred
*cred
;
960 struct nfs_fattr fattr
; /* fattr storage */
961 struct list_head pages
; /* Coalesced read requests */
962 struct nfs_page
*req
; /* multi ops per nfs_page */
963 struct page
**pagevec
;
964 unsigned int npages
; /* Max length of pagevec */
965 struct nfs_readargs args
;
966 struct nfs_readres res
;
968 unsigned long timestamp
; /* For lease renewal */
970 struct page
*page_array
[NFS_PAGEVEC_SIZE
];
973 struct nfs_write_data
{
975 struct rpc_task task
;
977 struct rpc_cred
*cred
;
978 struct nfs_fattr fattr
;
979 struct nfs_writeverf verf
;
980 struct list_head pages
; /* Coalesced requests we wish to flush */
981 struct nfs_page
*req
; /* multi ops per nfs_page */
982 struct page
**pagevec
;
983 unsigned int npages
; /* Max length of pagevec */
984 struct nfs_writeargs args
; /* argument struct */
985 struct nfs_writeres res
; /* result struct */
987 unsigned long timestamp
; /* For lease renewal */
989 struct page
*page_array
[NFS_PAGEVEC_SIZE
];
992 struct nfs_access_entry
;
995 * RPC procedure vector for NFSv2/NFSv3 demuxing
998 u32 version
; /* Protocol version */
999 const struct dentry_operations
*dentry_ops
;
1000 const struct inode_operations
*dir_inode_ops
;
1001 const struct inode_operations
*file_inode_ops
;
1003 int (*getroot
) (struct nfs_server
*, struct nfs_fh
*,
1004 struct nfs_fsinfo
*);
1005 int (*lookupfh
)(struct nfs_server
*, struct nfs_fh
*,
1006 struct qstr
*, struct nfs_fh
*,
1007 struct nfs_fattr
*);
1008 int (*getattr
) (struct nfs_server
*, struct nfs_fh
*,
1009 struct nfs_fattr
*);
1010 int (*setattr
) (struct dentry
*, struct nfs_fattr
*,
1012 int (*lookup
) (struct inode
*, struct qstr
*,
1013 struct nfs_fh
*, struct nfs_fattr
*);
1014 int (*access
) (struct inode
*, struct nfs_access_entry
*);
1015 int (*readlink
)(struct inode
*, struct page
*, unsigned int,
1017 int (*create
) (struct inode
*, struct dentry
*,
1018 struct iattr
*, int, struct nfs_open_context
*);
1019 int (*remove
) (struct inode
*, struct qstr
*);
1020 void (*unlink_setup
) (struct rpc_message
*, struct inode
*dir
);
1021 int (*unlink_done
) (struct rpc_task
*, struct inode
*);
1022 int (*rename
) (struct inode
*, struct qstr
*,
1023 struct inode
*, struct qstr
*);
1024 void (*rename_setup
) (struct rpc_message
*msg
, struct inode
*dir
);
1025 int (*rename_done
) (struct rpc_task
*task
, struct inode
*old_dir
, struct inode
*new_dir
);
1026 int (*link
) (struct inode
*, struct inode
*, struct qstr
*);
1027 int (*symlink
) (struct inode
*, struct dentry
*, struct page
*,
1028 unsigned int, struct iattr
*);
1029 int (*mkdir
) (struct inode
*, struct dentry
*, struct iattr
*);
1030 int (*rmdir
) (struct inode
*, struct qstr
*);
1031 int (*readdir
) (struct dentry
*, struct rpc_cred
*,
1032 u64
, struct page
**, unsigned int, int);
1033 int (*mknod
) (struct inode
*, struct dentry
*, struct iattr
*,
1035 int (*statfs
) (struct nfs_server
*, struct nfs_fh
*,
1036 struct nfs_fsstat
*);
1037 int (*fsinfo
) (struct nfs_server
*, struct nfs_fh
*,
1038 struct nfs_fsinfo
*);
1039 int (*pathconf
) (struct nfs_server
*, struct nfs_fh
*,
1040 struct nfs_pathconf
*);
1041 int (*set_capabilities
)(struct nfs_server
*, struct nfs_fh
*);
1042 __be32
*(*decode_dirent
)(struct xdr_stream
*, struct nfs_entry
*, struct nfs_server
*, int plus
);
1043 void (*read_setup
) (struct nfs_read_data
*, struct rpc_message
*);
1044 int (*read_done
) (struct rpc_task
*, struct nfs_read_data
*);
1045 void (*write_setup
) (struct nfs_write_data
*, struct rpc_message
*);
1046 int (*write_done
) (struct rpc_task
*, struct nfs_write_data
*);
1047 void (*commit_setup
) (struct nfs_write_data
*, struct rpc_message
*);
1048 int (*commit_done
) (struct rpc_task
*, struct nfs_write_data
*);
1049 int (*lock
)(struct file
*, int, struct file_lock
*);
1050 int (*lock_check_bounds
)(const struct file_lock
*);
1051 void (*clear_acl_cache
)(struct inode
*);
1052 void (*close_context
)(struct nfs_open_context
*ctx
, int);
1053 struct inode
* (*open_context
) (struct inode
*dir
,
1054 struct nfs_open_context
*ctx
,
1056 struct iattr
*iattr
);
1060 * NFS_CALL(getattr, inode, (fattr));
1062 * NFS_PROTO(inode)->getattr(fattr);
1064 #define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args
1067 * Function vectors etc. for the NFS client
1069 extern const struct nfs_rpc_ops nfs_v2_clientops
;
1070 extern const struct nfs_rpc_ops nfs_v3_clientops
;
1071 extern const struct nfs_rpc_ops nfs_v4_clientops
;
1072 extern struct rpc_version nfs_version2
;
1073 extern struct rpc_version nfs_version3
;
1074 extern struct rpc_version nfs_version4
;
1076 extern struct rpc_version nfsacl_version3
;
1077 extern struct rpc_program nfsacl_program
;