limit the number of namecache entries to numvnodes rather than desiredvnodes.

getnewvnode() has been changed to virtually guarantee that we'll have more
vnodes than "desired", so previously there would always be more vnodes
than namecache entries.  this fixes PR 9792.
This commit is contained in:
chs 2000-04-16 21:39:57 +00:00
parent 6fa10bb0bf
commit d0fb21715e
2 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfs_cache.c,v 1.23 2000/03/30 09:27:14 augustss Exp $ */
/* $NetBSD: vfs_cache.c,v 1.24 2000/04/16 21:39:57 chs Exp $ */
/*
* Copyright (c) 1989, 1993
@ -336,7 +336,7 @@ cache_enter(dvp, vp, cnp)
/*
* Free the cache slot at head of lru chain.
*/
if (numcache < desiredvnodes) {
if (numcache < numvnodes) {
ncp = pool_get(&namecache_pool, PR_WAITOK);
memset((char *)ncp, 0, sizeof(*ncp));
numcache++;

View File

@ -1,4 +1,4 @@
/* $NetBSD: vnode.h,v 1.73 2000/04/11 04:37:51 chs Exp $ */
/* $NetBSD: vnode.h,v 1.74 2000/04/16 21:39:57 chs Exp $ */
/*
* Copyright (c) 1989, 1993
@ -322,6 +322,7 @@ vref(vp)
*/
extern struct vnode *rootvnode; /* root (i.e. "/") vnode */
extern int desiredvnodes; /* number of vnodes desired */
extern long numvnodes; /* current number of vnodes */
extern time_t syncdelay; /* max time to delay syncing data */
extern time_t filedelay; /* time to delay syncing files */
extern time_t dirdelay; /* time to delay syncing directories */