summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1998-01-07 03:12:19 +0000
committerdyson <dyson@FreeBSD.org>1998-01-07 03:12:19 +0000
commitcbf538c65f55c44d6b75f7ecb922cf0dbe5fc3f2 (patch)
tree0e60dc7c28bdf666daaa1f74b4509c5ed701575a
parentc2173ecb3ee3d35d9fa205f3240fc7a7f7e72c59 (diff)
downloadFreeBSD-src-cbf538c65f55c44d6b75f7ecb922cf0dbe5fc3f2.zip
FreeBSD-src-cbf538c65f55c44d6b75f7ecb922cf0dbe5fc3f2.tar.gz
Turn off the VTEXT flag when an object is no longer referenced, so
that an executable that is no longer running can be written to. Also, clear the OBJ_OPT flag more often, when appropriate.
-rw-r--r--sys/vm/vm_object.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index a279525..7885534 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_object.c,v 1.103 1997/12/29 00:24:49 dyson Exp $
+ * $Id: vm_object.c,v 1.104 1998/01/06 05:26:04 dyson Exp $
*/
/*
@@ -246,7 +246,7 @@ vm_object_reference(object)
vget((struct vnode *) object->handle, LK_NOOBJ, curproc);
}
-inline void
+void
vm_object_vndeallocate(object)
vm_object_t object;
{
@@ -264,6 +264,8 @@ vm_object_vndeallocate(object)
object->ref_count--;
if (object->type == OBJT_VNODE) {
+ if (object->ref_count == 0)
+ vp->v_flag &= ~VTEXT;
vrele(vp);
}
}
@@ -366,6 +368,8 @@ doterm:
if (temp) {
TAILQ_REMOVE(&temp->shadow_head, object, shadow_list);
temp->shadow_count--;
+ if (temp->shadow_count == 0)
+ temp->flags &= ~OBJ_OPT;
}
vm_object_terminate(object);
/* unlocks and deallocates object */
OpenPOWER on IntegriCloud