diff options
author | phk <phk@FreeBSD.org> | 1997-09-04 08:24:44 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1997-09-04 08:24:44 +0000 |
commit | 775942111e5470deca3e270fca7d40b48c436e90 (patch) | |
tree | 777ad438bede3f887524ee1965c91315e9382f96 /sys/kern/vfs_cache.c | |
parent | 21c65d62af46e53e2bd326bc3a751f1f431caf07 (diff) | |
download | FreeBSD-src-775942111e5470deca3e270fca7d40b48c436e90.zip FreeBSD-src-775942111e5470deca3e270fca7d40b48c436e90.tar.gz |
Revert to the previous hashing, double the hashtable size instead.
Diffstat (limited to 'sys/kern/vfs_cache.c')
-rw-r--r-- | sys/kern/vfs_cache.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index d708c45..6289715 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)vfs_cache.c 8.5 (Berkeley) 3/22/95 - * $Id: vfs_cache.c,v 1.29 1997/09/02 20:06:01 bde Exp $ + * $Id: vfs_cache.c,v 1.30 1997/09/03 09:20:17 phk Exp $ */ #include <sys/param.h> @@ -281,7 +281,7 @@ nchinit() { TAILQ_INIT(&ncneg); - nchashtbl = hashinit(desiredvnodes, M_CACHE, &nchash); + nchashtbl = hashinit(desiredvnodes*2, M_CACHE, &nchash); } /* @@ -298,14 +298,17 @@ cache_purge(vp) { struct namecache *ncp; struct nchashhead *ncpp; + static u_long nextid; while (!LIST_EMPTY(&vp->v_cache_src)) cache_zap(LIST_FIRST(&vp->v_cache_src)); while (!TAILQ_EMPTY(&vp->v_cache_dst)) cache_zap(TAILQ_FIRST(&vp->v_cache_dst)); - if (!++vp->v_id) - vp->v_id++; + nextid++; + while (nextid == vp->v_id || !nextid) + continue; + vp->v_id = nextid; vp->v_dd = vp; vp->v_ddid = 0; } |