summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2003-01-04 19:23:19 +0000
committeralc <alc@FreeBSD.org>2003-01-04 19:23:19 +0000
commitd34fb3af16f05d9cb5890ebea64c54a5641406d1 (patch)
tree4ffa0bb66ce129ad7754565ea1e69043639fb5ba /sys/vm
parentd5b9d0271f7965ab7b6ca186d4f0fd61804c354d (diff)
downloadFreeBSD-src-d34fb3af16f05d9cb5890ebea64c54a5641406d1.zip
FreeBSD-src-d34fb3af16f05d9cb5890ebea64c54a5641406d1.tar.gz
Use vm_object_lock() and vm_object_unlock() in vm_object_deallocate().
(This procedure needs further work, but this change is sufficient for locking the kmem_object.)
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_object.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 0bd5a07..1959cd3 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -433,12 +433,12 @@ vm_object_deallocate(vm_object_t object)
{
vm_object_t temp;
- mtx_lock(&Giant);
+ vm_object_lock(object);
while (object != NULL) {
if (object->type == OBJT_VNODE) {
vm_object_vndeallocate(object);
- mtx_unlock(&Giant);
+ vm_object_unlock(object);
return;
}
@@ -453,7 +453,7 @@ vm_object_deallocate(vm_object_t object)
*/
object->ref_count--;
if (object->ref_count > 1) {
- mtx_unlock(&Giant);
+ vm_object_unlock(object);
return;
} else if (object->ref_count == 1) {
if (object->shadow_count == 0) {
@@ -494,7 +494,7 @@ vm_object_deallocate(vm_object_t object)
continue;
}
}
- mtx_unlock(&Giant);
+ vm_object_unlock(object);
return;
}
doterm:
@@ -518,7 +518,7 @@ doterm:
vm_object_terminate(object);
object = temp;
}
- mtx_unlock(&Giant);
+ vm_object_unlock(object);
}
/*
OpenPOWER on IntegriCloud