Index: null_subr.c =================================================================== --- null_subr.c (revision 245340) +++ null_subr.c (working copy) @@ -36,6 +36,7 @@ #include #include +#include #include #include #include @@ -46,8 +47,7 @@ #include -#define LOG2_SIZEVNODE 8 /* log2(sizeof struct vnode) */ -#define NNULLNODECACHE 16 +#define NNULLNODECACHE 32767 /* * Null layer cache: @@ -57,8 +57,7 @@ * alias is removed the lower vnode is vrele'd. */ -#define NULL_NHASH(vp) \ - (&null_node_hashtbl[(((uintptr_t)vp)>>LOG2_SIZEVNODE) & null_node_hash]) +#define NULL_NHASH(hash) (&null_node_hashtbl[(hash) & null_node_hash]) static LIST_HEAD(null_node_hashhead, null_node) *null_node_hashtbl; static u_long null_node_hash; @@ -105,6 +104,7 @@ struct null_node_hashhead *hd; struct null_node *a; struct vnode *vp; + uint32_t hash; ASSERT_VOP_LOCKED(lowervp, "null_hashget"); @@ -114,7 +114,8 @@ * the lower vnode. If found, the increment the null_node * reference count (but NOT the lower vnode's VREF counter). */ - hd = NULL_NHASH(lowervp); + hash = fnv_32_buf(&lowervp, sizeof(lowervp), FNV1_32_INIT); + hd = NULL_NHASH(hash); mtx_lock(&null_hashmtx); LIST_FOREACH(a, hd, null_hash) { if (a->null_lowervp == lowervp && NULLTOV(a)->v_mount == mp) { @@ -146,8 +147,10 @@ struct null_node_hashhead *hd; struct null_node *oxp; struct vnode *ovp; + uint32_t hash; - hd = NULL_NHASH(xp->null_lowervp); + hash = fnv_32_buf(&(xp->null_lowervp), sizeof(xp->null_lowervp), FNV1_32_INIT); + hd = NULL_NHASH(hash); mtx_lock(&null_hashmtx); LIST_FOREACH(oxp, hd, null_hash) { if (oxp->null_lowervp == xp->null_lowervp &&