diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index a00da51..f4178c1 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -1591,18 +1591,6 @@ vn_suspendable_mp(struct mount *mp) return ((mp->mnt_kern_flag & MNTK_SUSPENDABLE) != 0); } -static bool -vn_suspendable(struct vnode *vp, struct mount **mpp) -{ - - if (vp != NULL) - *mpp = vp->v_mount; - if (*mpp == NULL) - return (false); - - return (vn_suspendable_mp(*mpp)); -} - /* * Preparing to start a filesystem write operation. If the operation is * permitted, then we bump the count of operations in progress and @@ -1653,11 +1641,6 @@ vn_start_write(struct vnode *vp, struct mount **mpp, int flags) KASSERT((flags & V_MNTREF) == 0 || (*mpp != NULL && vp == NULL), ("V_MNTREF requires mp")); - if (!vn_suspendable(vp, mpp)) { - if ((flags & V_MNTREF) != 0) - vfs_rel(*mpp); - return (0); - } error = 0; /* @@ -1675,6 +1658,12 @@ vn_start_write(struct vnode *vp, struct mount **mpp, int flags) if ((mp = *mpp) == NULL) return (0); + if (!vn_suspendable_mp(mp)) { + if ((flags & V_MNTREF) != 0) + vfs_rel(mp); + return (0); + } + /* * VOP_GETWRITEMOUNT() returns with the mp refcount held through * a vfs_ref(). @@ -1704,11 +1693,6 @@ vn_start_secondary_write(struct vnode *vp, struct mount **mpp, int flags) KASSERT((flags & V_MNTREF) == 0 || (*mpp != NULL && vp == NULL), ("V_MNTREF requires mp")); - if (!vn_suspendable(vp, mpp)) { - if ((flags & V_MNTREF) != 0) - vfs_rel(*mpp); - return (0); - } retry: if (vp != NULL) { @@ -1726,6 +1710,12 @@ vn_start_secondary_write(struct vnode *vp, struct mount **mpp, int flags) if ((mp = *mpp) == NULL) return (0); + if (!vn_suspendable_mp(mp)) { + if ((flags & V_MNTREF) != 0) + vfs_rel(mp); + return (0); + } + /* * VOP_GETWRITEMOUNT() returns with the mp refcount held through * a vfs_ref().