mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
Eliminiate code duplication by calling vm_object_destroy()
from vm_object_collapse(). Requested and reviewed by: alc Approved by: re (kensmith)
This commit is contained in:
parent
de0c3e0895
commit
9b4d473a6e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=195131
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue