cache: drop the NULL check from VP2VNODELOCK

Now that negative entries are annotated with a dedicated flag, NULL vnodes
are no longer passed.
This commit is contained in:
Mateusz Guzik 2016-12-29 08:34:50 +00:00
parent e9c123a567
commit 6dd9661b77

View File

@ -260,12 +260,8 @@ static struct mtx *vnodelocks;
static inline struct mtx *
VP2VNODELOCK(struct vnode *vp)
{
struct mtx *vlp;
if (vp == NULL)
return (NULL);
vlp = &vnodelocks[(((uintptr_t)(vp) >> 8) % numvnodelocks)];
return (vlp);
return (&vnodelocks[(((uintptr_t)(vp) >> 8) % numvnodelocks)]);
}
/*
@ -1373,10 +1369,9 @@ cache_lock_vnodes_cel_3(struct celockstate *cel, struct vnode *vp)
cache_assert_vlp_locked(cel->vlp[0]);
cache_assert_vlp_locked(cel->vlp[1]);
MPASS(cel->vlp[2] == NULL);
MPASS(vp != NULL);
vlp = VP2VNODELOCK(vp);
MPASS(vlp != NULL);
ret = true;
if (vlp >= cel->vlp[1]) {
mtx_lock(vlp);