summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_vnops.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/vfs_vnops.c')
-rw-r--r--sys/kern/vfs_vnops.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 1965375..ace8e5c 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -1619,14 +1619,14 @@ unlock:
}
int
-vn_start_write(vp, mpp, flags)
- struct vnode *vp;
- struct mount **mpp;
- int flags;
+vn_start_write(struct vnode *vp, struct mount **mpp, int flags)
{
struct mount *mp;
int error;
+ KASSERT((flags & V_MNTREF) == 0 || (*mpp != NULL && vp == NULL),
+ ("V_MNTREF requires mp"));
+
error = 0;
/*
* If a vnode is provided, get and return the mount point that
@@ -1651,7 +1651,7 @@ vn_start_write(vp, mpp, flags)
* emulate a vfs_ref().
*/
MNT_ILOCK(mp);
- if (vp == NULL)
+ if (vp == NULL && (flags & V_MNTREF) == 0)
MNT_REF(mp);
return (vn_start_write_locked(mp, flags));
@@ -1665,14 +1665,14 @@ vn_start_write(vp, mpp, flags)
* time, these operations are halted until the suspension is over.
*/
int
-vn_start_secondary_write(vp, mpp, flags)
- struct vnode *vp;
- struct mount **mpp;
- int flags;
+vn_start_secondary_write(struct vnode *vp, struct mount **mpp, int flags)
{
struct mount *mp;
int error;
+ KASSERT((flags & V_MNTREF) == 0 || (*mpp != NULL && vp == NULL),
+ ("V_MNTREF requires mp"));
+
retry:
if (vp != NULL) {
if ((error = VOP_GETWRITEMOUNT(vp, mpp)) != 0) {
@@ -1697,7 +1697,7 @@ vn_start_secondary_write(vp, mpp, flags)
* emulate a vfs_ref().
*/
MNT_ILOCK(mp);
- if (vp == NULL)
+ if (vp == NULL && (flags & V_MNTREF) == 0)
MNT_REF(mp);
if ((mp->mnt_kern_flag & (MNTK_SUSPENDED | MNTK_SUSPEND2)) == 0) {
mp->mnt_secondary_writes++;
OpenPOWER on IntegriCloud