mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
tmpfs: remove bogus MPASS(VOP_ISLOCKED(vp)) asserts
VOP_ISLOCKED() does not return bool, its only reliable use it to check that the vnode is exclusively locked by the calling thread. Almost all asserts of this form repeated auto-generated assertions from vnode_if.src for VOPs, in the incorrect way. In two places where the assertions would be meaningful, convert them to ASSERT_VOP_LOCKED() statements. Reviewed by: markj, mjg Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D38576
This commit is contained in:
parent
5942b4b6fd
commit
9ff2fbdf2d
2 changed files with 10 additions and 17 deletions
|
|
@ -1110,7 +1110,8 @@ out:
|
|||
*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);
|
||||
|
|
|
|||
|
|
@ -218,11 +218,18 @@ tmpfs_lookup1(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp)
|
|||
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 @@ tmpfs_setattr(struct vop_setattr_args *v)
|
|||
|
||||
int error;
|
||||
|
||||
MPASS(VOP_ISLOCKED(vp));
|
||||
ASSERT_VOP_IN_SEQC(vp);
|
||||
|
||||
error = 0;
|
||||
|
|
@ -588,8 +594,6 @@ tmpfs_setattr(struct vop_setattr_args *v)
|
|||
*/
|
||||
tmpfs_update(vp);
|
||||
|
||||
MPASS(VOP_ISLOCKED(vp));
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
|
|
@ -725,8 +729,6 @@ tmpfs_fsync(struct vop_fsync_args *v)
|
|||
{
|
||||
struct vnode *vp = v->a_vp;
|
||||
|
||||
MPASS(VOP_ISLOCKED(vp));
|
||||
|
||||
tmpfs_check_mtime(vp);
|
||||
tmpfs_update(vp);
|
||||
|
||||
|
|
@ -745,9 +747,6 @@ tmpfs_remove(struct vop_remove_args *v)
|
|||
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 @@ tmpfs_link(struct vop_link_args *v)
|
|||
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 @@ tmpfs_rename(struct vop_rename_args *v)
|
|||
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 @@ tmpfs_rmdir(struct vop_rmdir_args *v)
|
|||
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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue