vfs_cache.c (6989) | vfs_cache.c (6990) |
---|---|
1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * Copyright (c) 1995 5 * Poul-Henning Kamp. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 19 unchanged lines hidden (view full) --- 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 * 35 * @(#)vfs_cache.c 8.3 (Berkeley) 8/22/94 | 1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * Copyright (c) 1995 5 * Poul-Henning Kamp. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 19 unchanged lines hidden (view full) --- 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 * 35 * @(#)vfs_cache.c 8.3 (Berkeley) 8/22/94 |
36 * $Id: vfs_cache.c,v 1.8 1995/03/09 20:23:45 phk Exp $ | 36 * $Id: vfs_cache.c,v 1.9 1995/03/10 20:26:29 davidg Exp $ |
37 */ 38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/time.h> 42#include <sys/mount.h> 43#include <sys/vnode.h> 44#include <sys/namei.h> --- 153 unchanged lines hidden (view full) --- 198 if (!doingcache) 199 return; 200 201 if (cnp->cn_namelen > NCHNAMLEN) { 202 printf("cache_enter: name too long"); 203 return; 204 } 205 | 37 */ 38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/time.h> 42#include <sys/mount.h> 43#include <sys/vnode.h> 44#include <sys/namei.h> --- 153 unchanged lines hidden (view full) --- 198 if (!doingcache) 199 return; 200 201 if (cnp->cn_namelen > NCHNAMLEN) { 202 printf("cache_enter: name too long"); 203 return; 204 } 205 |
206 if (numcache < numvnodes || numvnodes < desiredvnodes) { | 206 if (numcache < numvnodes) { |
207 /* Add one more entry */ 208 ncp = (struct namecache *) 209 malloc((u_long)sizeof *ncp, M_CACHE, M_WAITOK); 210 bzero((char *)ncp, sizeof *ncp); 211 numcache++; 212 } else if (ncp = nclruhead.tqh_first) { 213 /* reuse an old entry */ 214 TAILQ_REMOVE(&nclruhead, ncp, nc_lru); --- 96 unchanged lines hidden --- | 207 /* Add one more entry */ 208 ncp = (struct namecache *) 209 malloc((u_long)sizeof *ncp, M_CACHE, M_WAITOK); 210 bzero((char *)ncp, sizeof *ncp); 211 numcache++; 212 } else if (ncp = nclruhead.tqh_first) { 213 /* reuse an old entry */ 214 TAILQ_REMOVE(&nclruhead, ncp, nc_lru); --- 96 unchanged lines hidden --- |