aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_export.c
diff options
context:
space:
mode:
authorJohn Dyson <dyson@FreeBSD.org>1996-10-17 02:49:35 +0000
committerJohn Dyson <dyson@FreeBSD.org>1996-10-17 02:49:35 +0000
commitad98052216b3e80662226439c805809104c730c9 (patch)
tree9cf99cb31ad6e94cfc13475d7e5331f9cab548f0 /sys/kern/vfs_export.c
parentbf41740b4342898020570f0fb49529661269ba22 (diff)
downloadsrc-ad98052216b3e80662226439c805809104c730c9.tar.gz
src-ad98052216b3e80662226439c805809104c730c9.zip
Clean up the rundown of the object backing a vnode. This should fix
NFS problems associated with forcible dismounts.
Notes
Notes: svn path=/head/; revision=18973
Diffstat (limited to 'sys/kern/vfs_export.c')
-rw-r--r--sys/kern/vfs_export.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c
index 61764b1c8a76..c3badf71737b 100644
--- a/sys/kern/vfs_export.c
+++ b/sys/kern/vfs_export.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94
- * $Id: vfs_subr.c,v 1.60 1996/09/19 18:20:22 nate Exp $
+ * $Id: vfs_subr.c,v 1.61 1996/09/28 03:36:07 dyson Exp $
*/
/*
@@ -979,8 +979,11 @@ loop:
(vp->v_writecount == 0 || vp->v_type != VREG))
continue;
- if ((vp->v_usecount == 1) && vp->v_object) {
+ if (vp->v_object && (vp->v_object->flags & OBJ_VFS_REF)) {
+ vm_object_reference(vp->v_object);
pager_cache(vp->v_object, FALSE);
+ vp->v_object->flags &= ~OBJ_VFS_REF;
+ vm_object_deallocate(vp->v_object);
}
/*
@@ -991,6 +994,7 @@ loop:
vgone(vp);
continue;
}
+
/*
* If FORCECLOSE is set, forcibly close the vnode. For block
* or character devices, revert to an anonymous device. For
@@ -1149,6 +1153,11 @@ vgone(vp)
(void) tsleep((caddr_t) vp, PINOD, "vgone", 0);
return;
}
+
+ if (vp->v_object) {
+ vp->v_object->flags |= OBJ_VNODE_GONE;
+ }
+
/*
* Clean out the filesystem specific data.
*/