aboutsummaryrefslogtreecommitdiff
path: root/sys/vm/vm_object.c
diff options
context:
space:
mode:
authorStephan Uphoff <ups@FreeBSD.org>2008-05-20 19:05:43 +0000
committerStephan Uphoff <ups@FreeBSD.org>2008-05-20 19:05:43 +0000
commit2ac78f0e1a784ff14218e3f5320f4c6269b4eb78 (patch)
tree122fb04f7bf2895af8ccd1d933a2cf8c59347db2 /sys/vm/vm_object.c
parentc54a18d26b6afde430af32090857d70da0983532 (diff)
Notes
Diffstat (limited to 'sys/vm/vm_object.c')
-rw-r--r--sys/vm/vm_object.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 041b2890f3d6..4aed5e7114f9 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -594,6 +594,30 @@ doterm:
}
/*
+ * vm_object_destroy removes the object from the global object list
+ * and frees the space for the object.
+ */
+void
+vm_object_destroy(vm_object_t object)
+{
+
+ /*
+ * Remove the object from the global object list.
+ */
+ mtx_lock(&vm_object_list_mtx);
+ TAILQ_REMOVE(&vm_object_list, object, object_list);
+ mtx_unlock(&vm_object_list_mtx);
+
+ /*
+ * Free the space for the object.
+ */
+ uma_zfree(obj_zone, object);
+
+}
+
+
+
+/*
* vm_object_terminate actually destroys the specified object, freeing
* up all previously used resources.
*
@@ -674,17 +698,7 @@ vm_object_terminate(vm_object_t object)
vm_pager_deallocate(object);
VM_OBJECT_UNLOCK(object);
- /*
- * Remove the object from the global object list.
- */
- mtx_lock(&vm_object_list_mtx);
- TAILQ_REMOVE(&vm_object_list, object, object_list);
- mtx_unlock(&vm_object_list_mtx);
-
- /*
- * Free the space for the object.
- */
- uma_zfree(obj_zone, object);
+ vm_object_destroy(object);
}
/*