diff options
author | dg <dg@FreeBSD.org> | 1995-03-07 17:25:46 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1995-03-07 17:25:46 +0000 |
commit | 964f4c07549336cf03f52e0e039f4b5de54653ab (patch) | |
tree | fd0422897f27a7ef88cc7ff6eabd889e95f866de | |
parent | dedd4ea2294a8e86079bba72ab37d7c38b431e73 (diff) | |
download | FreeBSD-src-964f4c07549336cf03f52e0e039f4b5de54653ab.zip FreeBSD-src-964f4c07549336cf03f52e0e039f4b5de54653ab.tar.gz |
Don't attempt to reverse collapse non OBJ_INTERNAL objects.
-rw-r--r-- | sys/vm/vm_object.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index cc90a6c..395ddcf 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.27 1995/02/22 10:00:16 davidg Exp $ + * $Id: vm_object.c,v 1.28 1995/03/01 23:29:57 davidg Exp $ */ /* @@ -259,11 +259,16 @@ vm_object_deallocate(object) * Lose the reference */ vm_object_lock(object); - if (--(object->ref_count) != 0) { - if (object->ref_count == 1) { + + object->ref_count--; + + if (object->ref_count != 0) { + if ((object->ref_count == 1) && + (object->flags & OBJ_INTERNAL)) { vm_object_t robject; robject = object->reverse_shadow_head.tqh_first; - if( robject) { + if ((robject != NULL) && + (robject->flags & OBJ_INTERNAL)) { int s; robject->ref_count += 2; object->ref_count += 2; @@ -313,6 +318,12 @@ vm_object_deallocate(object) */ if ((object->flags & OBJ_CANPERSIST) && (object->resident_page_count != 0)) { + vm_pager_t pager = object->pager; + vn_pager_t vnp = (vn_pager_t) pager->pg_data; + + if (pager->pg_type == PG_VNODE) { + vnp->vnp_vp->v_flag &= ~VTEXT; + } TAILQ_INSERT_TAIL(&vm_object_cached_list, object, cached_list); @@ -363,10 +374,10 @@ vm_object_terminate(object) vm_object_lock(shadow_object); if (shadow_object->copy == object) shadow_object->copy = NULL; -/* +#if 0 else if (shadow_object->copy != NULL) panic("vm_object_terminate: copy/shadow inconsistency"); -*/ +#endif vm_object_unlock(shadow_object); } if (object->pager && (object->pager->pg_type == PG_VNODE)) { @@ -442,6 +453,8 @@ vm_object_terminate(object) while ((p = object->memq.tqh_first) != NULL) { VM_PAGE_CHECK(p); vm_page_lock_queues(); + if (p->flags & PG_BUSY) + printf("vm_object_terminate: freeing busy page\n"); PAGE_WAKEUP(p); vm_page_free(p); cnt.v_pfree++; |