diff options
author | kib <kib@FreeBSD.org> | 2009-06-28 08:42:17 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2009-06-28 08:42:17 +0000 |
commit | 25ffa6178c929df93fd0e0ca37ad532423b11a6d (patch) | |
tree | f33f11e893a2741a7c341641304bb111696fd753 /sys/vm | |
parent | 94560085671b8657f354518b2915e857b9c500f4 (diff) | |
download | FreeBSD-src-25ffa6178c929df93fd0e0ca37ad532423b11a6d.zip FreeBSD-src-25ffa6178c929df93fd0e0ca37ad532423b11a6d.tar.gz |
Eliminiate code duplication by calling vm_object_destroy()
from vm_object_collapse().
Requested and reviewed by: alc
Approved by: re (kensmith)
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_object.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 61bf1e7..3b3124c 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1782,25 +1782,11 @@ vm_object_collapse(vm_object_t object) * and no object references within it, all that is * necessary is to dispose of it. */ - if (backing_object->uip != NULL) { - swap_release_by_uid(backing_object->charge, - backing_object->uip); - backing_object->charge = 0; - uifree(backing_object->uip); - backing_object->uip = NULL; - } - KASSERT(backing_object->ref_count == 1, ("backing_object %p was somehow re-referenced during collapse!", backing_object)); + KASSERT(backing_object->ref_count == 1, ( +"backing_object %p was somehow re-referenced during collapse!", + backing_object)); VM_OBJECT_UNLOCK(backing_object); - - mtx_lock(&vm_object_list_mtx); - TAILQ_REMOVE( - &vm_object_list, - backing_object, - object_list - ); - mtx_unlock(&vm_object_list_mtx); - - uma_zfree(obj_zone, backing_object); + vm_object_destroy(backing_object); object_collapses++; } else { |