vfs_cache.c (30474) | vfs_cache.c (31016) |
---|---|
1/* 2 * Copyright (c) 1989, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Poul-Henning Kamp of the FreeBSD Project. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)vfs_cache.c 8.5 (Berkeley) 3/22/95 | 1/* 2 * Copyright (c) 1989, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Poul-Henning Kamp of the FreeBSD Project. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)vfs_cache.c 8.5 (Berkeley) 3/22/95 |
37 * $Id: vfs_cache.c,v 1.34 1997/10/15 13:22:52 phk Exp $ | 37 * $Id: vfs_cache.c,v 1.35 1997/10/16 10:47:54 phk Exp $ |
38 */ 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/kernel.h> 43#include <sys/sysctl.h> 44#include <sys/mount.h> 45#include <sys/vnode.h> --- 105 unchanged lines hidden (view full) --- 151 */ 152 153int 154cache_lookup(dvp, vpp, cnp) 155 struct vnode *dvp; 156 struct vnode **vpp; 157 struct componentname *cnp; 158{ | 38 */ 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/kernel.h> 43#include <sys/sysctl.h> 44#include <sys/mount.h> 45#include <sys/vnode.h> --- 105 unchanged lines hidden (view full) --- 151 */ 152 153int 154cache_lookup(dvp, vpp, cnp) 155 struct vnode *dvp; 156 struct vnode **vpp; 157 struct componentname *cnp; 158{ |
159 register struct namecache *ncp, *nnp; 160 register struct nchashhead *ncpp; | 159 register struct namecache *ncp; |
161 162 if (!doingcache) { 163 cnp->cn_flags &= ~MAKEENTRY; 164 return (0); 165 } 166 167 numcalls++; 168 --- 157 unchanged lines hidden (view full) --- 326 * will be purged by lookup as they get found. If the v_id wraps around, we 327 * need to ditch the entire cache, to avoid confusion. No valid vnode will 328 * ever have (v_id == 0). 329 */ 330void 331cache_purge(vp) 332 struct vnode *vp; 333{ | 160 161 if (!doingcache) { 162 cnp->cn_flags &= ~MAKEENTRY; 163 return (0); 164 } 165 166 numcalls++; 167 --- 157 unchanged lines hidden (view full) --- 325 * will be purged by lookup as they get found. If the v_id wraps around, we 326 * need to ditch the entire cache, to avoid confusion. No valid vnode will 327 * ever have (v_id == 0). 328 */ 329void 330cache_purge(vp) 331 struct vnode *vp; 332{ |
334 struct namecache *ncp; 335 struct nchashhead *ncpp; | |
336 static u_long nextid; 337 338 while (!LIST_EMPTY(&vp->v_cache_src)) 339 cache_zap(LIST_FIRST(&vp->v_cache_src)); 340 while (!TAILQ_EMPTY(&vp->v_cache_dst)) 341 cache_zap(TAILQ_FIRST(&vp->v_cache_dst)); 342 343 nextid++; --- 111 unchanged lines hidden --- | 333 static u_long nextid; 334 335 while (!LIST_EMPTY(&vp->v_cache_src)) 336 cache_zap(LIST_FIRST(&vp->v_cache_src)); 337 while (!TAILQ_EMPTY(&vp->v_cache_dst)) 338 cache_zap(TAILQ_FIRST(&vp->v_cache_dst)); 339 340 nextid++; --- 111 unchanged lines hidden --- |