diff options
author | dyson <dyson@FreeBSD.org> | 1996-03-19 05:13:22 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1996-03-19 05:13:22 +0000 |
commit | 1fa4d692594eafbf8e84846f170b918ee0afc781 (patch) | |
tree | 8061bebe5a673fb545013ff249887aadb288d51e | |
parent | b10555454e573b2dcc7c0d03059ffa2ad6a30b8f (diff) | |
download | FreeBSD-src-1fa4d692594eafbf8e84846f170b918ee0afc781.zip FreeBSD-src-1fa4d692594eafbf8e84846f170b918ee0afc781.tar.gz |
Fix the problem that unmounting filesystems that are backed by a VMIO
device have reference count problems. We mark the underlying object
ono-persistent, and account for the reference count that the VM system
maintainsfor the special device close. This should fix the removable
device problem.
-rw-r--r-- | sys/fs/specfs/spec_vnops.c | 5 | ||||
-rw-r--r-- | sys/miscfs/specfs/spec_vnops.c | 5 | ||||
-rw-r--r-- | sys/vm/vnode_pager.c | 7 |
3 files changed, 11 insertions, 6 deletions
diff --git a/sys/fs/specfs/spec_vnops.c b/sys/fs/specfs/spec_vnops.c index 180be5f..2dd6859 100644 --- a/sys/fs/specfs/spec_vnops.c +++ b/sys/fs/specfs/spec_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)spec_vnops.c 8.6 (Berkeley) 4/9/94 - * $Id: spec_vnops.c,v 1.27 1996/01/01 20:20:45 phk Exp $ + * $Id: spec_vnops.c,v 1.28 1996/03/09 07:02:52 dyson Exp $ */ #include <sys/param.h> @@ -625,7 +625,8 @@ spec_close(ap) * sum of the reference counts on all the aliased * vnodes descends to one, we are on last close. */ - if (vcount(vp) > 1 && (vp->v_flag & VXLOCK) == 0) + if ((vcount(vp) > ((vp->v_flag & VVMIO)?2:1)) && + (vp->v_flag & VXLOCK) == 0) return (0); devclose = bdevsw[major(dev)]->d_close; mode = S_IFBLK; diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index 180be5f..2dd6859 100644 --- a/sys/miscfs/specfs/spec_vnops.c +++ b/sys/miscfs/specfs/spec_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)spec_vnops.c 8.6 (Berkeley) 4/9/94 - * $Id: spec_vnops.c,v 1.27 1996/01/01 20:20:45 phk Exp $ + * $Id: spec_vnops.c,v 1.28 1996/03/09 07:02:52 dyson Exp $ */ #include <sys/param.h> @@ -625,7 +625,8 @@ spec_close(ap) * sum of the reference counts on all the aliased * vnodes descends to one, we are on last close. */ - if (vcount(vp) > 1 && (vp->v_flag & VXLOCK) == 0) + if ((vcount(vp) > ((vp->v_flag & VVMIO)?2:1)) && + (vp->v_flag & VXLOCK) == 0) return (0); devclose = bdevsw[major(dev)]->d_close; mode = S_IFBLK; diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index 4edbd35..773c5f6 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -38,7 +38,7 @@ * SUCH DAMAGE. * * from: @(#)vnode_pager.c 7.5 (Berkeley) 4/20/91 - * $Id: vnode_pager.c,v 1.57 1995/12/17 23:29:56 dyson Exp $ + * $Id: vnode_pager.c,v 1.58 1996/01/19 04:00:31 dyson Exp $ */ /* @@ -143,7 +143,10 @@ vnode_pager_alloc(handle, size, prot, offset) * And an object of the appropriate size */ object = vm_object_allocate(OBJT_VNODE, size); - object->flags = OBJ_CANPERSIST; + if (vp->v_type == VREG) + object->flags = OBJ_CANPERSIST; + else + object->flags = 0; /* * Hold a reference to the vnode and initialize object data. |