diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -1110,7 +1110,8 @@ *vpp = vp; #ifdef INVARIANTS - MPASS(*vpp != NULL && VOP_ISLOCKED(*vpp)); + MPASS(*vpp != NULL); + ASSERT_VOP_LOCKED(*vpp, __func__); TMPFS_NODE_LOCK(node); MPASS(*vpp == node->tn_vnode); TMPFS_NODE_UNLOCK(node); diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -218,11 +218,18 @@ cache_enter(dvp, *vpp, cnp); out: +#ifdef INVARIANTS /* * If there were no errors, *vpp cannot be null and it must be * locked. */ - MPASS(IFF(error == 0, *vpp != NULLVP && VOP_ISLOCKED(*vpp))); + if (error == 0) { + MPASS(*vpp != NULLVP); + ASSERT_VOP_LOCKED(*vpp, __func__); + } else { + MPASS(*vpp == NULL); + } +#endif return (error); } @@ -545,7 +552,6 @@ int error; - MPASS(VOP_ISLOCKED(vp)); ASSERT_VOP_IN_SEQC(vp); error = 0; @@ -588,8 +594,6 @@ */ tmpfs_update(vp); - MPASS(VOP_ISLOCKED(vp)); - return (error); } @@ -725,8 +729,6 @@ { struct vnode *vp = v->a_vp; - MPASS(VOP_ISLOCKED(vp)); - tmpfs_check_mtime(vp); tmpfs_update(vp); @@ -745,9 +747,6 @@ struct tmpfs_node *dnode; struct tmpfs_node *node; - MPASS(VOP_ISLOCKED(dvp)); - MPASS(VOP_ISLOCKED(vp)); - if (vp->v_type == VDIR) { error = EISDIR; goto out; @@ -796,7 +795,6 @@ struct tmpfs_dirent *de; struct tmpfs_node *node; - MPASS(VOP_ISLOCKED(dvp)); MPASS(dvp != vp); /* XXX When can this be false? */ node = VP_TO_TMPFS_NODE(vp); @@ -987,9 +985,6 @@ int error; bool want_seqc_end; - MPASS(VOP_ISLOCKED(tdvp)); - MPASS(IMPLIES(tvp != NULL, VOP_ISLOCKED(tvp))); - want_seqc_end = false; /* @@ -1323,9 +1318,6 @@ struct tmpfs_node *dnode; struct tmpfs_node *node; - MPASS(VOP_ISLOCKED(dvp)); - MPASS(VOP_ISLOCKED(vp)); - tmp = VFS_TO_TMPFS(dvp->v_mount); dnode = VP_TO_TMPFS_DIR(dvp); node = VP_TO_TMPFS_DIR(vp);