summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_object.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2002-12-20 05:10:32 +0000
committeralc <alc@FreeBSD.org>2002-12-20 05:10:32 +0000
commit380a78911f64a84d65a18601fe8b9fdb8b1fc577 (patch)
tree2b8b1bb0942d8efbdaf89a4ca36c1ee03b32f134 /sys/vm/vm_object.c
parentafe2ea2b71e11bcbd8ca620fbcb80f69fc277f66 (diff)
downloadFreeBSD-src-380a78911f64a84d65a18601fe8b9fdb8b1fc577.zip
FreeBSD-src-380a78911f64a84d65a18601fe8b9fdb8b1fc577.tar.gz
Add a mutex to struct vm_object. Initialize and destroy that mutex
at appropriate times. For the moment, the mutex is only used on the kmem_object.
Diffstat (limited to 'sys/vm/vm_object.c')
-rw-r--r--sys/vm/vm_object.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index a6e0d51..7dca2ae 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -192,6 +192,9 @@ _vm_object_allocate(objtype_t type, vm_pindex_t size, vm_object_t object)
{
int incr;
+ bzero(&object->mtx, sizeof(object->mtx));
+ mtx_init(&object->mtx, "vm object", NULL, MTX_DEF);
+
TAILQ_INIT(&object->memq);
TAILQ_INIT(&object->shadow_head);
@@ -611,6 +614,7 @@ vm_object_terminate(vm_object_t object)
TAILQ_REMOVE(&vm_object_list, object, object_list);
mtx_unlock(&vm_object_list_mtx);
+ mtx_destroy(&object->mtx);
wakeup(object);
/*
OpenPOWER on IntegriCloud