X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/d7e50217d7adf6e52786a38bcaa4cd698cb9a79e..593a1d5fd87cdf5b46dd5fcb84467b432cea0f91:/bsd/miscfs/nullfs/null_subr.c?ds=inline diff --git a/bsd/miscfs/nullfs/null_subr.c b/bsd/miscfs/nullfs/null_subr.c index 47f2d3095..c97977a48 100644 --- a/bsd/miscfs/nullfs/null_subr.c +++ b/bsd/miscfs/nullfs/null_subr.c @@ -1,16 +1,19 @@ /* * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. * - * @APPLE_LICENSE_HEADER_START@ - * - * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * 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. Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this - * file. + * 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 @@ -20,7 +23,7 @@ * Please see the License for the specific language governing rights and * limitations under the License. * - * @APPLE_LICENSE_HEADER_END@ + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ /* @@ -69,7 +72,7 @@ #include #include #include -#include +#include #include #include #include @@ -82,8 +85,8 @@ * Null layer cache: * Each cache entry holds a reference to the lower vnode * along with a pointer to the alias vnode. When an - * entry is added the lower vnode is VREF'd. When the - * alias is removed the lower vnode is vrele'd. + * entry is added the lower vnode is vnode_get'd. When the + * alias is removed the lower vnode is vnode_put'd. */ #define NULL_NHASH(vp) \ @@ -104,7 +107,7 @@ nullfs_init() } /* - * Return a VREF'ed alias for lower vnode if already exists, else 0. + * Return a vnode_get'ed alias for lower vnode if already exists, else 0. */ static struct vnode * null_node_find(mp, lowervp) @@ -120,19 +123,15 @@ null_node_find(mp, lowervp) * Find hash base, and then search the (two-way) linked * list looking for a null_node structure which is referencing * the lower vnode. If found, the increment the null_node - * reference count (but NOT the lower vnode's VREF counter). + * reference count (but NOT the lower vnode's vnode_get counter). */ hd = NULL_NHASH(lowervp); loop: for (a = hd->lh_first; a != 0; a = a->null_hash.le_next) { if (a->null_lowervp == lowervp && NULLTOV(a)->v_mount == mp) { vp = NULLTOV(a); - /* - * We need vget for the VXLOCK - * stuff, but we don't want to lock - * the lower node. - */ - if (vget(vp, 0, p)) { + + if (vnode_get(vp)) { printf ("null_node_find: vget failed.\n"); goto loop; }; @@ -185,7 +184,7 @@ null_node_alloc(mp, lowervp, vpp) }; if (vp->v_type == VREG) ubc_info_init(vp); - VREF(lowervp); /* Extra VREF will be vrele'd in null_node_create */ + vnode_get(lowervp); /* Extra vnode_get will be vnode_put'd in null_node_create */ hd = NULL_NHASH(lowervp); LIST_INSERT_HEAD(hd, xp, null_hash); return 0; @@ -213,7 +212,7 @@ null_node_create(mp, lowervp, newvpp) #ifdef NULLFS_DIAGNOSTIC vprint("null_node_create: exists", NULLTOV(ap)); #endif - /* VREF(aliasvp); --- done in null_node_find */ + /* vnode_get(aliasvp); --- done in null_node_find */ } else { int error; @@ -231,11 +230,11 @@ null_node_create(mp, lowervp, newvpp) return error; /* - * aliasvp is already VREF'd by getnewvnode() + * aliasvp is already vnode_get'd by getnewvnode() */ } - vrele(lowervp); + vnode_put(lowervp); #if DIAGNOSTIC if (lowervp->v_usecount < 1) { @@ -264,7 +263,7 @@ null_checkvp(vp, fil, lno) struct null_node *a = VTONULL(vp); #ifdef notyet /* - * Can't do this check because vop_reclaim runs + * Can't do this check because vnop_reclaim runs * with a funny vop vector. */ if (vp->v_op != null_vnodeop_p) {