aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_subr.c
diff options
context:
space:
mode:
authorJeff Roberson <jeff@FreeBSD.org>2002-07-07 06:38:22 +0000
committerJeff Roberson <jeff@FreeBSD.org>2002-07-07 06:38:22 +0000
commit18c48f437f5e93d3f8941cf394054cd77462a85f (patch)
tree5b910d4f9774bbb430ec1336c6fdccb3ea140b01 /sys/kern/vfs_subr.c
parentc7118ed61b5af6ac95c32dd73fca31a1255db6c9 (diff)
downloadsrc-18c48f437f5e93d3f8941cf394054cd77462a85f.tar.gz
src-18c48f437f5e93d3f8941cf394054cd77462a85f.zip
Notes
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r--sys/kern/vfs_subr.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 059b50b28c47..637fa3e30a3b 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1838,6 +1838,7 @@ vflush(mp, rootrefs, flags)
if ((error = VFS_ROOT(mp, &rootvp)) != 0)
return (error);
vput(rootvp);
+
}
mtx_lock(&mntvnode_mtx);
loop:
@@ -2002,6 +2003,12 @@ vclean(vp, flags, td)
VOP_DESTROYVOBJECT(vp);
/*
+ * Any other processes trying to obtain this lock must first
+ * wait for VXLOCK to clear, then call the new lock operation.
+ */
+ VOP_UNLOCK(vp, 0, td);
+
+ /*
* If purging an active vnode, it must be closed and
* deactivated before being reclaimed. Note that the
* VOP_INACTIVE will unlock the vnode.
@@ -2009,14 +2016,11 @@ vclean(vp, flags, td)
if (active) {
if (flags & DOCLOSE)
VOP_CLOSE(vp, FNONBLOCK, NOCRED, td);
+ if (vn_lock(vp, LK_EXCLUSIVE | LK_NOWAIT, td) != 0)
+ panic("vclean: cannot relock.");
VOP_INACTIVE(vp, td);
- } else {
- /*
- * Any other processes trying to obtain this lock must first
- * wait for VXLOCK to clear, then call the new lock operation.
- */
- VOP_UNLOCK(vp, 0, td);
}
+
/*
* Reclaim the vnode.
*/