-#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 *, u_int64_t *));
-int nfs_loadattrcache __P((struct vnode **, struct mbuf **, caddr_t *,
- struct vattr *, int, u_int64_t *));
-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,
+__BEGIN_DECLS
+
+int nfs_init(struct vfsconf *vfsp);
+void nfs_mbuf_init(void);
+int nfs_reply(struct nfsreq *);
+int nfs_getreq(struct nfsrv_descript *,struct nfsd *,int);
+int nfs_send(socket_t, mbuf_t, mbuf_t, struct nfsreq *);
+int nfs_rephead(int, struct nfsrv_descript *, struct nfssvc_sock *,
+ int, mbuf_t *, mbuf_t *, caddr_t *);
+int nfs_sndlock(struct nfsreq *);
+void nfs_sndunlock(struct nfsreq *);
+int nfs_vinvalbuf(vnode_t, int, struct ucred *, proc_t, int);
+int nfs_buf_page_inval(vnode_t vp, off_t offset);
+int nfs_readrpc(vnode_t, struct uio *, struct ucred *, proc_t);
+int nfs_writerpc(vnode_t, struct uio *, struct ucred *, proc_t, int *, int *);
+int nfs_readdirrpc(vnode_t, struct uio *, struct ucred *, proc_t);
+int nfs_readdirplusrpc(vnode_t, struct uio *, struct ucred *, proc_t);
+int nfs_asyncio(struct nfsbuf *, struct ucred *);
+int nfs_doio(struct nfsbuf *, struct ucred *, proc_t);
+int nfs_readlinkrpc(vnode_t, struct uio *, struct ucred *, proc_t);
+int nfs_sigintr(struct nfsmount *, struct nfsreq *, proc_t);
+int nfsm_disct(mbuf_t *, caddr_t *, int, int, caddr_t *);
+void nfsm_srvfattr(struct nfsrv_descript *, struct vnode_attr *,
+ struct nfs_fattr *);
+void nfsm_srvwcc(struct nfsrv_descript *, int, struct vnode_attr *, int,
+ struct vnode_attr *, mbuf_t *, char **);
+void nfsm_srvpostopattr(struct nfsrv_descript *, int, struct vnode_attr *,
+ mbuf_t *, char **);
+int netaddr_match(int, union nethostaddr *, mbuf_t);
+int nfs_request(vnode_t, mount_t, mbuf_t, int, proc_t,
+ struct ucred *, mbuf_t *, mbuf_t *,
+ caddr_t *, u_int64_t *);
+int nfs_parsefattr(mbuf_t *, caddr_t *, int, struct nfs_vattr *);
+int nfs_loadattrcache(struct nfsnode *, struct nfs_vattr *, u_int64_t *, int);
+int nfsm_path_mbuftond(mbuf_t *, caddr_t *, int, int, int *, struct nameidata *);
+int nfs_namei(struct nfsrv_descript *, struct vfs_context *, struct nameidata *,
+ struct nfs_filehandle *, mbuf_t, int, vnode_t *,
+ struct nfs_export **, struct nfs_export_options **);
+void nfsm_adj(mbuf_t, int, int);
+int nfsm_mbuftouio(mbuf_t *, struct uio *, int, caddr_t *);
+void nfsrv_initcache(void);
+int nfs_getauth(struct nfsmount *, struct nfsreq *, struct ucred *,
+ char **, int *, char *, int *, NFSKERBKEY_T);
+int nfs_getnickauth(struct nfsmount *, struct ucred *, char **,
+ int *, char *, int);
+int nfs_savenickauth(struct nfsmount *, struct ucred *, int,
+ NFSKERBKEY_T, mbuf_t *, char **,
+ mbuf_t);
+int nfs_adv(mbuf_t *, caddr_t *, int, int);
+void nfs_nhinit(void);
+void nfs_timer_funnel(void*);
+void nfs_timer(void*);
+u_long nfs_hash(u_char *, int);
+int nfsrv_dorec(struct nfssvc_sock *, struct nfsd *,
+ struct nfsrv_descript **);
+int nfsrv_getcache(struct nfsrv_descript *, struct nfssvc_sock *,
+ mbuf_t *);
+void nfsrv_updatecache(struct nfsrv_descript *, int, mbuf_t);
+void nfsrv_cleancache(void);
+int nfs_bind_resv_thread_wake(void);
+int nfs_connect(struct nfsmount *, struct nfsreq *);
+void nfs_disconnect(struct nfsmount *);
+int nfs_getattr_no_vnode(mount_t,u_char *,int,struct ucred *,proc_t,struct nfs_vattr *,u_int64_t *);
+int nfs_getattr(vnode_t vp, struct nfs_vattr *nvap, struct ucred *cred, proc_t p);
+int nfs_getattrcache(vnode_t, struct nfs_vattr *);
+int nfs_attrcachetimeout(vnode_t);
+int nfsm_strtmbuf(mbuf_t *, char **, char *, long);
+int nfs_bioread(vnode_t, struct uio *, int, struct ucred *, proc_t);
+int nfsm_uiotombuf(struct uio *, mbuf_t *, int, caddr_t *);
+void nfsrv_init(int);
+int nfs_commit(vnode_t vp, u_quad_t offset, u_int32_t count,
+ struct ucred *cred, proc_t procp);
+int nfs_flushcommits(vnode_t, proc_t, int);
+int nfs_flush(vnode_t,int,struct ucred *,proc_t,int);
+void nfs_clearcommit(mount_t);
+int nfsrv_errmap(struct nfsrv_descript *, int);
+void nfsrvw_sort(gid_t *, int);
+void nfsrv_setcred(struct ucred *, struct ucred *);
+int nfs_buf_write(struct nfsbuf *);
+void nfsrv_wakenfsd(struct nfssvc_sock *slp);
+int nfsrv_writegather(struct nfsrv_descript **, struct nfssvc_sock *,
+ proc_t, mbuf_t *);
+int nfs_fsinfo(struct nfsmount *, vnode_t, struct ucred *, proc_t p);
+int nfs_pathconfrpc(vnode_t, struct nfsv3_pathconf *, kauth_cred_t, proc_t);
+void nfs_pathconf_cache(struct nfsmount *, struct nfsv3_pathconf *);
+
+int nfsrv3_access(struct nfsrv_descript *nfsd,