+
+/*
+ * NFS mount file system attributes
+ */
+struct nfs_fsattr {
+ uint32_t nfsa_flags; /* file system flags */
+ uint32_t nfsa_lease; /* lease time in seconds */
+ uint32_t nfsa_maxname; /* maximum filename size */
+ uint32_t nfsa_maxlink; /* maximum # links */
+ uint32_t nfsa_bsize; /* block size */
+ uint32_t nfsa_pad; /* UNUSED */
+ uint64_t nfsa_maxfilesize; /* maximum file size */
+ uint64_t nfsa_maxread; /* maximum read size */
+ uint64_t nfsa_maxwrite; /* maximum write size */
+ uint64_t nfsa_files_avail; /* file slots available */
+ uint64_t nfsa_files_free; /* file slots free */
+ uint64_t nfsa_files_total; /* file slots total */
+ uint64_t nfsa_space_avail; /* disk space available */
+ uint64_t nfsa_space_free; /* disk space free */
+ uint64_t nfsa_space_total; /* disk space total */
+ uint32_t nfsa_supp_attr[NFS_ATTR_BITMAP_LEN]; /* attributes supported on this file system */
+ uint32_t nfsa_bitmap[NFS_ATTR_BITMAP_LEN]; /* valid attributes */
+};
+#define NFS_FSFLAG_LINK 0x00000001
+#define NFS_FSFLAG_SYMLINK 0x00000002
+#define NFS_FSFLAG_UNIQUE_FH 0x00000004
+#define NFS_FSFLAG_ACL 0x00000008
+#define NFS_FSFLAG_SET_TIME 0x00000010
+#define NFS_FSFLAG_CASE_INSENSITIVE 0x00000020
+#define NFS_FSFLAG_CASE_PRESERVING 0x00000040
+#define NFS_FSFLAG_CHOWN_RESTRICTED 0x00000080
+#define NFS_FSFLAG_HOMOGENEOUS 0x00000100
+#define NFS_FSFLAG_NO_TRUNC 0x00000200
+#define NFS_FSFLAG_FHTYPE_MASK 0xFF000000
+#define NFS_FSFLAG_FHTYPE_SHIFT 24
+
+/*
+ * function table for calling version-specific NFS functions
+ */
+struct nfs_funcs {
+ int (*nf_mount)(struct nfsmount *, vfs_context_t, struct user_nfs_args *, nfsnode_t *);
+ int (*nf_update_statfs)(struct nfsmount *, vfs_context_t);
+ int (*nf_getquota)(struct nfsmount *, vfs_context_t, uid_t, int, struct dqblk *);
+ int (*nf_access_rpc)(nfsnode_t, u_int32_t *, vfs_context_t);
+ int (*nf_getattr_rpc)(nfsnode_t, mount_t, u_char *, size_t, vfs_context_t, struct nfs_vattr *, u_int64_t *);
+ int (*nf_setattr_rpc)(nfsnode_t, struct vnode_attr *, vfs_context_t);
+ int (*nf_read_rpc_async)(nfsnode_t, off_t, size_t, thread_t, kauth_cred_t, struct nfsreq_cbinfo *, struct nfsreq **);
+ int (*nf_read_rpc_async_finish)(nfsnode_t, struct nfsreq *, uio_t, size_t *, int *);
+ int (*nf_readlink_rpc)(nfsnode_t, char *, uint32_t *, vfs_context_t);
+ int (*nf_write_rpc_async)(nfsnode_t, uio_t, size_t, thread_t, kauth_cred_t, int, struct nfsreq_cbinfo *, struct nfsreq **);
+ int (*nf_write_rpc_async_finish)(nfsnode_t, struct nfsreq *, int *, size_t *, uint64_t *);
+ int (*nf_commit_rpc)(nfsnode_t, uint64_t, uint64_t, kauth_cred_t);
+ int (*nf_lookup_rpc_async)(nfsnode_t, char *, int, vfs_context_t, struct nfsreq **);
+ int (*nf_lookup_rpc_async_finish)(nfsnode_t, vfs_context_t, struct nfsreq *, u_int64_t *, fhandle_t *, struct nfs_vattr *);
+ int (*nf_remove_rpc)(nfsnode_t, char *, int, thread_t, kauth_cred_t);
+ int (*nf_rename_rpc)(nfsnode_t, char *, int, nfsnode_t, char *, int, vfs_context_t);
+};
+
+/*
+ * The long form of the NFSv4 client ID.
+ */
+struct nfs_client_id {
+ TAILQ_ENTRY(nfs_client_id) nci_link; /* list of client IDs */
+ char *nci_id; /* client id buffer */
+ int nci_idlen; /* length of client id buffer */
+};
+TAILQ_HEAD(nfsclientidlist, nfs_client_id);
+__private_extern__ struct nfsclientidlist nfsclientids;
+