summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_cache.c
diff options
context:
space:
mode:
authorEric Jackson <ericj@cvs.openbsd.org>2002-07-02 04:23:26 +0000
committerEric Jackson <ericj@cvs.openbsd.org>2002-07-02 04:23:26 +0000
commitad16a186ab94f8057bd5190ca3a2366befb04bdf (patch)
tree2060791967256ae94b98106660027413ab848cfa /sys/kern/vfs_cache.c
parent3f603b9f00624ca6f35f817e0668692f7c57b1d8 (diff)
use hash.h for nfs_hash as well as namei's hash
ok art@ costa@
Diffstat (limited to 'sys/kern/vfs_cache.c')
-rw-r--r--sys/kern/vfs_cache.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index 4d367cf3f3c..16be7656747 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_cache.c,v 1.6 2002/01/23 00:39:48 art Exp $ */
+/* $OpenBSD: vfs_cache.c,v 1.7 2002/07/02 04:23:25 ericj Exp $ */
/* $NetBSD: vfs_cache.c,v 1.13 1996/02/04 02:18:09 christos Exp $ */
/*
@@ -45,6 +45,7 @@
#include <sys/errno.h>
#include <sys/malloc.h>
#include <sys/pool.h>
+#include <sys/hash.h>
/*
* Name caching works as follows:
@@ -109,7 +110,8 @@ cache_lookup(dvp, vpp, cnp)
cnp->cn_flags &= ~MAKEENTRY;
return (0);
}
- ncpp = &nchashtbl[(cnp->cn_hash ^ dvp->v_id) & nchash];
+ ncpp = &nchashtbl[
+ hash32_buf(&dvp->v_id, sizeof(dvp->v_id), cnp->cn_hash) & nchash];
for (ncp = ncpp->lh_first; ncp != 0; ncp = ncp->nc_hash.le_next) {
if (ncp->nc_dvp == dvp &&
ncp->nc_dvpid == dvp->v_id &&
@@ -217,7 +219,8 @@ 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 ^ dvp->v_id) & nchash];
+ ncpp = &nchashtbl[
+ hash32_buf(&dvp->v_id, sizeof(dvp->v_id), cnp->cn_hash) & nchash];
LIST_INSERT_HEAD(ncpp, ncp, nc_hash);
}