/*
- * Copyright (c) 2000-2010 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2014 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
lck_grp_t *nfsrv_slp_rwlock_group;
lck_grp_t *nfsrv_slp_mutex_group;
-struct nfsrv_sockhead nfsrv_socklist, nfsrv_deadsocklist, nfsrv_sockwg,
+struct nfsrv_sockhead nfsrv_socklist, nfsrv_sockwg,
nfsrv_sockwait, nfsrv_sockwork;
struct nfsrv_sock *nfsrv_udpsock = NULL;
struct nfsrv_sock *nfsrv_udp6sock = NULL;
#if CONFIG_FSE
thread_call_t nfsrv_fmod_timer_call;
#endif
-thread_call_t nfsrv_deadsock_timer_call;
+thread_call_t nfsrv_idlesock_timer_call;
thread_call_t nfsrv_wg_timer_call;
int nfsrv_wg_timer_on;
#if CONFIG_FSE
nfsrv_fmod_timer_call = thread_call_allocate(nfsrv_fmod_timer, NULL);
#endif
- nfsrv_deadsock_timer_call = thread_call_allocate(nfsrv_deadsock_timer, NULL);
+ nfsrv_idlesock_timer_call = thread_call_allocate(nfsrv_idlesock_timer, NULL);
nfsrv_wg_timer_call = thread_call_allocate(nfsrv_wg_timer, NULL);
/* Init server data structures */
TAILQ_INIT(&nfsrv_socklist);
TAILQ_INIT(&nfsrv_sockwait);
TAILQ_INIT(&nfsrv_sockwork);
- TAILQ_INIT(&nfsrv_deadsocklist);
TAILQ_INIT(&nfsrv_sockwg);
TAILQ_INIT(&nfsd_head);
TAILQ_INIT(&nfsd_queue);
nfsrv_udpsock = NULL;
nfsrv_udp6sock = NULL;
+ /* Setup the up-call handling */
+ nfsrv_uc_init();
+
/* initialization complete */
nfsrv_initted = NFSRV_INITIALIZED;
}
ioflags = (IO_METASYNC | IO_SYNC | IO_NODELOCKED);
error = VNOP_WRITE(vp, auio, ioflags, ctx);
- OSAddAtomic(1, &nfsstats.srvvop_writes);
+ OSAddAtomic64(1, &nfsstats.srvvop_writes);
/* update export stats */
NFSStatAdd64(&nx->nx_stats.bytes_written, len);
if ((tlen = mbuf_len(m)) > 0)
uio_addiov(auio, CAST_USER_ADDR_T((caddr_t)mbuf_data(m)), tlen);
error = VNOP_WRITE(vp, auio, ioflags, ctx);
- OSAddAtomic(1, &nfsstats.srvvop_writes);
+ OSAddAtomic64(1, &nfsstats.srvvop_writes);
/* update export stats */
NFSStatAdd64(&nx->nx_stats.bytes_written, nd->nd_len);
uint32_t len = 0, cnflags;
u_int32_t major = 0, minor = 0;
enum vtype vtyp;
+ nfstype nvtype;
vnode_t vp, dvp, dirp;
struct nfs_filehandle nfh;
struct nfs_export *nx = NULL;
dvp = ni.ni_dvp;
vp = ni.ni_vp;
- nfsm_chain_get_32(error, nmreq, vtyp);
+ nfsm_chain_get_32(error, nmreq, nvtype);
nfsmerr_if(error);
- vtyp = nfstov_type(vtyp, NFS_VER3);
+ vtyp = nfstov_type(nvtype, NFS_VER3);
if (!error && (vtyp != VCHR) && (vtyp != VBLK) && (vtyp != VSOCK) && (vtyp != VFIFO)) {
error = NFSERR_BADTYPE;
goto out;
error = nfsrv_credcheck(nd, ctx, nx, nxo);
nfsmerr_if(error);
+ if (nxo->nxo_flags & NX_MANGLEDNAMES || nd->nd_vers == NFS_VER2)
+ vnopflag |= VNODE_READDIR_NAMEMAX;
+
if ((nd->nd_vers == NFS_VER2) || (nxo->nxo_flags & NX_32BITCLIENTS))
vnopflag |= VNODE_READDIR_SEEKOFF32;
+
if (nd->nd_vers == NFS_VER3) {
nfsm_srv_vattr_init(&attr, NFS_VER3);
error = attrerr = vnode_getattr(vp, &attr, ctx);
if (nxo->nxo_flags & NX_32BITCLIENTS)
vnopflag |= VNODE_READDIR_SEEKOFF32;
+ if (nxo->nxo_flags & NX_MANGLEDNAMES)
+ vnopflag |= VNODE_READDIR_NAMEMAX;
+
nfsm_srv_vattr_init(&attr, NFS_VER3);
error = attrerr = vnode_getattr(vp, &attr, ctx);
if (!error && toff && verf && (verf != attr.va_filerev))