-/* Bits for "nd_flag" */
-#define ND_READ LEASE_READ
-#define ND_WRITE LEASE_WRITE
-#define ND_CHECK 0x04
-#define ND_LEASE (ND_READ | ND_WRITE | ND_CHECK)
-#define ND_NFSV3 0x08
-#define ND_NQNFS 0x10
-#define ND_KERBNICK 0x20
-#define ND_KERBFULL 0x40
-#define ND_KERBAUTH (ND_KERBNICK | ND_KERBFULL)
-
-extern TAILQ_HEAD(nfsd_head, nfsd) nfsd_head;
-extern int nfsd_head_flag;
-#define NFSD_CHECKSLP 0x01
-
-/*
- * These macros compare nfsrv_descript structures.
- */
-#define NFSW_CONTIG(o, n) \
- ((o)->nd_eoff >= (n)->nd_off && \
- !bcmp((caddr_t)&(o)->nd_fh, (caddr_t)&(n)->nd_fh, NFSX_V3FH))
-
-#define NFSW_SAMECRED(o, n) \
- (((o)->nd_flag & ND_KERBAUTH) == ((n)->nd_flag & ND_KERBAUTH) && \
- !bcmp((caddr_t)&(o)->nd_cr, (caddr_t)&(n)->nd_cr, \
- sizeof (struct ucred)))
-
-/*
- * Defines for WebNFS
- */
-
-#define WEBNFS_ESC_CHAR '%'
-#define WEBNFS_SPECCHAR_START 0x80
-
-#define WEBNFS_NATIVE_CHAR 0x80
-/*
- * ..
- * Possibly more here in the future.
- */
-
-/*
- * Macro for converting escape characters in WebNFS pathnames.
- * Should really be in libkern.
- */
-
-#define HEXTOC(c) \
- ((c) >= 'a' ? ((c) - ('a' - 10)) : \
- ((c) >= 'A' ? ((c) - ('A' - 10)) : ((c) - '0')))
-#define HEXSTRTOI(p) \
- ((HEXTOC(p[0]) << 4) + HEXTOC(p[1]))
-
-#define NFSDIAG 0
-#if NFSDIAG
-
-extern int nfs_debug;
-#define NFS_DEBUG_ASYNCIO 1 /* asynchronous i/o */
-#define NFS_DEBUG_WG 2 /* server write gathering */
-#define NFS_DEBUG_RC 4 /* server request caching */
-#define NFS_DEBUG_SILLY 8 /* nfs_sillyrename (.nfsXXX aka turd files) */
-#define NFS_DEBUG_DUP 16 /* debug duplicate requests */
-#define NFS_DEBUG_ATTR 32
-
-#define NFS_DPF(cat, args) \
- do { \
- if (nfs_debug & NFS_DEBUG_##cat) kprintf args; \
- } while (0)
-
-#else
-
-#define NFS_DPF(cat, args)
-
-#endif /* NFSDIAG */
-
-int nfs_init __P((struct vfsconf *vfsp));
-int nfs_reply __P((struct nfsreq *));
-int nfs_getreq __P((struct nfsrv_descript *,struct nfsd *,int));
-int nfs_send __P((struct socket *, struct mbuf *, struct mbuf *,
- struct nfsreq *));
-int nfs_rephead __P((int, struct nfsrv_descript *, struct nfssvc_sock *,
- int, int, u_quad_t *, struct mbuf **, struct mbuf **,
- caddr_t *));
-int nfs_sndlock __P((int *, struct nfsreq *));
-void nfs_sndunlock __P((int *flagp));
-int nfs_disct __P((struct mbuf **, caddr_t *, int, int, caddr_t *));
-int nfs_vinvalbuf __P((struct vnode *, int, struct ucred *, struct proc *,
- int));
-int nfs_readrpc __P((struct vnode *, struct uio *, struct ucred *));
-int nfs_writerpc __P((struct vnode *, struct uio *, struct ucred *, int *,
- int *));
-int nfs_readdirrpc __P((struct vnode *, struct uio *, struct ucred *));
-int nfs_asyncio __P((struct buf *, struct ucred *));
-int nfs_doio __P((struct buf *, struct ucred *, struct proc *));
-int nfs_readlinkrpc __P((struct vnode *, struct uio *, struct ucred *));
-int nfs_sigintr __P((struct nfsmount *, struct nfsreq *, struct proc *));
-int nfs_readdirplusrpc __P((struct vnode *, struct uio *, struct ucred *));
-int nfsm_disct __P((struct mbuf **, caddr_t *, int, int, caddr_t *));
-void nfsm_srvfattr __P((struct nfsrv_descript *, struct vattr *,
- struct nfs_fattr *));
-void nfsm_srvwcc __P((struct nfsrv_descript *, int, struct vattr *, int,
- struct vattr *, struct mbuf **, char **));
-void nfsm_srvpostopattr __P((struct nfsrv_descript *, int, struct vattr *,
- struct mbuf **, char **));
-int netaddr_match __P((int, union nethostaddr *, struct mbuf *));
-int nfs_request __P((struct vnode *, struct mbuf *, int, struct proc *,
- struct ucred *, struct mbuf **, struct mbuf **,
- caddr_t *));
-int nfs_loadattrcache __P((struct vnode **, struct mbuf **, caddr_t *,
- struct vattr *));
-int nfs_namei __P((struct nameidata *, fhandle_t *, int,
- struct nfssvc_sock *, struct mbuf *, struct mbuf **,
- caddr_t *, struct vnode **, struct proc *, int, int));
-void nfsm_adj __P((struct mbuf *, int, int));
-int nfsm_mbuftouio __P((struct mbuf **, struct uio *, int, caddr_t *));
-void nfsrv_initcache __P((void));
-int nfs_getauth __P((struct nfsmount *, struct nfsreq *, struct ucred *,
- char **, int *, char *, int *, NFSKERBKEY_T));
-int nfs_getnickauth __P((struct nfsmount *, struct ucred *, char **,
- int *, char *, int));
-int nfs_savenickauth __P((struct nfsmount *, struct ucred *, int,
- NFSKERBKEY_T, struct mbuf **, char **,
- struct mbuf *));
-int nfs_adv __P((struct mbuf **, caddr_t *, int, int));
-void nfs_nhinit __P((void));
-void nfs_timer __P((void*));
-u_long nfs_hash __P((nfsfh_t *, int));
-int nfsrv_dorec __P((struct nfssvc_sock *, struct nfsd *,
- struct nfsrv_descript **));
-int nfsrv_getcache __P((struct nfsrv_descript *, struct nfssvc_sock *,
- struct mbuf **));
-void nfsrv_updatecache __P((struct nfsrv_descript *, int, struct mbuf *));
-void nfsrv_cleancache __P((void));
-int nfs_connect __P((struct nfsmount *, struct nfsreq *));
-void nfs_disconnect __P((struct nfsmount *));
-int nfs_getattrcache __P((struct vnode *, struct vattr *));
-int nfsm_strtmbuf __P((struct mbuf **, char **, char *, long));
-int nfs_bioread __P((struct vnode *, struct uio *, int, struct ucred *,
- int));
-int nfsm_uiotombuf __P((struct uio *, struct mbuf **, int, caddr_t *));
-void nfsrv_init __P((int));
-void nfs_clearcommit __P((struct mount *));
-int nfsrv_errmap __P((struct nfsrv_descript *, int));
-void nfsrvw_sort __P((gid_t *, int));
-void nfsrv_setcred __P((struct ucred *, struct ucred *));
-int nfs_writebp __P((struct buf *, int));
-int nfsrv_object_create __P((struct vnode *));
-void nfsrv_wakenfsd __P((struct nfssvc_sock *slp));
-int nfsrv_writegather __P((struct nfsrv_descript **, struct nfssvc_sock *,
- struct proc *, struct mbuf **));
-int nfs_fsinfo __P((struct nfsmount *, struct vnode *, struct ucred *,
- struct proc *p));
-
-int nfsrv3_access __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_commit __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_create __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_fhtovp __P((fhandle_t *, int, struct vnode **, struct ucred *,
- struct nfssvc_sock *, struct mbuf *, int *,
- int, int));
-int nfsrv_setpublicfs __P((struct mount *, struct netexport *,
- struct export_args *));
-int nfs_ispublicfh __P((fhandle_t *));
-int nfsrv_fsinfo __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_getattr __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_link __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_lookup __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_mkdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_mknod __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_noop __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_null __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_pathconf __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp, struct proc *procp,
- struct mbuf **mrq));
-int nfsrv_read __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_readdir __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_readdirplus __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp, struct proc *procp,
- struct mbuf **mrq));
-int nfsrv_readlink __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp, struct proc *procp,
- struct mbuf **mrq));
-int nfsrv_remove __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_rename __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_rmdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_setattr __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_statfs __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_symlink __P((struct nfsrv_descript *nfsd,
- struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-int nfsrv_write __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
- struct proc *procp, struct mbuf **mrq));
-void nfsrv_rcv __P((struct socket *so, caddr_t arg, int waitflag));
-void nfsrv_slpderef __P((struct nfssvc_sock *slp));
-
-#if NFSDIAG
-
-extern int nfstraceindx;
-#define NFSTBUFSIZ 8912
-struct nfstracerec { uint i1, i2, i3, i4; };
-extern struct nfstracerec nfstracebuf[NFSTBUFSIZ];
-extern uint nfstracemask; /* 32 bits - trace points over 31 are unconditional */
-
-/* 0x0000000f nfs_getattrcache trace points */
-#define NFSTRC_GAC_MISS 0x00 /* 0x00000001 cache miss */
-#define NFSTRC_GAC_HIT 0x01 /* 0x00000002 cache hit */
-#define NFSTRC_GAC_NP 0x02 /* 0x00000004 np size mismatch - vp... */
-/* 0x00000038 nfs_loadattrcache trace points */
-#define NFSTRC_LAC 0x03 /* 0x00000008 function entry point - vp */
-#define NFSTRC_LAC_INIT 0x04 /* 0x00000010 new vp & init n_mtime - vp */
-#define NFSTRC_LAC_NP 0x05 /* 0x00000020 np size mismatch - vp... */
-/* 0x000000c0 nfs_getattr trace points */
-#define NFSTRC_GA_INV 0x06 /* 0x00000040 times mismatch - vp */
-#define NFSTRC_GA_INV1 0x07 /* 0x00000080 invalidate ok - vp */
-/* 0x00000100 vmp_invalidate trace points */
-#define NFSTRC_VMP_INV 0x08 /* 0x00000100 function entry point - vmp */
-/* 0x00000200 nfs_request trace points */
-#define NFSTRC_REQ 0x09 /* 0x00000200 - alternates vp and procnum */
-/* 0x00000c00 vmp_push_range trace points */
-#define NFSTRC_VPR 0xa /* 0x00000400 entry point - vp... */
-#define NFSTRC_VPR_DONE 0xb /* 0x00000800 tail exit - error # */
-/* 0x00003000 nfs_doio trace points */
-#define NFSTRC_DIO 0xc /* 0x00001000 entry point - vp */
-#define NFSTRC_DIO_DONE 0xd /* 0x00002000 exit points - vp */
-/* 0x000fc000 congestion window trace points */
-#define NFSTRC_CWND_INIT 0xe
-#define NFSTRC_CWND_REPLY 0xf
-#define NFSTRC_CWND_TIMER 0x10
-#define NFSTRC_CWND_REQ1 0x11
-#define NFSTRC_CWND_REQ2 0x12
-#define NFSTRC_CWND_SOFT 0x13
-/* 0xfff00000 nfs_rcvlock & nfs_rcvunlock trace points */
-#define NFSTRC_ECONN 0x14
-#define NFSTRC_RCVERR 0x15
-#define NFSTRC_REQFREE 0x16
-#define NFSTRC_NOTMINE 0x17
-#define NFSTRC_6 0x18
-#define NFSTRC_7 0x19
-#define NFSTRC_RCVLCKINTR 0x1a
-#define NFSTRC_RCVALREADY 0x1b
-#define NFSTRC_RCVLCKW 0x1c /* 0x10000000 seeking recieve lock (waiting) */
-#define NFSTRC_RCVLCK 0x1d /* 0x20000000 getting recieve lock */
-#define NFSTRC_RCVUNLW 0x1e /* 0x40000000 releasing rcv lock w/ wakeup */
-#define NFSTRC_RCVUNL 0x1f /* 0x80000000 releasing rcv lock w/o wakeup */
-/* trace points beyond 31 are on if any of above points are on */
-#define NFSTRC_GA_INV2 0x20 /* nfs_getattr invalidate - error# */
-#define NFSTRC_VBAD 0x21
-#define NFSTRC_REQERR 0x22
-#define NFSTRC_RPCERR 0x23
-#define NFSTRC_DISSECTERR 0x24
-#define NFSTRC_CONTINUE 0xff /* continuation record for previous entry */
-
-#define NFSTRACEX(a1, a2, a3, a4) \
-( \
- nfstracebuf[nfstraceindx].i1 = (uint)(a1), \
- nfstracebuf[nfstraceindx].i2 = (uint)(a2), \
- nfstracebuf[nfstraceindx].i3 = (uint)(a3), \
- nfstracebuf[nfstraceindx].i4 = (uint)(a4), \
- nfstraceindx = (nfstraceindx + 1) % NFSTBUFSIZ, \
- 1 \
-)
-
-#define NFSTRACE(cnst, fptr) \
-( \
- (nfstracemask && ((cnst) > 31 || nfstracemask & 1<<(cnst))) ? \
- NFSTRACEX((cnst), (fptr), current_thread(), \
- clock_get_system_value().tv_nsec) : \
- 0 \
-)
-
-#define NFSTRACE4(cnst, fptr, a2, a3, a4) \
-( \
- NFSTRACE(cnst,fptr) ? \
- NFSTRACEX(NFSTRC_CONTINUE, a2, a3, a4) : \
- 0 \
-)
-
-#else /* NFSDIAG */
-
- #define NFSTRACE(cnst, fptr)
- #define NFSTRACE4(cnst, fptr, a2, a3, a4)
-
-#endif /* NFSDIAG */
+__private_extern__ TAILQ_HEAD(nfsd_head, nfsd) nfsd_head, nfsd_queue;
+
+/* mutex for nfs server */
+__private_extern__ lck_mtx_t *nfsd_mutex;
+__private_extern__ int nfsd_thread_count, nfsd_thread_max;
+
+/* request list mutex */
+__private_extern__ lck_mtx_t *nfs_request_mutex;
+__private_extern__ int nfs_request_timer_on;
+
+/* nfs timer call structures */
+__private_extern__ thread_call_t nfs_request_timer_call;
+__private_extern__ thread_call_t nfs_buf_timer_call;
+__private_extern__ thread_call_t nfsrv_deadsock_timer_call;
+__private_extern__ thread_call_t nfsrv_fmod_timer_call;
+
+__BEGIN_DECLS
+
+nfstype vtonfs_type(enum vtype, int);
+enum vtype nfstov_type(nfstype, int);
+int vtonfsv2_mode(enum vtype, mode_t);
+
+void nfs_mbuf_init(void);
+
+void nfs_nhinit(void);
+void nfs_nhinit_finish(void);
+u_long nfs_hash(u_char *, int);
+
+int nfs4_setclientid(struct nfsmount *);
+void nfs4_renew_timer(void *, void *);
+int nfs_connect(struct nfsmount *);
+void nfs_disconnect(struct nfsmount *);
+void nfs_mount_sock_thread_wake(struct nfsmount *);
+
+int nfs_getattr(nfsnode_t, struct nfs_vattr *, vfs_context_t, int);
+int nfs_getattrcache(nfsnode_t, struct nfs_vattr *, int);
+int nfs_loadattrcache(nfsnode_t, struct nfs_vattr *, u_int64_t *, int);
+int nfs_attrcachetimeout(nfsnode_t);
+
+int nfs_buf_page_inval(vnode_t vp, off_t offset);
+int nfs_vinvalbuf(vnode_t, int, vfs_context_t, int);
+int nfs_vinvalbuf2(vnode_t, int, thread_t, kauth_cred_t, int);
+
+int nfs_request_create(nfsnode_t, mount_t, struct nfsm_chain *, int, thread_t, kauth_cred_t, struct nfsreq **);
+void nfs_request_destroy(struct nfsreq *);
+void nfs_request_ref(struct nfsreq *, int);
+void nfs_request_rele(struct nfsreq *);
+int nfs_request_add_header(struct nfsreq *);
+int nfs_request_send(struct nfsreq *, int);
+void nfs_request_wait(struct nfsreq *);
+int nfs_request_finish(struct nfsreq *, struct nfsm_chain *, int *);
+int nfs_request(nfsnode_t, mount_t, struct nfsm_chain *, int, vfs_context_t, struct nfsm_chain *, u_int64_t *, int *);
+int nfs_request2(nfsnode_t, mount_t, struct nfsm_chain *, int, thread_t, kauth_cred_t, int, struct nfsm_chain *, u_int64_t *, int *);
+int nfs_request_async(nfsnode_t, mount_t, struct nfsm_chain *, int, thread_t, kauth_cred_t, struct nfsreq_cbinfo *cb, struct nfsreq **);
+int nfs_request_async_finish(struct nfsreq *, struct nfsm_chain *, u_int64_t *, int *);
+void nfs_request_async_cancel(struct nfsreq *);
+void nfs_request_timer(void *, void *);
+int nfs_sigintr(struct nfsmount *, struct nfsreq *, thread_t, int);
+int nfs_noremotehang(thread_t);
+
+int nfs_send(struct nfsreq *, int);
+int nfs_sndlock(struct nfsreq *);
+void nfs_sndunlock(struct nfsreq *);
+
+int nfs_lookitup(nfsnode_t, char *, int, vfs_context_t, nfsnode_t *);
+void nfs_dulookup_init(struct nfs_dulookup *, nfsnode_t, const char *, int);
+void nfs_dulookup_start(struct nfs_dulookup *, nfsnode_t, vfs_context_t);
+void nfs_dulookup_finish(struct nfs_dulookup *, nfsnode_t, vfs_context_t);
+
+int nfs_parsefattr(struct nfsm_chain *, int, struct nfs_vattr *);
+int nfs4_parsefattr(struct nfsm_chain *, struct nfs_fsattr *, struct nfs_vattr *, fhandle_t *, struct dqblk *);
+void nfs_vattr_set_supported(uint32_t *, struct vnode_attr *);
+void nfs3_pathconf_cache(struct nfsmount *, struct nfs_fsattr *);
+int nfs_node_mode_slot(nfsnode_t, uid_t, int);
+
+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_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_advlock(struct vnop_advlock_args *ap);
+
+int nfs_read_rpc(nfsnode_t, struct uio *, vfs_context_t);
+int nfs_write_rpc(nfsnode_t, struct uio *, vfs_context_t, int *, uint64_t *);
+int nfs_write_rpc2(nfsnode_t, struct uio *, thread_t, kauth_cred_t, int *, uint64_t *);
+
+int nfs3_access_rpc(nfsnode_t, u_long *, vfs_context_t);
+int nfs4_access_rpc(nfsnode_t, u_long *, 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);
+int nfs4_setattr_rpc(nfsnode_t, struct vnode_attr *, vfs_context_t, int);
+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 *, struct uio *, size_t *, int *);
+int nfs4_read_rpc_async_finish(nfsnode_t, struct nfsreq *, struct uio *, size_t *, int *);
+int nfs3_write_rpc_async(nfsnode_t, struct uio *, size_t, thread_t, kauth_cred_t, int, struct nfsreq_cbinfo *, struct nfsreq **);
+int nfs4_write_rpc_async(nfsnode_t, struct uio *, 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 uio *, vfs_context_t);
+int nfs3_readdirplus_rpc(nfsnode_t, struct uio *, vfs_context_t);
+int nfs4_readdir_rpc(nfsnode_t, struct uio *, 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 nfsrv_fmod_timer(void *, void *);
+int nfsrv_getcache(struct nfsrv_descript *, struct nfsrv_sock *, mbuf_t *);
+void nfsrv_group_sort(gid_t *, int);
+void nfsrv_init(void);
+void nfsrv_initcache(void);
+int nfsrv_is_initialized(void);
+int nfsrv_namei(struct nfsrv_descript *, vfs_context_t, struct nameidata *,
+ struct nfs_filehandle *, vnode_t *,
+ struct nfs_export **, struct nfs_export_options **);
+void nfsrv_rcv(socket_t, caddr_t, int);
+void nfsrv_rcv_locked(socket_t, struct nfsrv_sock *, int);
+int nfsrv_rephead(struct nfsrv_descript *, struct nfsrv_sock *, struct nfsm_chain *, size_t);
+int nfsrv_send(struct nfsrv_sock *, mbuf_t, mbuf_t);
+void nfsrv_updatecache(struct nfsrv_descript *, int, mbuf_t);
+void nfsrv_update_user_stat(struct nfs_export *, struct nfsrv_descript *, uid_t, u_int, u_int, u_int);
+int nfsrv_vptofh(struct nfs_export *, int, struct nfs_filehandle *,
+ vnode_t, vfs_context_t, struct nfs_filehandle *);
+void nfsrv_wakenfsd(struct nfsrv_sock *);
+void nfsrv_wg_timer(void *, void *);
+int nfsrv_writegather(struct nfsrv_descript **, struct nfsrv_sock *,
+ vfs_context_t, mbuf_t *);
+
+int nfsrv_access(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
+int nfsrv_commit(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
+int nfsrv_create(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
+int nfsrv_fsinfo(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
+int nfsrv_getattr(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
+int nfsrv_link(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
+int nfsrv_lookup(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
+int nfsrv_mkdir(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
+int nfsrv_mknod(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
+int nfsrv_noop(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
+int nfsrv_null(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
+int nfsrv_pathconf(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
+int nfsrv_read(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
+int nfsrv_readdir(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
+int nfsrv_readdirplus(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
+int nfsrv_readlink(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
+int nfsrv_remove(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
+int nfsrv_rename(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
+int nfsrv_rmdir(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
+int nfsrv_setattr(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
+int nfsrv_statfs(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
+int nfsrv_symlink(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
+int nfsrv_write(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
+
+void nfs_interval_timer_start(thread_call_t, int);
+void nfs_up(struct nfsmount *, thread_t, int, const char *);
+void nfs_down(struct nfsmount *, thread_t, int, int, const char *);
+
+int nfs_mountroot(void);
+struct nfs_diskless;
+int nfs_boot_init(struct nfs_diskless *);
+int nfs_boot_getfh(struct nfs_diskless *, int, int);
+
+__END_DECLS