-void nfs_file_lock_destroy(struct nfs_file_lock *);
-int nfs_file_lock_conflict(struct nfs_file_lock *, struct nfs_file_lock *, int *);
-int nfs4_lock_rpc(nfsnode_t, struct nfs_open_file *, struct nfs_file_lock *, int, thread_t, kauth_cred_t);
-int nfs4_unlock_rpc(nfsnode_t, struct nfs_lock_owner *, int, uint64_t, uint64_t, vfs_context_t);
-int nfs4_getlock(nfsnode_t, struct nfs_lock_owner *, struct flock *, uint64_t, uint64_t, vfs_context_t);
-int nfs4_setlock(nfsnode_t, struct nfs_open_file *, struct nfs_lock_owner *, int, uint64_t, uint64_t, int, short, vfs_context_t);
-int nfs4_unlock(nfsnode_t, struct nfs_open_file *, struct nfs_lock_owner *, uint64_t, uint64_t, int, vfs_context_t);
-
-int nfs_mount_state_in_use_start(struct nfsmount *);
-int nfs_mount_state_in_use_end(struct nfsmount *, int);
-int nfs_mount_state_error_should_restart(int);
-uint nfs_mount_state_max_restarts(struct nfsmount *);
-int nfs_mount_state_wait_for_recovery(struct nfsmount *);
-void nfs4_recover(struct nfsmount *);
-
-int nfs_vnop_access(struct vnop_access_args *);
-
-int nfs3_vnop_open(struct vnop_open_args *);
-int nfs3_vnop_close(struct vnop_close_args *);
-
-int nfs4_vnop_create(struct vnop_create_args *);
-int nfs4_vnop_mknod(struct vnop_mknod_args *);
-int nfs4_vnop_open(struct vnop_open_args *);
-int nfs4_vnop_close(struct vnop_close_args *);
-int nfs4_vnop_mmap(struct vnop_mmap_args *);
-int nfs4_vnop_mnomap(struct vnop_mnomap_args *);
-int nfs4_vnop_getattr(struct vnop_getattr_args *);
-int nfs4_vnop_read(struct vnop_read_args *);
-int nfs4_vnop_link(struct vnop_link_args *);
-int nfs4_vnop_mkdir(struct vnop_mkdir_args *);
-int nfs4_vnop_rmdir(struct vnop_rmdir_args *);
-int nfs4_vnop_symlink(struct vnop_symlink_args *);
-int nfs4_vnop_advlock(struct vnop_advlock_args *ap);
-
-int nfs_read_rpc(nfsnode_t, uio_t, vfs_context_t);
-int nfs_write_rpc(nfsnode_t, uio_t, vfs_context_t, int *, uint64_t *);
-int nfs_write_rpc2(nfsnode_t, uio_t, thread_t, kauth_cred_t, int *, uint64_t *);
-
-int nfs3_access_rpc(nfsnode_t, u_int32_t *, vfs_context_t);
-int nfs4_access_rpc(nfsnode_t, u_int32_t *, vfs_context_t);
-int nfs3_getattr_rpc(nfsnode_t, mount_t, u_char *, size_t, vfs_context_t, struct nfs_vattr *, u_int64_t *);
-int nfs4_getattr_rpc(nfsnode_t, mount_t, u_char *, size_t, vfs_context_t, struct nfs_vattr *, u_int64_t *);
-int nfs3_setattr_rpc(nfsnode_t, struct vnode_attr *, vfs_context_t);
-int nfs4_setattr_rpc(nfsnode_t, struct vnode_attr *, vfs_context_t);
-int nfs3_read_rpc_async(nfsnode_t, off_t, size_t, thread_t, kauth_cred_t, struct nfsreq_cbinfo *, struct nfsreq **);
-int nfs4_read_rpc_async(nfsnode_t, off_t, size_t, thread_t, kauth_cred_t, struct nfsreq_cbinfo *, struct nfsreq **);
-int nfs3_read_rpc_async_finish(nfsnode_t, struct nfsreq *, uio_t, size_t *, int *);
-int nfs4_read_rpc_async_finish(nfsnode_t, struct nfsreq *, uio_t, size_t *, int *);
-int nfs3_write_rpc_async(nfsnode_t, uio_t, size_t, thread_t, kauth_cred_t, int, struct nfsreq_cbinfo *, struct nfsreq **);
-int nfs4_write_rpc_async(nfsnode_t, uio_t, size_t, thread_t, kauth_cred_t, int, struct nfsreq_cbinfo *, struct nfsreq **);
-int nfs3_write_rpc_async_finish(nfsnode_t, struct nfsreq *, int *, size_t *, uint64_t *);
-int nfs4_write_rpc_async_finish(nfsnode_t, struct nfsreq *, int *, size_t *, uint64_t *);
-int nfs3_readdir_rpc(nfsnode_t, struct nfsbuf *, vfs_context_t);
-int nfs4_readdir_rpc(nfsnode_t, struct nfsbuf *, vfs_context_t);
-int nfs3_readlink_rpc(nfsnode_t, char *, uint32_t *, vfs_context_t);
-int nfs4_readlink_rpc(nfsnode_t, char *, uint32_t *, vfs_context_t);
-int nfs3_commit_rpc(nfsnode_t, u_int64_t, u_int64_t, kauth_cred_t);
-int nfs4_commit_rpc(nfsnode_t, u_int64_t, u_int64_t, kauth_cred_t);
-int nfs3_lookup_rpc_async(nfsnode_t, char *, int, vfs_context_t, struct nfsreq **);
-int nfs4_lookup_rpc_async(nfsnode_t, char *, int, vfs_context_t, struct nfsreq **);
-int nfs3_lookup_rpc_async_finish(nfsnode_t, vfs_context_t, struct nfsreq *, u_int64_t *, fhandle_t *, struct nfs_vattr *);
-int nfs4_lookup_rpc_async_finish(nfsnode_t, vfs_context_t, struct nfsreq *, u_int64_t *, fhandle_t *, struct nfs_vattr *);
-int nfs3_remove_rpc(nfsnode_t, char *, int, thread_t, kauth_cred_t);
-int nfs4_remove_rpc(nfsnode_t, char *, int, thread_t, kauth_cred_t);
-int nfs3_rename_rpc(nfsnode_t, char *, int, nfsnode_t, char *, int, vfs_context_t);
-int nfs4_rename_rpc(nfsnode_t, char *, int, nfsnode_t, char *, int, vfs_context_t);
-int nfs3_pathconf_rpc(nfsnode_t, struct nfs_fsattr *, vfs_context_t);
-int nfs4_pathconf_rpc(nfsnode_t, struct nfs_fsattr *, vfs_context_t);
-
-void nfsrv_active_user_list_reclaim(void);
-void nfsrv_cleancache(void);
-void nfsrv_cleanup(void);
-int nfsrv_credcheck(struct nfsrv_descript *, vfs_context_t, struct nfs_export *,
- struct nfs_export_options *);
-void nfsrv_deadsock_timer(void *, void *);
-int nfsrv_dorec(struct nfsrv_sock *, struct nfsd *, struct nfsrv_descript **);
-int nfsrv_errmap(struct nfsrv_descript *, int);
-int nfsrv_export(struct user_nfs_export_args *, vfs_context_t);
-int nfsrv_fhmatch(struct nfs_filehandle *, struct nfs_filehandle *);
-int nfsrv_fhtovp(struct nfs_filehandle *, struct nfsrv_descript *, vnode_t *,
- struct nfs_export **, struct nfs_export_options **);
+void nfs_file_lock_destroy(struct nfs_file_lock *);
+int nfs_file_lock_conflict(struct nfs_file_lock *, struct nfs_file_lock *, int *);
+int nfs_unlock_rpc(nfsnode_t, struct nfs_lock_owner *, int, uint64_t, uint64_t, thread_t, kauth_cred_t, int);
+int nfs_advlock_getlock(nfsnode_t, struct nfs_lock_owner *, struct flock *, uint64_t, uint64_t, vfs_context_t);
+int nfs_advlock_setlock(nfsnode_t, struct nfs_open_file *, struct nfs_lock_owner *, int, uint64_t, uint64_t, int, short, vfs_context_t);
+int nfs_advlock_unlock(nfsnode_t, struct nfs_open_file *, struct nfs_lock_owner *, uint64_t, uint64_t, int, vfs_context_t);
+
+#if CONFIG_NFS4
+int nfs4_create_rpc(vfs_context_t, nfsnode_t, struct componentname *, struct vnode_attr *, int, char *, nfsnode_t *);
+int nfs4_open(nfsnode_t, struct nfs_open_file *, uint32_t, uint32_t, vfs_context_t);
+int nfs4_open_delegated(nfsnode_t, struct nfs_open_file *, uint32_t, uint32_t, vfs_context_t);
+int nfs4_reopen(struct nfs_open_file *, thread_t);
+int nfs4_open_rpc(struct nfs_open_file *, vfs_context_t, struct componentname *, struct vnode_attr *, vnode_t, vnode_t *, int, int, int);
+int nfs4_open_rpc_internal(struct nfs_open_file *, vfs_context_t, thread_t, kauth_cred_t, struct componentname *, struct vnode_attr *, vnode_t, vnode_t *, int, int, int);
+int nfs4_open_confirm_rpc(struct nfsmount *, nfsnode_t, u_char *, int, struct nfs_open_owner *, nfs_stateid *, thread_t, kauth_cred_t, struct nfs_vattr *, uint64_t *);
+int nfs4_open_reopen_rpc(struct nfs_open_file *, thread_t, kauth_cred_t, struct componentname *, vnode_t, vnode_t *, int, int);
+int nfs4_open_reclaim_rpc(struct nfs_open_file *, int, int);
+int nfs4_claim_delegated_open_rpc(struct nfs_open_file *, int, int, int);
+int nfs4_claim_delegated_state_for_open_file(struct nfs_open_file *, int);
+int nfs4_claim_delegated_state_for_node(nfsnode_t, int);
+int nfs4_open_downgrade_rpc(nfsnode_t, struct nfs_open_file *, vfs_context_t);
+int nfs4_close_rpc(nfsnode_t, struct nfs_open_file *, thread_t, kauth_cred_t, int);
+void nfs4_delegation_return_enqueue(nfsnode_t);
+int nfs4_delegation_return(nfsnode_t, int, thread_t, kauth_cred_t);
+int nfs4_lock_rpc(nfsnode_t, struct nfs_open_file *, struct nfs_file_lock *, int, int, thread_t, kauth_cred_t);
+int nfs4_delegreturn_rpc(struct nfsmount *, u_char *, int, struct nfs_stateid *, int, thread_t, kauth_cred_t);
+
+nfsnode_t nfs4_named_attr_dir_get(nfsnode_t, int, vfs_context_t);
+int nfs4_named_attr_get(nfsnode_t, struct componentname *, uint32_t, int, vfs_context_t, nfsnode_t *, struct nfs_open_file **);
+int nfs4_named_attr_remove(nfsnode_t, nfsnode_t, const char *, vfs_context_t);
+#endif
+
+int nfs_mount_state_in_use_start(struct nfsmount *, thread_t);
+int nfs_mount_state_in_use_end(struct nfsmount *, int);
+int nfs_mount_state_error_should_restart(int);
+int nfs_mount_state_error_delegation_lost(int);
+uint nfs_mount_state_max_restarts(struct nfsmount *);
+int nfs_mount_state_wait_for_recovery(struct nfsmount *);
+void nfs_need_recover(struct nfsmount *nmp, int error);
+void nfs_recover(struct nfsmount *);
+
+int nfs_vnop_access(struct vnop_access_args *);
+int nfs_vnop_remove(struct vnop_remove_args *);
+int nfs_vnop_read(struct vnop_read_args *);
+int nfs_vnop_write(struct vnop_write_args *);
+int nfs_vnop_open(struct vnop_open_args *);
+int nfs_vnop_close(struct vnop_close_args *);
+int nfs_vnop_advlock(struct vnop_advlock_args *);
+int nfs_vnop_mmap(struct vnop_mmap_args *);
+int nfs_vnop_mnomap(struct vnop_mnomap_args *);
+
+#if CONFIG_NFS4
+int nfs4_vnop_create(struct vnop_create_args *);
+int nfs4_vnop_mknod(struct vnop_mknod_args *);
+int nfs4_vnop_close(struct vnop_close_args *);
+int nfs4_vnop_getattr(struct vnop_getattr_args *);
+int nfs4_vnop_link(struct vnop_link_args *);
+int nfs4_vnop_mkdir(struct vnop_mkdir_args *);
+int nfs4_vnop_rmdir(struct vnop_rmdir_args *);
+int nfs4_vnop_symlink(struct vnop_symlink_args *);
+int nfs4_vnop_getxattr(struct vnop_getxattr_args *);
+int nfs4_vnop_setxattr(struct vnop_setxattr_args *);
+int nfs4_vnop_removexattr(struct vnop_removexattr_args *);
+int nfs4_vnop_listxattr(struct vnop_listxattr_args *);
+#if NAMEDSTREAMS
+int nfs4_vnop_getnamedstream(struct vnop_getnamedstream_args *);
+int nfs4_vnop_makenamedstream(struct vnop_makenamedstream_args *);
+int nfs4_vnop_removenamedstream(struct vnop_removenamedstream_args *);
+#endif
+
+int nfs4_access_rpc(nfsnode_t, u_int32_t *, int, vfs_context_t);
+int nfs4_getattr_rpc(nfsnode_t, mount_t, u_char *, size_t, int, vfs_context_t, struct nfs_vattr *, u_int64_t *);
+int nfs4_setattr_rpc(nfsnode_t, struct vnode_attr *, vfs_context_t);
+int nfs4_read_rpc_async(nfsnode_t, off_t, size_t, thread_t, kauth_cred_t, struct nfsreq_cbinfo *, struct nfsreq **);
+int nfs4_read_rpc_async_finish(nfsnode_t, struct nfsreq *, uio_t, size_t *, int *);
+int nfs4_write_rpc_async(nfsnode_t, uio_t, size_t, thread_t, kauth_cred_t, int, struct nfsreq_cbinfo *, struct nfsreq **);
+int nfs4_write_rpc_async_finish(nfsnode_t, struct nfsreq *, int *, size_t *, uint64_t *);
+int nfs4_readdir_rpc(nfsnode_t, struct nfsbuf *, vfs_context_t);
+int nfs4_readlink_rpc(nfsnode_t, char *, uint32_t *, vfs_context_t);
+int nfs4_commit_rpc(nfsnode_t, uint64_t, uint64_t, kauth_cred_t, uint64_t);
+int nfs4_lookup_rpc_async(nfsnode_t, char *, int, vfs_context_t, struct nfsreq **);
+int nfs4_lookup_rpc_async_finish(nfsnode_t, char *, int, vfs_context_t, struct nfsreq *, u_int64_t *, fhandle_t *, struct nfs_vattr *);
+int nfs4_remove_rpc(nfsnode_t, char *, int, thread_t, kauth_cred_t);
+int nfs4_rename_rpc(nfsnode_t, char *, int, nfsnode_t, char *, int, vfs_context_t);
+int nfs4_pathconf_rpc(nfsnode_t, struct nfs_fsattr *, vfs_context_t);
+int nfs4_setlock_rpc(nfsnode_t, struct nfs_open_file *, struct nfs_file_lock *, int, int, thread_t, kauth_cred_t);
+int nfs4_unlock_rpc(nfsnode_t, struct nfs_lock_owner *, int, uint64_t, uint64_t, int, thread_t, kauth_cred_t);
+int nfs4_getlock_rpc(nfsnode_t, struct nfs_lock_owner *, struct flock *, uint64_t, uint64_t, vfs_context_t);
+#endif
+
+int nfs_read_rpc(nfsnode_t, uio_t, vfs_context_t);
+int nfs_write_rpc(nfsnode_t, uio_t, vfs_context_t, int *, uint64_t *);
+int nfs_write_rpc2(nfsnode_t, uio_t, thread_t, kauth_cred_t, int *, uint64_t *);
+
+int nfs3_access_rpc(nfsnode_t, u_int32_t *, int, vfs_context_t);
+int nfs3_getattr_rpc(nfsnode_t, mount_t, u_char *, size_t, int, vfs_context_t, struct nfs_vattr *, u_int64_t *);
+int nfs3_setattr_rpc(nfsnode_t, struct vnode_attr *, vfs_context_t);
+int nfs3_read_rpc_async(nfsnode_t, off_t, size_t, thread_t, kauth_cred_t, struct nfsreq_cbinfo *, struct nfsreq **);
+int nfs3_read_rpc_async_finish(nfsnode_t, struct nfsreq *, uio_t, size_t *, int *);
+int nfs3_write_rpc_async(nfsnode_t, uio_t, size_t, thread_t, kauth_cred_t, int, struct nfsreq_cbinfo *, struct nfsreq **);
+int nfs3_write_rpc_async_finish(nfsnode_t, struct nfsreq *, int *, size_t *, uint64_t *);
+int nfs3_readdir_rpc(nfsnode_t, struct nfsbuf *, vfs_context_t);
+int nfs3_readlink_rpc(nfsnode_t, char *, uint32_t *, vfs_context_t);
+int nfs3_commit_rpc(nfsnode_t, uint64_t, uint64_t, kauth_cred_t, uint64_t);
+int nfs3_lookup_rpc_async(nfsnode_t, char *, int, vfs_context_t, struct nfsreq **);
+int nfs3_lookup_rpc_async_finish(nfsnode_t, char *, int, vfs_context_t, struct nfsreq *, u_int64_t *, fhandle_t *, struct nfs_vattr *);
+int nfs3_remove_rpc(nfsnode_t, char *, int, thread_t, kauth_cred_t);
+int nfs3_rename_rpc(nfsnode_t, char *, int, nfsnode_t, char *, int, vfs_context_t);
+int nfs3_pathconf_rpc(nfsnode_t, struct nfs_fsattr *, vfs_context_t);
+int nfs3_setlock_rpc(nfsnode_t, struct nfs_open_file *, struct nfs_file_lock *, int, int, thread_t, kauth_cred_t);
+int nfs3_unlock_rpc(nfsnode_t, struct nfs_lock_owner *, int, uint64_t, uint64_t, int, thread_t, kauth_cred_t);
+int nfs3_getlock_rpc(nfsnode_t, struct nfs_lock_owner *, struct flock *, uint64_t, uint64_t, vfs_context_t);
+
+void nfsrv_active_user_list_reclaim(void);
+void nfsrv_cleancache(void);
+void nfsrv_cleanup(void);
+int nfsrv_credcheck(struct nfsrv_descript *, vfs_context_t, struct nfs_export *,
+ struct nfs_export_options *);
+void nfsrv_idlesock_timer(void *, void *);
+int nfsrv_dorec(struct nfsrv_sock *, struct nfsd *, struct nfsrv_descript **);
+int nfsrv_errmap(struct nfsrv_descript *, int);
+int nfsrv_export(struct user_nfs_export_args *, vfs_context_t);
+int nfsrv_fhmatch(struct nfs_filehandle *, struct nfs_filehandle *);
+int nfsrv_fhtovp(struct nfs_filehandle *, struct nfsrv_descript *, vnode_t *,
+ struct nfs_export **, struct nfs_export_options **);
+int nfsrv_check_exports_allow_address(mbuf_t);