summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_cache.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1995-03-08 01:08:03 +0000
committerphk <phk@FreeBSD.org>1995-03-08 01:08:03 +0000
commitf4953438ea47ab44d09eaa3e48e689510ea6a89d (patch)
tree1b4089ee1e8a9ee28ff9f0e5abae0f7c5d2ac179 /sys/kern/vfs_cache.c
parent259387e65171cb7f1b6d167c2d4fc97d876ecc80 (diff)
downloadFreeBSD-src-f4953438ea47ab44d09eaa3e48e689510ea6a89d.zip
FreeBSD-src-f4953438ea47ab44d09eaa3e48e689510ea6a89d.tar.gz
Improve the quality of the hash used in the namei-cache.
Diffstat (limited to 'sys/kern/vfs_cache.c')
-rw-r--r--sys/kern/vfs_cache.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index e76a1f0..c6d8167 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_cache.c 8.3 (Berkeley) 8/22/94
- * $Id$
+ * $Id: vfs_cache.c,v 1.5 1995/03/06 06:45:52 phk Exp $
*/
#include <sys/param.h>
@@ -104,7 +104,7 @@ cache_lookup(dvp, vpp, cnp)
cnp->cn_flags &= ~MAKEENTRY;
return (0);
}
- ncpp = &nchashtbl[cnp->cn_hash & nchash];
+ ncpp = &nchashtbl[(dvp->v_id + cnp->cn_hash) & nchash];
for (ncp = ncpp->lh_first; ncp != 0; ncp = nnp) {
if (ncp->nc_dvp == dvp &&
ncp->nc_dvpid == dvp->v_id &&
@@ -223,7 +223,7 @@ cache_enter(dvp, vp, cnp)
ncp->nc_nlen = cnp->cn_namelen;
bcopy(cnp->cn_nameptr, ncp->nc_name, (unsigned)ncp->nc_nlen);
TAILQ_INSERT_TAIL(&nclruhead, ncp, nc_lru);
- ncpp = &nchashtbl[cnp->cn_hash & nchash];
+ ncpp = &nchashtbl[(dvp->v_id + cnp->cn_hash) & nchash];
LIST_INSERT_HEAD(ncpp, ncp, nc_hash);
}
OpenPOWER on IntegriCloud