-#define NFS_TIMEO (1 * NFS_HZ) /* Default timeout = 1 second */
-#define NFS_MINTIMEO (1 * NFS_HZ) /* Min timeout to use */
-#define NFS_MAXTIMEO (60 * NFS_HZ) /* Max timeout to backoff to */
-#define NFS_MINIDEMTIMEO (5 * NFS_HZ) /* Min timeout for non-idempotent ops*/
-#define NFS_MAXREXMIT 100 /* Stop counting after this many */
-#define NFS_RETRANS 10 /* Num of retrans for soft mounts */
-#define NFS_TRYLATERDEL 4 /* Initial try later delay (sec) */
-#define NFS_MAXGRPS 16U /* Max. size of groups list */
-#define NFS_MINATTRTIMO 5 /* Attribute cache timeout in sec */
-#define NFS_MAXATTRTIMO 60
-#define NFS_MINDIRATTRTIMO 5 /* directory attribute cache timeout in sec */
-#define NFS_MAXDIRATTRTIMO 60
-#define NFS_IOSIZE (1024 * 1024) /* suggested I/O size */
-#define NFS_RWSIZE 32768 /* Def. read/write data size <= 32K */
-#define NFS_WSIZE NFS_RWSIZE /* Def. write data size <= 32K */
-#define NFS_RSIZE NFS_RWSIZE /* Def. read data size <= 32K */
-#define NFS_DGRAM_WSIZE 8192 /* UDP Def. write data size <= 8K */
-#define NFS_DGRAM_RSIZE 8192 /* UDP Def. read data size <= 8K */
-#define NFS_READDIRSIZE 32768 /* Def. readdir size */
-#define NFS_DEFRAHEAD 16 /* Def. read ahead # blocks */
-#define NFS_MAXRAHEAD 128 /* Max. read ahead # blocks */
-#define NFS_DEFMAXASYNCWRITES 128 /* Def. max # concurrent async write RPCs */
-#define NFS_DEFASYNCTHREAD 16 /* Def. # nfsiod threads */
-#define NFS_MAXASYNCTHREAD 64 /* max # nfsiod threads */
-#define NFS_ASYNCTHREADMAXIDLE 60 /* Seconds before idle nfsiods are reaped */
-#define NFS_DEFSTATFSRATELIMIT 10 /* Def. max # statfs RPCs per second */
-#define NFS_REQUESTDELAY 10 /* ms interval to check request queue */
-#define NFSRV_MAXWGATHERDELAY 100 /* Max. write gather delay (msec) */
+#define NFS_TIMEO (1 * NFS_HZ) /* Default timeout = 1 second */
+#define NFS_MINTIMEO (1 * NFS_HZ) /* Min timeout to use */
+#define NFS_MAXTIMEO (60 * NFS_HZ) /* Max timeout to backoff to */
+#define NFS_MINIDEMTIMEO (5 * NFS_HZ) /* Min timeout for non-idempotent ops*/
+#define NFS_MAXREXMIT 100 /* Stop counting after this many */
+#define NFS_RETRANS 10 /* Num of retrans for soft mounts */
+#define NFS_TRYLATERDEL 4 /* Initial try later delay (sec) */
+#define NFS_MAXGRPS 16U /* Max. size of groups list */
+#define NFS_MINATTRTIMO 5 /* Attribute cache timeout in sec */
+#define NFS_MAXATTRTIMO 60
+#define NFS_MINDIRATTRTIMO 5 /* directory attribute cache timeout in sec */
+#define NFS_MAXDIRATTRTIMO 60
+#define NFS_IOSIZE (1024 * 1024) /* suggested I/O size */
+#define NFS_RWSIZE 32768 /* Def. read/write data size <= 32K */
+#define NFS_WSIZE NFS_RWSIZE /* Def. write data size <= 32K */
+#define NFS_RSIZE NFS_RWSIZE /* Def. read data size <= 32K */
+#define NFS_DGRAM_WSIZE 8192 /* UDP Def. write data size <= 8K */
+#define NFS_DGRAM_RSIZE 8192 /* UDP Def. read data size <= 8K */
+#define NFS_READDIRSIZE 32768 /* Def. readdir size */
+#define NFS_DEFRAHEAD 16 /* Def. read ahead # blocks */
+#define NFS_MAXRAHEAD 128 /* Max. read ahead # blocks */
+#define NFS_DEFMAXASYNCWRITES 128 /* Def. max # concurrent async write RPCs */
+#define NFS_DEFASYNCTHREAD 16 /* Def. # nfsiod threads */
+#define NFS_MAXASYNCTHREAD 64 /* max # nfsiod threads */
+#define NFS_ASYNCTHREADMAXIDLE 60 /* Seconds before idle nfsiods are reaped */
+#define NFS_DEFSTATFSRATELIMIT 10 /* Def. max # statfs RPCs per second */
+#define NFS_REQUESTDELAY 10 /* ms interval to check request queue */
+#define NFSRV_MAXWGATHERDELAY 100 /* Max. write gather delay (msec) */
-#define NFS_MATTR_FLAGS 0 /* mount flags (NFS_MATTR_*) */
-#define NFS_MATTR_NFS_VERSION 1 /* NFS protocol version */
-#define NFS_MATTR_NFS_MINOR_VERSION 2 /* NFS protocol minor version */
-#define NFS_MATTR_READ_SIZE 3 /* READ RPC size */
-#define NFS_MATTR_WRITE_SIZE 4 /* WRITE RPC size */
-#define NFS_MATTR_READDIR_SIZE 5 /* READDIR RPC size */
-#define NFS_MATTR_READAHEAD 6 /* block readahead count */
-#define NFS_MATTR_ATTRCACHE_REG_MIN 7 /* minimum attribute cache time */
-#define NFS_MATTR_ATTRCACHE_REG_MAX 8 /* maximum attribute cache time */
-#define NFS_MATTR_ATTRCACHE_DIR_MIN 9 /* minimum attribute cache time for dirs */
-#define NFS_MATTR_ATTRCACHE_DIR_MAX 10 /* maximum attribute cache time for dirs */
-#define NFS_MATTR_LOCK_MODE 11 /* advisory file locking mode (NFS_LOCK_MODE_*) */
-#define NFS_MATTR_SECURITY 12 /* RPC security flavors to use */
-#define NFS_MATTR_MAX_GROUP_LIST 13 /* max # of RPC AUTH_SYS groups */
-#define NFS_MATTR_SOCKET_TYPE 14 /* socket transport type as a netid-like string */
-#define NFS_MATTR_NFS_PORT 15 /* port # to use for NFS protocol */
-#define NFS_MATTR_MOUNT_PORT 16 /* port # to use for MOUNT protocol */
-#define NFS_MATTR_REQUEST_TIMEOUT 17 /* initial RPC request timeout value */
-#define NFS_MATTR_SOFT_RETRY_COUNT 18 /* max RPC retransmissions for soft mounts */
-#define NFS_MATTR_DEAD_TIMEOUT 19 /* how long until unresponsive mount is considered dead */
-#define NFS_MATTR_FH 20 /* file handle for mount directory */
-#define NFS_MATTR_FS_LOCATIONS 21 /* list of locations for the file system */
-#define NFS_MATTR_MNTFLAGS 22 /* VFS mount flags (MNT_*) */
-#define NFS_MATTR_MNTFROM 23 /* fixed string to use for "f_mntfromname" */
-#define NFS_MATTR_REALM 24 /* Realm to authenticate with */
-#define NFS_MATTR_PRINCIPAL 25 /* GSS principal to authenticate with */
-#define NFS_MATTR_SVCPRINCIPAL 26 /* GSS principal to authenticate to, the server principal */
-#define NFS_MATTR_NFS_VERSION_RANGE 27 /* Packed version range to try */
-#define NFS_MATTR_KERB_ETYPE 28 /* Enctype to use for kerberos mounts */
+#define NFS_MATTR_FLAGS 0 /* mount flags (NFS_MATTR_*) */
+#define NFS_MATTR_NFS_VERSION 1 /* NFS protocol version */
+#define NFS_MATTR_NFS_MINOR_VERSION 2 /* NFS protocol minor version */
+#define NFS_MATTR_READ_SIZE 3 /* READ RPC size */
+#define NFS_MATTR_WRITE_SIZE 4 /* WRITE RPC size */
+#define NFS_MATTR_READDIR_SIZE 5 /* READDIR RPC size */
+#define NFS_MATTR_READAHEAD 6 /* block readahead count */
+#define NFS_MATTR_ATTRCACHE_REG_MIN 7 /* minimum attribute cache time */
+#define NFS_MATTR_ATTRCACHE_REG_MAX 8 /* maximum attribute cache time */
+#define NFS_MATTR_ATTRCACHE_DIR_MIN 9 /* minimum attribute cache time for dirs */
+#define NFS_MATTR_ATTRCACHE_DIR_MAX 10 /* maximum attribute cache time for dirs */
+#define NFS_MATTR_LOCK_MODE 11 /* advisory file locking mode (NFS_LOCK_MODE_*) */
+#define NFS_MATTR_SECURITY 12 /* RPC security flavors to use */
+#define NFS_MATTR_MAX_GROUP_LIST 13 /* max # of RPC AUTH_SYS groups */
+#define NFS_MATTR_SOCKET_TYPE 14 /* socket transport type as a netid-like string */
+#define NFS_MATTR_NFS_PORT 15 /* port # to use for NFS protocol */
+#define NFS_MATTR_MOUNT_PORT 16 /* port # to use for MOUNT protocol */
+#define NFS_MATTR_REQUEST_TIMEOUT 17 /* initial RPC request timeout value */
+#define NFS_MATTR_SOFT_RETRY_COUNT 18 /* max RPC retransmissions for soft mounts */
+#define NFS_MATTR_DEAD_TIMEOUT 19 /* how long until unresponsive mount is considered dead */
+#define NFS_MATTR_FH 20 /* file handle for mount directory */
+#define NFS_MATTR_FS_LOCATIONS 21 /* list of locations for the file system */
+#define NFS_MATTR_MNTFLAGS 22 /* VFS mount flags (MNT_*) */
+#define NFS_MATTR_MNTFROM 23 /* fixed string to use for "f_mntfromname" */
+#define NFS_MATTR_REALM 24 /* Realm to authenticate with */
+#define NFS_MATTR_PRINCIPAL 25 /* GSS principal to authenticate with */
+#define NFS_MATTR_SVCPRINCIPAL 26 /* GSS principal to authenticate to, the server principal */
+#define NFS_MATTR_NFS_VERSION_RANGE 27 /* Packed version range to try */
+#define NFS_MATTR_KERB_ETYPE 28 /* Enctype to use for kerberos mounts */
-#define NFSMNT_SOFT 0x00000001 /* soft mount (hard is default) */
-#define NFSMNT_WSIZE 0x00000002 /* set write size */
-#define NFSMNT_RSIZE 0x00000004 /* set read size */
-#define NFSMNT_TIMEO 0x00000008 /* set initial timeout */
-#define NFSMNT_RETRANS 0x00000010 /* set number of request retries */
-#define NFSMNT_MAXGRPS 0x00000020 /* set maximum grouplist size */
-#define NFSMNT_INT 0x00000040 /* allow interrupts on hard mount */
-#define NFSMNT_NOCONN 0x00000080 /* Don't Connect the socket */
-#define NFSMNT_NONEGNAMECACHE 0x00000100 /* Don't do negative name caching */
-#define NFSMNT_NFSV3 0x00000200 /* Use NFS Version 3 protocol */
-#define NFSMNT_NFSV4 0x00000400 /* Use NFS Version 4 protocol */
-#define NFSMNT_DUMBTIMR 0x00000800 /* Don't estimate rtt dynamically */
-#define NFSMNT_DEADTIMEOUT 0x00001000 /* unmount after a period of unresponsiveness */
-#define NFSMNT_READAHEAD 0x00002000 /* set read ahead */
-#define NFSMNT_CALLUMNT 0x00004000 /* call MOUNTPROC_UMNT on unmount */
-#define NFSMNT_RESVPORT 0x00008000 /* Allocate a reserved port */
-#define NFSMNT_RDIRPLUS 0x00010000 /* Use Readdirplus for V3 */
-#define NFSMNT_READDIRSIZE 0x00020000 /* Set readdir size */
-#define NFSMNT_NOLOCKS 0x00040000 /* don't support file locking */
-#define NFSMNT_LOCALLOCKS 0x00080000 /* do file locking locally on client */
-#define NFSMNT_ACREGMIN 0x00100000 /* reg min attr cache timeout */
-#define NFSMNT_ACREGMAX 0x00200000 /* reg max attr cache timeout */
-#define NFSMNT_ACDIRMIN 0x00400000 /* dir min attr cache timeout */
-#define NFSMNT_ACDIRMAX 0x00800000 /* dir max attr cache timeout */
-#define NFSMNT_SECFLAVOR 0x01000000 /* Use security flavor */
-#define NFSMNT_SECSYSOK 0x02000000 /* Server can support auth sys */
-#define NFSMNT_MUTEJUKEBOX 0x04000000 /* don't treat jukebox errors as unresponsive */
-#define NFSMNT_NOQUOTA 0x08000000 /* don't support QUOTA requests */
+#define NFSMNT_SOFT 0x00000001 /* soft mount (hard is default) */
+#define NFSMNT_WSIZE 0x00000002 /* set write size */
+#define NFSMNT_RSIZE 0x00000004 /* set read size */
+#define NFSMNT_TIMEO 0x00000008 /* set initial timeout */
+#define NFSMNT_RETRANS 0x00000010 /* set number of request retries */
+#define NFSMNT_MAXGRPS 0x00000020 /* set maximum grouplist size */
+#define NFSMNT_INT 0x00000040 /* allow interrupts on hard mount */
+#define NFSMNT_NOCONN 0x00000080 /* Don't Connect the socket */
+#define NFSMNT_NONEGNAMECACHE 0x00000100 /* Don't do negative name caching */
+#define NFSMNT_NFSV3 0x00000200 /* Use NFS Version 3 protocol */
+#define NFSMNT_NFSV4 0x00000400 /* Use NFS Version 4 protocol */
+#define NFSMNT_DUMBTIMR 0x00000800 /* Don't estimate rtt dynamically */
+#define NFSMNT_DEADTIMEOUT 0x00001000 /* unmount after a period of unresponsiveness */
+#define NFSMNT_READAHEAD 0x00002000 /* set read ahead */
+#define NFSMNT_CALLUMNT 0x00004000 /* call MOUNTPROC_UMNT on unmount */
+#define NFSMNT_RESVPORT 0x00008000 /* Allocate a reserved port */
+#define NFSMNT_RDIRPLUS 0x00010000 /* Use Readdirplus for V3 */
+#define NFSMNT_READDIRSIZE 0x00020000 /* Set readdir size */
+#define NFSMNT_NOLOCKS 0x00040000 /* don't support file locking */
+#define NFSMNT_LOCALLOCKS 0x00080000 /* do file locking locally on client */
+#define NFSMNT_ACREGMIN 0x00100000 /* reg min attr cache timeout */
+#define NFSMNT_ACREGMAX 0x00200000 /* reg max attr cache timeout */
+#define NFSMNT_ACDIRMIN 0x00400000 /* dir min attr cache timeout */
+#define NFSMNT_ACDIRMAX 0x00800000 /* dir max attr cache timeout */
+#define NFSMNT_SECFLAVOR 0x01000000 /* Use security flavor */
+#define NFSMNT_SECSYSOK 0x02000000 /* Server can support auth sys */
+#define NFSMNT_MUTEJUKEBOX 0x04000000 /* don't treat jukebox errors as unresponsive */
+#define NFSMNT_NOQUOTA 0x08000000 /* don't support QUOTA requests */
- lck_mtx_t r_mtx; /* NFS request mutex */
- TAILQ_ENTRY(nfsreq) r_chain; /* request queue chain */
- TAILQ_ENTRY(nfsreq) r_achain; /* mount's async I/O request queue chain */
- TAILQ_ENTRY(nfsreq) r_rchain; /* mount's async I/O resend queue chain */
- TAILQ_ENTRY(nfsreq) r_cchain; /* mount's cwnd queue chain */
- mbuf_t r_mrest; /* request body mbufs */
- mbuf_t r_mhead; /* request header mbufs */
- struct nfsm_chain r_nmrep; /* reply mbufs */
- nfsnode_t r_np; /* NFS node */
- struct nfsmount *r_nmp; /* NFS mount point */
- uint64_t r_xid; /* RPC transaction ID */
- uint32_t r_procnum; /* NFS procedure number */
- uint32_t r_mreqlen; /* request length */
- int r_flags; /* flags on request, see below */
- int r_lflags; /* flags protected by list mutex, see below */
- int r_refs; /* # outstanding references */
- uint8_t r_delay; /* delay to use for jukebox error */
- uint8_t r_retry; /* max retransmission count */
- uint8_t r_rexmit; /* current retrans count */
- int r_rtt; /* RTT for rpc */
- thread_t r_thread; /* thread that did I/O system call */
- kauth_cred_t r_cred; /* credential used for request */
- time_t r_start; /* request start time */
- time_t r_lastmsg; /* time of last tprintf */
- time_t r_resendtime; /* time of next jukebox error resend */
- struct nfs_gss_clnt_ctx *r_gss_ctx; /* RPCSEC_GSS context */
- SLIST_HEAD(, gss_seq) r_gss_seqlist; /* RPCSEC_GSS sequence numbers */
- uint32_t r_gss_argoff; /* RPCSEC_GSS offset to args */
- uint32_t r_gss_arglen; /* RPCSEC_GSS arg length */
- uint32_t r_auth; /* security flavor request sent with */
- uint32_t *r_wrongsec; /* wrongsec: other flavors to try */
- int r_error; /* request error */
- struct nfsreq_cbinfo r_callback; /* callback info */
- struct nfsreq_secinfo_args r_secinfo; /* secinfo args */
+ lck_mtx_t r_mtx; /* NFS request mutex */
+ TAILQ_ENTRY(nfsreq) r_chain; /* request queue chain */
+ TAILQ_ENTRY(nfsreq) r_achain; /* mount's async I/O request queue chain */
+ TAILQ_ENTRY(nfsreq) r_rchain; /* mount's async I/O resend queue chain */
+ TAILQ_ENTRY(nfsreq) r_cchain; /* mount's cwnd queue chain */
+ mbuf_t r_mrest; /* request body mbufs */
+ mbuf_t r_mhead; /* request header mbufs */
+ struct nfsm_chain r_nmrep; /* reply mbufs */
+ nfsnode_t r_np; /* NFS node */
+ struct nfsmount *r_nmp; /* NFS mount point */
+ uint64_t r_xid; /* RPC transaction ID */
+ uint32_t r_procnum; /* NFS procedure number */
+ uint32_t r_mreqlen; /* request length */
+ int r_flags; /* flags on request, see below */
+ int r_lflags; /* flags protected by list mutex, see below */
+ int r_refs; /* # outstanding references */
+ uint8_t r_delay; /* delay to use for jukebox error */
+ uint8_t r_retry; /* max retransmission count */
+ uint8_t r_rexmit; /* current retrans count */
+ int r_rtt; /* RTT for rpc */
+ thread_t r_thread; /* thread that did I/O system call */
+ kauth_cred_t r_cred; /* credential used for request */
+ time_t r_start; /* request start time */
+ time_t r_lastmsg; /* time of last tprintf */
+ time_t r_resendtime; /* time of next jukebox error resend */
+ struct nfs_gss_clnt_ctx *r_gss_ctx; /* RPCSEC_GSS context */
+ SLIST_HEAD(, gss_seq) r_gss_seqlist; /* RPCSEC_GSS sequence numbers */
+ uint32_t r_gss_argoff; /* RPCSEC_GSS offset to args */
+ uint32_t r_gss_arglen; /* RPCSEC_GSS arg length */
+ uint32_t r_auth; /* security flavor request sent with */
+ uint32_t *r_wrongsec; /* wrongsec: other flavors to try */
+ int r_error; /* request error */
+ struct nfsreq_cbinfo r_callback; /* callback info */
+ struct nfsreq_secinfo_args r_secinfo; /* secinfo args */
-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_init_clientid(struct nfsmount *);
-int nfs4_setclientid(struct nfsmount *);
-int nfs4_renew(struct nfsmount *, int);
-void nfs4_renew_timer(void *, void *);
-void nfs4_mount_callback_setup(struct nfsmount *);
-void nfs4_mount_callback_shutdown(struct nfsmount *);
-void nfs4_cb_accept(socket_t, void *, int);
-void nfs4_cb_rcv(socket_t, void *, int);
-void nfs4_callback_timer(void *, void *);
-int nfs4_secinfo_rpc(struct nfsmount *, struct nfsreq_secinfo_args *, kauth_cred_t, uint32_t *, int *);
-int nfs4_get_fs_locations(struct nfsmount *, nfsnode_t, u_char *, int, const char *, vfs_context_t, struct nfs_fs_locations *);
-void nfs_fs_locations_cleanup(struct nfs_fs_locations *);
-void nfs4_default_attrs_for_referral_trigger(nfsnode_t, char *, int, struct nfs_vattr *, fhandle_t *);
-
-int nfs_sockaddr_cmp(struct sockaddr *, struct sockaddr *);
-int nfs_connect(struct nfsmount *, int, int);
-void nfs_disconnect(struct nfsmount *);
-void nfs_need_reconnect(struct nfsmount *);
-void nfs_mount_sock_thread_wake(struct nfsmount *);
-int nfs_mount_check_dead_timeout(struct nfsmount *);
-int nfs_mount_gone(struct nfsmount *);
-void nfs_mount_rele(struct nfsmount *);
-void nfs_mount_zombie(struct nfsmount *, int);
-void nfs_mount_make_zombie(struct nfsmount *);
-
-void nfs_rpc_record_state_init(struct nfs_rpc_record_state *);
-void nfs_rpc_record_state_cleanup(struct nfs_rpc_record_state *);
-int nfs_rpc_record_read(socket_t, struct nfs_rpc_record_state *, int, int *, mbuf_t *);
-
-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_vinvalbuf_internal(nfsnode_t, int, thread_t, kauth_cred_t, int, int);
-void nfs_wait_bufs(nfsnode_t);
-
-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 nfsreq_secinfo_args *, struct nfsm_chain *, u_int64_t *, int *);
-int nfs_request2(nfsnode_t, mount_t, struct nfsm_chain *, int, thread_t, kauth_cred_t, struct nfsreq_secinfo_args *, int, struct nfsm_chain *, u_int64_t *, int *);
-int nfs_request_gss(mount_t, struct nfsm_chain *, thread_t, kauth_cred_t, int, struct nfs_gss_clnt_ctx *, struct nfsm_chain *, int *);
-int nfs_request_async(nfsnode_t, mount_t, struct nfsm_chain *, int, thread_t, kauth_cred_t, struct nfsreq_secinfo_args *, int, struct nfsreq_cbinfo *, 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_request_using_gss(struct nfsreq *);
-void nfs_get_xid(uint64_t *);
-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_uaddr2sockaddr(const char *, struct sockaddr *);
-
-int nfs_aux_request(struct nfsmount *, thread_t, struct sockaddr *, socket_t, int, mbuf_t, uint32_t, int, int, struct nfsm_chain *);
-int nfs_portmap_lookup(struct nfsmount *, vfs_context_t, struct sockaddr *, socket_t, uint32_t, uint32_t, uint32_t, int);
-
-void nfs_location_next(struct nfs_fs_locations *, struct nfs_location_index *);
-int nfs_location_index_cmp(struct nfs_location_index *, struct nfs_location_index *);
-void nfs_location_mntfromname(struct nfs_fs_locations *, struct nfs_location_index, char *, int, int);
-int nfs_socket_create(struct nfsmount *, struct sockaddr *, int, in_port_t, uint32_t, uint32_t, int, struct nfs_socket **);
-void nfs_socket_destroy(struct nfs_socket *);
-void nfs_socket_options(struct nfsmount *, struct nfs_socket *);
-void nfs_connect_upcall(socket_t, void *, int);
-int nfs_connect_error_class(int);
-int nfs_connect_search_loop(struct nfsmount *, struct nfs_socket_search *);
-void nfs_socket_search_update_error(struct nfs_socket_search *, int);
-void nfs_socket_search_cleanup(struct nfs_socket_search *);
-void nfs_mount_connect_thread(void *, __unused wait_result_t);
-
-int nfs_lookitup(nfsnode_t, char *, int, vfs_context_t, nfsnode_t *);
-void nfs_dulookup_init(struct nfs_dulookup *, nfsnode_t, const char *, int, vfs_context_t);
-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_dir_buf_cache_lookup(nfsnode_t, nfsnode_t *, struct componentname *, vfs_context_t, int);
-int nfs_dir_buf_search(struct nfsbuf *, struct componentname *, fhandle_t *, struct nfs_vattr *, uint64_t *, time_t *, daddr64_t *, int);
-void nfs_name_cache_purge(nfsnode_t, nfsnode_t, struct componentname *, vfs_context_t);
+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_init_clientid(struct nfsmount *);
+int nfs4_setclientid(struct nfsmount *);
+int nfs4_renew(struct nfsmount *, int);
+void nfs4_renew_timer(void *, void *);
+void nfs4_mount_callback_setup(struct nfsmount *);
+void nfs4_mount_callback_shutdown(struct nfsmount *);
+void nfs4_cb_accept(socket_t, void *, int);
+void nfs4_cb_rcv(socket_t, void *, int);
+void nfs4_callback_timer(void *, void *);
+int nfs4_secinfo_rpc(struct nfsmount *, struct nfsreq_secinfo_args *, kauth_cred_t, uint32_t *, int *);
+int nfs4_get_fs_locations(struct nfsmount *, nfsnode_t, u_char *, int, const char *, vfs_context_t, struct nfs_fs_locations *);
+void nfs_fs_locations_cleanup(struct nfs_fs_locations *);
+void nfs4_default_attrs_for_referral_trigger(nfsnode_t, char *, int, struct nfs_vattr *, fhandle_t *);
+
+int nfs_sockaddr_cmp(struct sockaddr *, struct sockaddr *);
+int nfs_connect(struct nfsmount *, int, int);
+void nfs_disconnect(struct nfsmount *);
+void nfs_need_reconnect(struct nfsmount *);
+void nfs_mount_sock_thread_wake(struct nfsmount *);
+int nfs_mount_check_dead_timeout(struct nfsmount *);
+int nfs_mount_gone(struct nfsmount *);
+void nfs_mount_rele(struct nfsmount *);
+void nfs_mount_zombie(struct nfsmount *, int);
+void nfs_mount_make_zombie(struct nfsmount *);
+
+void nfs_rpc_record_state_init(struct nfs_rpc_record_state *);
+void nfs_rpc_record_state_cleanup(struct nfs_rpc_record_state *);
+int nfs_rpc_record_read(socket_t, struct nfs_rpc_record_state *, int, int *, mbuf_t *);
+
+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_vinvalbuf_internal(nfsnode_t, int, thread_t, kauth_cred_t, int, int);
+void nfs_wait_bufs(nfsnode_t);
+
+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 nfsreq_secinfo_args *, struct nfsm_chain *, u_int64_t *, int *);
+int nfs_request2(nfsnode_t, mount_t, struct nfsm_chain *, int, thread_t, kauth_cred_t, struct nfsreq_secinfo_args *, int, struct nfsm_chain *, u_int64_t *, int *);
+int nfs_request_gss(mount_t, struct nfsm_chain *, thread_t, kauth_cred_t, int, struct nfs_gss_clnt_ctx *, struct nfsm_chain *, int *);
+int nfs_request_async(nfsnode_t, mount_t, struct nfsm_chain *, int, thread_t, kauth_cred_t, struct nfsreq_secinfo_args *, int, struct nfsreq_cbinfo *, 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_request_using_gss(struct nfsreq *);
+void nfs_get_xid(uint64_t *);
+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_uaddr2sockaddr(const char *, struct sockaddr *);
+
+int nfs_aux_request(struct nfsmount *, thread_t, struct sockaddr *, socket_t, int, mbuf_t, uint32_t, int, int, struct nfsm_chain *);
+int nfs_portmap_lookup(struct nfsmount *, vfs_context_t, struct sockaddr *, socket_t, uint32_t, uint32_t, uint32_t, int);
+
+void nfs_location_next(struct nfs_fs_locations *, struct nfs_location_index *);
+int nfs_location_index_cmp(struct nfs_location_index *, struct nfs_location_index *);
+void nfs_location_mntfromname(struct nfs_fs_locations *, struct nfs_location_index, char *, int, int);
+int nfs_socket_create(struct nfsmount *, struct sockaddr *, int, in_port_t, uint32_t, uint32_t, int, struct nfs_socket **);
+void nfs_socket_destroy(struct nfs_socket *);
+void nfs_socket_options(struct nfsmount *, struct nfs_socket *);
+void nfs_connect_upcall(socket_t, void *, int);
+int nfs_connect_error_class(int);
+int nfs_connect_search_loop(struct nfsmount *, struct nfs_socket_search *);
+void nfs_socket_search_update_error(struct nfs_socket_search *, int);
+void nfs_socket_search_cleanup(struct nfs_socket_search *);
+void nfs_mount_connect_thread(void *, __unused wait_result_t);
+
+int nfs_lookitup(nfsnode_t, char *, int, vfs_context_t, nfsnode_t *);
+void nfs_dulookup_init(struct nfs_dulookup *, nfsnode_t, const char *, int, vfs_context_t);
+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_dir_buf_cache_lookup(nfsnode_t, nfsnode_t *, struct componentname *, vfs_context_t, int);
+int nfs_dir_buf_search(struct nfsbuf *, struct componentname *, fhandle_t *, struct nfs_vattr *, uint64_t *, time_t *, daddr64_t *, int);
+void nfs_name_cache_purge(nfsnode_t, nfsnode_t, struct componentname *, vfs_context_t);
-int nfs4_guid2id(guid_t *, char *, int *, int);
-
-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 *, struct nfs_fs_locations *);
-void nfs_vattr_set_supported(uint32_t *, struct vnode_attr *);
-void nfs_vattr_set_bitmap(struct nfsmount *, uint32_t *, struct vnode_attr *);
-void nfs3_pathconf_cache(struct nfsmount *, struct nfs_fsattr *);
-int nfs3_mount_rpc(struct nfsmount *, struct sockaddr *, int, int, char *, vfs_context_t, int, fhandle_t *, struct nfs_sec *);
-void nfs3_umount_rpc(struct nfsmount *, vfs_context_t, int);
-int nfs_node_access_slot(nfsnode_t, uid_t, int);
-void nfs_vnode_notify(nfsnode_t, uint32_t);
-
-void nfs_avoid_needless_id_setting_on_create(nfsnode_t, struct vnode_attr *, vfs_context_t);
-int nfs4_create_rpc(vfs_context_t, nfsnode_t, struct componentname *, struct vnode_attr *, int, char *, nfsnode_t *);
-int nfs_open_state_set_busy(nfsnode_t, thread_t);
-void nfs_open_state_clear_busy(nfsnode_t);
+int nfs4_guid2id(guid_t *, char *, size_t *, int);
+
+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 *, struct nfs_fs_locations *);
+void nfs_vattr_set_supported(uint32_t *, struct vnode_attr *);
+void nfs_vattr_set_bitmap(struct nfsmount *, uint32_t *, struct vnode_attr *);
+void nfs3_pathconf_cache(struct nfsmount *, struct nfs_fsattr *);
+int nfs3_mount_rpc(struct nfsmount *, struct sockaddr *, int, int, char *, vfs_context_t, int, fhandle_t *, struct nfs_sec *);
+void nfs3_umount_rpc(struct nfsmount *, vfs_context_t, int);
+int nfs_node_access_slot(nfsnode_t, uid_t, int);
+void nfs_vnode_notify(nfsnode_t, uint32_t);
+
+void nfs_avoid_needless_id_setting_on_create(nfsnode_t, struct vnode_attr *, vfs_context_t);
+int nfs4_create_rpc(vfs_context_t, nfsnode_t, struct componentname *, struct vnode_attr *, int, char *, nfsnode_t *);
+int nfs_open_state_set_busy(nfsnode_t, thread_t);
+void nfs_open_state_clear_busy(nfsnode_t);
-void nfs_open_owner_destroy(struct nfs_open_owner *);
-void nfs_open_owner_ref(struct nfs_open_owner *);
-void nfs_open_owner_rele(struct nfs_open_owner *);
-int nfs_open_owner_set_busy(struct nfs_open_owner *, thread_t);
-void nfs_open_owner_clear_busy(struct nfs_open_owner *);
-void nfs_owner_seqid_increment(struct nfs_open_owner *, struct nfs_lock_owner *, int);
-int nfs_open_file_find(nfsnode_t, struct nfs_open_owner *, struct nfs_open_file **, uint32_t, uint32_t, int);
-int nfs_open_file_find_internal(nfsnode_t, struct nfs_open_owner *, struct nfs_open_file **, uint32_t, uint32_t, int);
-void nfs_open_file_destroy(struct nfs_open_file *);
-int nfs_open_file_set_busy(struct nfs_open_file *, thread_t);
-void nfs_open_file_clear_busy(struct nfs_open_file *);
-void nfs_open_file_add_open(struct nfs_open_file *, uint32_t, uint32_t, int);
-void nfs_open_file_remove_open_find(struct nfs_open_file *, uint32_t, uint32_t, uint32_t *, uint32_t *, int*);
-void nfs_open_file_remove_open(struct nfs_open_file *, uint32_t, uint32_t);
-void nfs_get_stateid(nfsnode_t, thread_t, kauth_cred_t, nfs_stateid *);
-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 nfs_close(nfsnode_t, struct nfs_open_file *, uint32_t, uint32_t, vfs_context_t);
-int nfs_check_for_locks(struct nfs_open_owner *, struct nfs_open_file *);
-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_delegreturn_rpc(struct nfsmount *, u_char *, int, struct nfs_stateid *, int, thread_t, kauth_cred_t);
-void nfs_release_open_state_for_node(nfsnode_t, int);
-void nfs_revoke_open_state_for_node(nfsnode_t);
+void nfs_open_owner_destroy(struct nfs_open_owner *);
+void nfs_open_owner_ref(struct nfs_open_owner *);
+void nfs_open_owner_rele(struct nfs_open_owner *);
+int nfs_open_owner_set_busy(struct nfs_open_owner *, thread_t);
+void nfs_open_owner_clear_busy(struct nfs_open_owner *);
+void nfs_owner_seqid_increment(struct nfs_open_owner *, struct nfs_lock_owner *, int);
+int nfs_open_file_find(nfsnode_t, struct nfs_open_owner *, struct nfs_open_file **, uint32_t, uint32_t, int);
+int nfs_open_file_find_internal(nfsnode_t, struct nfs_open_owner *, struct nfs_open_file **, uint32_t, uint32_t, int);
+void nfs_open_file_destroy(struct nfs_open_file *);
+int nfs_open_file_set_busy(struct nfs_open_file *, thread_t);
+void nfs_open_file_clear_busy(struct nfs_open_file *);
+void nfs_open_file_add_open(struct nfs_open_file *, uint32_t, uint32_t, int);
+void nfs_open_file_remove_open_find(struct nfs_open_file *, uint32_t, uint32_t, uint32_t *, uint32_t *, int*);
+void nfs_open_file_remove_open(struct nfs_open_file *, uint32_t, uint32_t);
+void nfs_get_stateid(nfsnode_t, thread_t, kauth_cred_t, nfs_stateid *);
+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 nfs_close(nfsnode_t, struct nfs_open_file *, uint32_t, uint32_t, vfs_context_t);
+int nfs_check_for_locks(struct nfs_open_owner *, struct nfs_open_file *);
+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_delegreturn_rpc(struct nfsmount *, u_char *, int, struct nfs_stateid *, int, thread_t, kauth_cred_t);
+void nfs_release_open_state_for_node(nfsnode_t, int);
+void nfs_revoke_open_state_for_node(nfsnode_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);
-
-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 *);
-
-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 *);
+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);
+
+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 *);
+
+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 *);
-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 nfs4_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 nfs4_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 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, uint64_t, uint64_t, kauth_cred_t, uint64_t);
-int nfs4_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 nfs4_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 nfs4_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 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);
-int nfs3_setlock_rpc(nfsnode_t, struct nfs_open_file *, struct nfs_file_lock *, int, int, thread_t, kauth_cred_t);
-int nfs4_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 nfs4_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);
-int nfs4_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);
+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 nfs4_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 nfs4_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 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, uint64_t, uint64_t, kauth_cred_t, uint64_t);
+int nfs4_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 nfs4_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 nfs4_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 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);
+int nfs3_setlock_rpc(nfsnode_t, struct nfs_open_file *, struct nfs_file_lock *, int, int, thread_t, kauth_cred_t);
+int nfs4_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 nfs4_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);
+int nfs4_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);
-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, void *, 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);
-int nfs_use_cache(struct nfsmount *);
-void nfs_up(struct nfsmount *, thread_t, int, const char *);
-void nfs_down(struct nfsmount *, thread_t, int, int, const char *, int);
-int nfs_msg(thread_t, const char *, const char *, int);
-
-int nfs_mountroot(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, void *, 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);
+int nfs_use_cache(struct nfsmount *);
+void nfs_up(struct nfsmount *, thread_t, int, const char *);
+void nfs_down(struct nfsmount *, thread_t, int, int, const char *, int);
+int nfs_msg(thread_t, const char *, const char *, int);
+
+int nfs_mountroot(void);