/*
- * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_LICENSE_HEADER_START@
- *
- * The contents of this file constitute Original Code as defined in and
- * are subject to the Apple Public Source License Version 1.1 (the
- * "License"). You may not use this file except in compliance with the
- * License. Please obtain a copy of the License at
- * http://www.apple.com/publicsource and read it before using this file.
+ * Copyright (c) 2006 Apple Computer, Inc. All Rights Reserved.
*
- * This Original Code and all software distributed under the License are
- * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
- * License for the specific language governing rights and limitations
- * under the License.
+ * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
*
- * @APPLE_LICENSE_HEADER_END@
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. The rights granted to you under the
+ * License may not be used to create, or enable the creation or
+ * redistribution of, unlawful or unlicensed copies of an Apple operating
+ * system, or to circumvent, violate, or enable the circumvention or
+ * violation of, any terms of an Apple operating system software license
+ * agreement.
+ *
+ * Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
*/
/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */
/*
}
/* init nfsiod mutex */
nfs_iod_lck_grp_attr = lck_grp_attr_alloc_init();
+ lck_grp_attr_setstat(nfs_iod_lck_grp_attr);
nfs_iod_lck_grp = lck_grp_alloc_init("nfs_iod", nfs_iod_lck_grp_attr);
nfs_iod_lck_attr = lck_attr_alloc_init();
nfs_iod_mutex = lck_mtx_alloc_init(nfs_iod_lck_grp, nfs_iod_lck_attr);
#ifndef NFS_NOSERVER
/* init nfsd mutex */
nfsd_lck_grp_attr = lck_grp_attr_alloc_init();
+ lck_grp_attr_setstat(nfsd_lck_grp_attr);
nfsd_lck_grp = lck_grp_alloc_init("nfsd", nfsd_lck_grp_attr);
nfsd_lck_attr = lck_attr_alloc_init();
nfsd_mutex = lck_mtx_alloc_init(nfsd_lck_grp, nfsd_lck_attr);
}
/* grab file handle */
- nx->nx_fh.nfh_xh.nxh_version = htonl(NFS_FH_VERSION);
- nx->nx_fh.nfh_xh.nxh_fsid = htonl(nx->nx_fs->nxfs_id);
- nx->nx_fh.nfh_xh.nxh_expid = htonl(nx->nx_id);
+ nx->nx_fh.nfh_xh.nxh_version = NFS_FH_VERSION;
+ nx->nx_fh.nfh_xh.nxh_fsid = nx->nx_fs->nxfs_id;
+ nx->nx_fh.nfh_xh.nxh_expid = nx->nx_id;
nx->nx_fh.nfh_xh.nxh_flags = 0;
nx->nx_fh.nfh_xh.nxh_reserved = 0;
nx->nx_fh.nfh_len = NFS_MAX_FID_SIZE;
nfsrv_fhtoexport(struct nfs_filehandle *nfhp)
{
struct nfs_export *nx;
- uint32_t fsid, expid;
-
- fsid = ntohl(nfhp->nfh_xh.nxh_fsid);
- expid = ntohl(nfhp->nfh_xh.nxh_expid);
- nx = NFSEXPHASH(fsid, expid)->lh_first;
+ nx = NFSEXPHASH(nfhp->nfh_xh.nxh_fsid, nfhp->nfh_xh.nxh_expid)->lh_first;
for (; nx; nx = LIST_NEXT(nx, nx_hash)) {
- if (nx->nx_fs->nxfs_id != fsid)
+ if (nx->nx_fs->nxfs_id != nfhp->nfh_xh.nxh_fsid)
continue;
- if (nx->nx_id != expid)
+ if (nx->nx_id != nfhp->nfh_xh.nxh_expid)
continue;
break;
}
{
int error;
struct mount *mp;
- uint32_t v;
*vpp = NULL;
*nxp = NULL;
*nxop = NULL;
- v = ntohl(nfhp->nfh_xh.nxh_version);
- if (v != NFS_FH_VERSION) {
+ if (nfhp->nfh_xh.nxh_version != NFS_FH_VERSION) {
/* file handle format not supported */
return (ESTALE);
}
return (EBADRPC);
if (nfhp->nfh_len < (int)sizeof(nfhp->nfh_xh))
return (ESTALE);
- v = ntohs(nfhp->nfh_xh.nxh_flags);
- if (v & NXHF_INVALIDFH)
+ if (nfhp->nfh_xh.nxh_flags & NXHF_INVALIDFH)
return (ESTALE);
/* XXX Revisit when enabling WebNFS */
{
int error;
- nfhp->nfh_xh.nxh_version = htonl(NFS_FH_VERSION);
- nfhp->nfh_xh.nxh_fsid = htonl(nx->nx_fs->nxfs_id);
- nfhp->nfh_xh.nxh_expid = htonl(nx->nx_id);
+ nfhp->nfh_xh.nxh_version = NFS_FH_VERSION;
+ nfhp->nfh_xh.nxh_fsid = nx->nx_fs->nxfs_id;
+ nfhp->nfh_xh.nxh_expid = nx->nx_id;
nfhp->nfh_xh.nxh_flags = 0;
nfhp->nfh_xh.nxh_reserved = 0;
if (dnfhp && nfsrv_fhmatch(dnfhp, &nx->nx_fh)) {
nfhp->nfh_len = v2 ? NFSX_V2FH : sizeof(nfhp->nfh_xh);
nfhp->nfh_xh.nxh_fidlen = 0;
- nfhp->nfh_xh.nxh_flags = htons(NXHF_INVALIDFH);
+ nfhp->nfh_xh.nxh_flags = NXHF_INVALIDFH;
return (0);
}