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 */
120 struct nfs_fattr
*fattr
; /* Post-op attributes */
121 __u64 tbytes
; /* total size in bytes */
122 __u64 fbytes
; /* # of free bytes */
123 __u64 abytes
; /* # of bytes available to user */
124 __u64 tfiles
; /* # of files */
125 __u64 ffiles
; /* # of free files */
126 __u64 afiles
; /* # of files available to user */
130 __u32 tsize
; /* Server transfer size */
131 __u32 bsize
; /* Filesystem block size */
132 __u32 blocks
; /* No. of "bsize" blocks on filesystem */
133 __u32 bfree
; /* No. of free "bsize" blocks */
134 __u32 bavail
; /* No. of available "bsize" blocks */
137 struct nfs_pathconf
{
138 struct nfs_fattr
*fattr
; /* Post-op attributes */
139 __u32 max_link
; /* max # of hard links */
140 __u32 max_namelen
; /* max name length */
143 struct nfs4_change_info
{
151 /* nfs41 sessions channel attributes */
152 struct nfs4_channel_attrs
{
156 u32 max_resp_sz_cached
;
161 /* nfs41 sessions slot seqid */
166 struct nfs4_sequence_args
{
167 struct nfs4_session
*sa_session
;
172 struct nfs4_sequence_res
{
173 struct nfs4_session
*sr_session
;
174 struct nfs4_slot
*sr_slot
; /* slot used to send request */
175 int sr_status
; /* sequence operation status */
176 unsigned long sr_renewal_time
;
180 struct nfs4_get_lease_time_args
{
181 struct nfs4_sequence_args la_seq_args
;
184 struct nfs4_get_lease_time_res
{
185 struct nfs_fsinfo
*lr_fsinfo
;
186 struct nfs4_sequence_res lr_seq_res
;
190 * Arguments to the open call.
192 struct nfs_openargs
{
193 const struct nfs_fh
* fh
;
194 struct nfs_seqid
* seqid
;
201 struct iattr
* attrs
; /* UNCHECKED, GUARDED */
202 nfs4_verifier verifier
; /* EXCLUSIVE */
204 nfs4_stateid delegation
; /* CLAIM_DELEGATE_CUR */
205 fmode_t delegation_type
; /* CLAIM_PREVIOUS */
207 const struct qstr
* name
;
208 const struct nfs_server
*server
; /* Needed for ID mapping */
211 struct nfs4_sequence_args seq_args
;
215 nfs4_stateid stateid
;
217 struct nfs4_change_info cinfo
;
219 struct nfs_fattr
* f_attr
;
220 struct nfs_fattr
* dir_attr
;
221 struct nfs_seqid
* seqid
;
222 const struct nfs_server
*server
;
223 fmode_t delegation_type
;
224 nfs4_stateid delegation
;
227 __u32 attrset
[NFS4_BITMAP_SIZE
];
228 struct nfs4_sequence_res seq_res
;
232 * Arguments to the open_confirm call.
234 struct nfs_open_confirmargs
{
235 const struct nfs_fh
* fh
;
236 nfs4_stateid
* stateid
;
237 struct nfs_seqid
* seqid
;
240 struct nfs_open_confirmres
{
241 nfs4_stateid stateid
;
242 struct nfs_seqid
* seqid
;
246 * Arguments to the close call.
248 struct nfs_closeargs
{
250 nfs4_stateid
* stateid
;
251 struct nfs_seqid
* seqid
;
254 struct nfs4_sequence_args seq_args
;
257 struct nfs_closeres
{
258 nfs4_stateid stateid
;
259 struct nfs_fattr
* fattr
;
260 struct nfs_seqid
* seqid
;
261 const struct nfs_server
*server
;
262 struct nfs4_sequence_res seq_res
;
265 * * Arguments to the lock,lockt, and locku call.
272 struct nfs_lock_args
{
274 struct file_lock
* fl
;
275 struct nfs_seqid
* lock_seqid
;
276 nfs4_stateid
* lock_stateid
;
277 struct nfs_seqid
* open_seqid
;
278 nfs4_stateid
* open_stateid
;
279 struct nfs_lowner lock_owner
;
280 unsigned char block
: 1;
281 unsigned char reclaim
: 1;
282 unsigned char new_lock_owner
: 1;
283 struct nfs4_sequence_args seq_args
;
286 struct nfs_lock_res
{
287 nfs4_stateid stateid
;
288 struct nfs_seqid
* lock_seqid
;
289 struct nfs_seqid
* open_seqid
;
290 struct nfs4_sequence_res seq_res
;
293 struct nfs_locku_args
{
295 struct file_lock
* fl
;
296 struct nfs_seqid
* seqid
;
297 nfs4_stateid
* stateid
;
298 struct nfs4_sequence_args seq_args
;
301 struct nfs_locku_res
{
302 nfs4_stateid stateid
;
303 struct nfs_seqid
* seqid
;
304 struct nfs4_sequence_res seq_res
;
307 struct nfs_lockt_args
{
309 struct file_lock
* fl
;
310 struct nfs_lowner lock_owner
;
311 struct nfs4_sequence_args seq_args
;
314 struct nfs_lockt_res
{
315 struct file_lock
* denied
; /* LOCK, LOCKT failed */
316 struct nfs4_sequence_res seq_res
;
319 struct nfs_release_lockowner_args
{
320 struct nfs_lowner lock_owner
;
323 struct nfs4_delegreturnargs
{
324 const struct nfs_fh
*fhandle
;
325 const nfs4_stateid
*stateid
;
327 struct nfs4_sequence_args seq_args
;
330 struct nfs4_delegreturnres
{
331 struct nfs_fattr
* fattr
;
332 const struct nfs_server
*server
;
333 struct nfs4_sequence_res seq_res
;
337 * Arguments to the read call.
339 struct nfs_readargs
{
341 struct nfs_open_context
*context
;
342 struct nfs_lock_context
*lock_context
;
346 struct page
** pages
;
347 struct nfs4_sequence_args seq_args
;
351 struct nfs_fattr
* fattr
;
354 struct nfs4_sequence_res seq_res
;
358 * Arguments to the write call.
360 struct nfs_writeargs
{
362 struct nfs_open_context
*context
;
363 struct nfs_lock_context
*lock_context
;
366 enum nfs3_stable_how stable
;
368 struct page
** pages
;
370 struct nfs4_sequence_args seq_args
;
373 struct nfs_writeverf
{
374 enum nfs3_stable_how committed
;
378 struct nfs_writeres
{
379 struct nfs_fattr
* fattr
;
380 struct nfs_writeverf
* verf
;
382 const struct nfs_server
*server
;
383 struct nfs4_sequence_res seq_res
;
387 * Common arguments to the unlink call
389 struct nfs_removeargs
{
390 const struct nfs_fh
*fh
;
393 struct nfs4_sequence_args seq_args
;
396 struct nfs_removeres
{
397 const struct nfs_server
*server
;
398 struct nfs_fattr
*dir_attr
;
399 struct nfs4_change_info cinfo
;
400 struct nfs4_sequence_res seq_res
;
404 * Common arguments to the rename call
406 struct nfs_renameargs
{
407 const struct nfs_fh
*old_dir
;
408 const struct nfs_fh
*new_dir
;
409 const struct qstr
*old_name
;
410 const struct qstr
*new_name
;
412 struct nfs4_sequence_args seq_args
;
415 struct nfs_renameres
{
416 const struct nfs_server
*server
;
417 struct nfs4_change_info old_cinfo
;
418 struct nfs_fattr
*old_fattr
;
419 struct nfs4_change_info new_cinfo
;
420 struct nfs_fattr
*new_fattr
;
421 struct nfs4_sequence_res seq_res
;
425 * Argument struct for decode_entry function
435 struct nfs_fattr
* fattr
;
439 * The following types are for NFSv2 only.
441 struct nfs_sattrargs
{
443 struct iattr
* sattr
;
446 struct nfs_diropargs
{
452 struct nfs_createargs
{
456 struct iattr
* sattr
;
459 struct nfs_setattrargs
{
461 nfs4_stateid stateid
;
463 const struct nfs_server
* server
; /* Needed for name mapping */
465 struct nfs4_sequence_args seq_args
;
468 struct nfs_setaclargs
{
471 unsigned int acl_pgbase
;
472 struct page
** acl_pages
;
473 struct nfs4_sequence_args seq_args
;
476 struct nfs_setaclres
{
477 struct nfs4_sequence_res seq_res
;
480 struct nfs_getaclargs
{
483 unsigned int acl_pgbase
;
484 struct page
** acl_pages
;
485 struct nfs4_sequence_args seq_args
;
488 struct nfs_getaclres
{
490 struct nfs4_sequence_res seq_res
;
493 struct nfs_setattrres
{
494 struct nfs_fattr
* fattr
;
495 const struct nfs_server
* server
;
496 struct nfs4_sequence_res seq_res
;
499 struct nfs_linkargs
{
500 struct nfs_fh
* fromfh
;
501 struct nfs_fh
* tofh
;
506 struct nfs_symlinkargs
{
507 struct nfs_fh
* fromfh
;
508 const char * fromname
;
509 unsigned int fromlen
;
510 struct page
** pages
;
511 unsigned int pathlen
;
512 struct iattr
* sattr
;
515 struct nfs_readdirargs
{
519 struct page
** pages
;
522 struct nfs3_getaclargs
{
525 struct page
** pages
;
528 struct nfs3_setaclargs
{
529 struct inode
* inode
;
531 struct posix_acl
* acl_access
;
532 struct posix_acl
* acl_default
;
535 struct page
** pages
;
540 struct nfs_fattr
* fattr
;
543 struct nfs_readlinkargs
{
547 struct page
** pages
;
550 struct nfs3_sattrargs
{
552 struct iattr
* sattr
;
554 struct timespec guardtime
;
557 struct nfs3_diropargs
{
563 struct nfs3_accessargs
{
568 struct nfs3_createargs
{
572 struct iattr
* sattr
;
573 enum nfs3_createmode createmode
;
577 struct nfs3_mkdirargs
{
581 struct iattr
* sattr
;
584 struct nfs3_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 nfs3_mknodargs
{
597 enum nfs3_ftype type
;
598 struct iattr
* sattr
;
602 struct nfs3_linkargs
{
603 struct nfs_fh
* fromfh
;
604 struct nfs_fh
* tofh
;
609 struct nfs3_readdirargs
{
615 struct page
** pages
;
618 struct nfs3_diropres
{
619 struct nfs_fattr
* dir_attr
;
621 struct nfs_fattr
* fattr
;
624 struct nfs3_accessres
{
625 struct nfs_fattr
* fattr
;
629 struct nfs3_readlinkargs
{
633 struct page
** pages
;
636 struct nfs3_linkres
{
637 struct nfs_fattr
* dir_attr
;
638 struct nfs_fattr
* fattr
;
641 struct nfs3_readdirres
{
642 struct nfs_fattr
* dir_attr
;
647 struct nfs3_getaclres
{
648 struct nfs_fattr
* fattr
;
650 unsigned int acl_access_count
;
651 unsigned int acl_default_count
;
652 struct posix_acl
* acl_access
;
653 struct posix_acl
* acl_default
;
658 typedef u64 clientid4
;
660 struct nfs4_accessargs
{
661 const struct nfs_fh
* fh
;
664 struct nfs4_sequence_args seq_args
;
667 struct nfs4_accessres
{
668 const struct nfs_server
* server
;
669 struct nfs_fattr
* fattr
;
672 struct nfs4_sequence_res seq_res
;
675 struct nfs4_create_arg
{
679 struct page
** pages
;
681 } symlink
; /* NF4LNK */
685 } device
; /* NF4BLK, NF4CHR */
687 const struct qstr
* name
;
688 const struct nfs_server
* server
;
689 const struct iattr
* attrs
;
690 const struct nfs_fh
* dir_fh
;
692 struct nfs4_sequence_args seq_args
;
695 struct nfs4_create_res
{
696 const struct nfs_server
* server
;
698 struct nfs_fattr
* fattr
;
699 struct nfs4_change_info dir_cinfo
;
700 struct nfs_fattr
* dir_fattr
;
701 struct nfs4_sequence_res seq_res
;
704 struct nfs4_fsinfo_arg
{
705 const struct nfs_fh
* fh
;
707 struct nfs4_sequence_args seq_args
;
710 struct nfs4_fsinfo_res
{
711 struct nfs_fsinfo
*fsinfo
;
712 struct nfs4_sequence_res seq_res
;
715 struct nfs4_getattr_arg
{
716 const struct nfs_fh
* fh
;
718 struct nfs4_sequence_args seq_args
;
721 struct nfs4_getattr_res
{
722 const struct nfs_server
* server
;
723 struct nfs_fattr
* fattr
;
724 struct nfs4_sequence_res seq_res
;
727 struct nfs4_link_arg
{
728 const struct nfs_fh
* fh
;
729 const struct nfs_fh
* dir_fh
;
730 const struct qstr
* name
;
732 struct nfs4_sequence_args seq_args
;
735 struct nfs4_link_res
{
736 const struct nfs_server
* server
;
737 struct nfs_fattr
* fattr
;
738 struct nfs4_change_info cinfo
;
739 struct nfs_fattr
* dir_attr
;
740 struct nfs4_sequence_res seq_res
;
744 struct nfs4_lookup_arg
{
745 const struct nfs_fh
* dir_fh
;
746 const struct qstr
* name
;
748 struct nfs4_sequence_args seq_args
;
751 struct nfs4_lookup_res
{
752 const struct nfs_server
* server
;
753 struct nfs_fattr
* fattr
;
755 struct nfs4_sequence_res seq_res
;
758 struct nfs4_lookup_root_arg
{
760 struct nfs4_sequence_args seq_args
;
763 struct nfs4_pathconf_arg
{
764 const struct nfs_fh
* fh
;
766 struct nfs4_sequence_args seq_args
;
769 struct nfs4_pathconf_res
{
770 struct nfs_pathconf
*pathconf
;
771 struct nfs4_sequence_res seq_res
;
774 struct nfs4_readdir_arg
{
775 const struct nfs_fh
* fh
;
777 nfs4_verifier verifier
;
779 struct page
** pages
; /* zero-copy data */
780 unsigned int pgbase
; /* zero-copy data */
783 struct nfs4_sequence_args seq_args
;
786 struct nfs4_readdir_res
{
787 nfs4_verifier verifier
;
789 struct nfs4_sequence_res seq_res
;
792 struct nfs4_readlink
{
793 const struct nfs_fh
* fh
;
795 unsigned int pglen
; /* zero-copy data */
796 struct page
** pages
; /* zero-copy data */
797 struct nfs4_sequence_args seq_args
;
800 struct nfs4_readlink_res
{
801 struct nfs4_sequence_res seq_res
;
804 #define NFS4_SETCLIENTID_NAMELEN (127)
805 struct nfs4_setclientid
{
806 const nfs4_verifier
* sc_verifier
;
807 unsigned int sc_name_len
;
808 char sc_name
[NFS4_SETCLIENTID_NAMELEN
+ 1];
810 unsigned int sc_netid_len
;
811 char sc_netid
[RPCBIND_MAXNETIDLEN
+ 1];
812 unsigned int sc_uaddr_len
;
813 char sc_uaddr
[RPCBIND_MAXUADDRLEN
+ 1];
817 struct nfs4_setclientid_res
{
819 nfs4_verifier confirm
;
822 struct nfs4_statfs_arg
{
823 const struct nfs_fh
* fh
;
825 struct nfs4_sequence_args seq_args
;
828 struct nfs4_statfs_res
{
829 struct nfs_fsstat
*fsstat
;
830 struct nfs4_sequence_res seq_res
;
833 struct nfs4_server_caps_arg
{
834 struct nfs_fh
*fhandle
;
835 struct nfs4_sequence_args seq_args
;
838 struct nfs4_server_caps_res
{
843 struct nfs4_sequence_res seq_res
;
851 #define NFS4_PATHNAME_MAXCOMPONENTS 512
852 struct nfs4_pathname
{
853 unsigned int ncomponents
;
854 struct nfs4_string components
[NFS4_PATHNAME_MAXCOMPONENTS
];
857 #define NFS4_FS_LOCATION_MAXSERVERS 10
858 struct nfs4_fs_location
{
859 unsigned int nservers
;
860 struct nfs4_string servers
[NFS4_FS_LOCATION_MAXSERVERS
];
861 struct nfs4_pathname rootpath
;
864 #define NFS4_FS_LOCATIONS_MAXENTRIES 10
865 struct nfs4_fs_locations
{
866 struct nfs_fattr fattr
;
867 const struct nfs_server
*server
;
868 struct nfs4_pathname fs_path
;
870 struct nfs4_fs_location locations
[NFS4_FS_LOCATIONS_MAXENTRIES
];
873 struct nfs4_fs_locations_arg
{
874 const struct nfs_fh
*dir_fh
;
875 const struct qstr
*name
;
878 struct nfs4_sequence_args seq_args
;
881 struct nfs4_fs_locations_res
{
882 struct nfs4_fs_locations
*fs_locations
;
883 struct nfs4_sequence_res seq_res
;
886 #endif /* CONFIG_NFS_V4 */
893 #ifdef CONFIG_NFS_V4_1
894 struct nfs_impl_id4
{
899 struct nfstime4 date
;
902 #define NFS4_EXCHANGE_ID_LEN (48)
903 struct nfs41_exchange_id_args
{
904 struct nfs_client
*client
;
905 nfs4_verifier
*verifier
;
907 char id
[NFS4_EXCHANGE_ID_LEN
];
911 struct server_owner
{
913 uint32_t major_id_sz
;
914 char major_id
[NFS4_OPAQUE_LIMIT
];
917 struct server_scope
{
918 uint32_t server_scope_sz
;
919 char server_scope
[NFS4_OPAQUE_LIMIT
];
922 struct nfs41_exchange_id_res
{
923 struct nfs_client
*client
;
927 struct nfs41_create_session_args
{
928 struct nfs_client
*client
;
931 struct nfs4_channel_attrs fc_attrs
; /* Fore Channel */
932 struct nfs4_channel_attrs bc_attrs
; /* Back Channel */
935 struct nfs41_create_session_res
{
936 struct nfs_client
*client
;
939 struct nfs41_reclaim_complete_args
{
940 /* In the future extend to include curr_fh for use with migration */
941 unsigned char one_fs
:1;
942 struct nfs4_sequence_args seq_args
;
945 struct nfs41_reclaim_complete_res
{
946 struct nfs4_sequence_res seq_res
;
948 #endif /* CONFIG_NFS_V4_1 */
952 #define NFS_PAGEVEC_SIZE (8U)
954 struct nfs_read_data
{
956 struct rpc_task task
;
958 struct rpc_cred
*cred
;
959 struct nfs_fattr fattr
; /* fattr storage */
960 struct list_head pages
; /* Coalesced read requests */
961 struct nfs_page
*req
; /* multi ops per nfs_page */
962 struct page
**pagevec
;
963 unsigned int npages
; /* Max length of pagevec */
964 struct nfs_readargs args
;
965 struct nfs_readres res
;
967 unsigned long timestamp
; /* For lease renewal */
969 struct page
*page_array
[NFS_PAGEVEC_SIZE
];
972 struct nfs_write_data
{
974 struct rpc_task task
;
976 struct rpc_cred
*cred
;
977 struct nfs_fattr fattr
;
978 struct nfs_writeverf verf
;
979 struct list_head pages
; /* Coalesced requests we wish to flush */
980 struct nfs_page
*req
; /* multi ops per nfs_page */
981 struct page
**pagevec
;
982 unsigned int npages
; /* Max length of pagevec */
983 struct nfs_writeargs args
; /* argument struct */
984 struct nfs_writeres res
; /* result struct */
986 unsigned long timestamp
; /* For lease renewal */
988 struct page
*page_array
[NFS_PAGEVEC_SIZE
];
991 struct nfs_access_entry
;
994 * RPC procedure vector for NFSv2/NFSv3 demuxing
997 u32 version
; /* Protocol version */
998 const struct dentry_operations
*dentry_ops
;
999 const struct inode_operations
*dir_inode_ops
;
1000 const struct inode_operations
*file_inode_ops
;
1002 int (*getroot
) (struct nfs_server
*, struct nfs_fh
*,
1003 struct nfs_fsinfo
*);
1004 int (*lookupfh
)(struct nfs_server
*, struct nfs_fh
*,
1005 struct qstr
*, struct nfs_fh
*,
1006 struct nfs_fattr
*);
1007 int (*getattr
) (struct nfs_server
*, struct nfs_fh
*,
1008 struct nfs_fattr
*);
1009 int (*setattr
) (struct dentry
*, struct nfs_fattr
*,
1011 int (*lookup
) (struct inode
*, struct qstr
*,
1012 struct nfs_fh
*, struct nfs_fattr
*);
1013 int (*access
) (struct inode
*, struct nfs_access_entry
*);
1014 int (*readlink
)(struct inode
*, struct page
*, unsigned int,
1016 int (*create
) (struct inode
*, struct dentry
*,
1017 struct iattr
*, int, struct nfs_open_context
*);
1018 int (*remove
) (struct inode
*, struct qstr
*);
1019 void (*unlink_setup
) (struct rpc_message
*, struct inode
*dir
);
1020 int (*unlink_done
) (struct rpc_task
*, struct inode
*);
1021 int (*rename
) (struct inode
*, struct qstr
*,
1022 struct inode
*, struct qstr
*);
1023 void (*rename_setup
) (struct rpc_message
*msg
, struct inode
*dir
);
1024 int (*rename_done
) (struct rpc_task
*task
, struct inode
*old_dir
, struct inode
*new_dir
);
1025 int (*link
) (struct inode
*, struct inode
*, struct qstr
*);
1026 int (*symlink
) (struct inode
*, struct dentry
*, struct page
*,
1027 unsigned int, struct iattr
*);
1028 int (*mkdir
) (struct inode
*, struct dentry
*, struct iattr
*);
1029 int (*rmdir
) (struct inode
*, struct qstr
*);
1030 int (*readdir
) (struct dentry
*, struct rpc_cred
*,
1031 u64
, struct page
**, unsigned int, int);
1032 int (*mknod
) (struct inode
*, struct dentry
*, struct iattr
*,
1034 int (*statfs
) (struct nfs_server
*, struct nfs_fh
*,
1035 struct nfs_fsstat
*);
1036 int (*fsinfo
) (struct nfs_server
*, struct nfs_fh
*,
1037 struct nfs_fsinfo
*);
1038 int (*pathconf
) (struct nfs_server
*, struct nfs_fh
*,
1039 struct nfs_pathconf
*);
1040 int (*set_capabilities
)(struct nfs_server
*, struct nfs_fh
*);
1041 __be32
*(*decode_dirent
)(struct xdr_stream
*, struct nfs_entry
*, struct nfs_server
*, int plus
);
1042 void (*read_setup
) (struct nfs_read_data
*, struct rpc_message
*);
1043 int (*read_done
) (struct rpc_task
*, struct nfs_read_data
*);
1044 void (*write_setup
) (struct nfs_write_data
*, struct rpc_message
*);
1045 int (*write_done
) (struct rpc_task
*, struct nfs_write_data
*);
1046 void (*commit_setup
) (struct nfs_write_data
*, struct rpc_message
*);
1047 int (*commit_done
) (struct rpc_task
*, struct nfs_write_data
*);
1048 int (*lock
)(struct file
*, int, struct file_lock
*);
1049 int (*lock_check_bounds
)(const struct file_lock
*);
1050 void (*clear_acl_cache
)(struct inode
*);
1051 void (*close_context
)(struct nfs_open_context
*ctx
, int);
1052 struct inode
* (*open_context
) (struct inode
*dir
,
1053 struct nfs_open_context
*ctx
,
1055 struct iattr
*iattr
);
1059 * NFS_CALL(getattr, inode, (fattr));
1061 * NFS_PROTO(inode)->getattr(fattr);
1063 #define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args
1066 * Function vectors etc. for the NFS client
1068 extern const struct nfs_rpc_ops nfs_v2_clientops
;
1069 extern const struct nfs_rpc_ops nfs_v3_clientops
;
1070 extern const struct nfs_rpc_ops nfs_v4_clientops
;
1071 extern struct rpc_version nfs_version2
;
1072 extern struct rpc_version nfs_version3
;
1073 extern struct rpc_version nfs_version4
;
1075 extern struct rpc_version nfsacl_version3
;
1076 extern struct rpc_program nfsacl_program
;