aboutsummaryrefslogtreecommitdiff
path: root/sys/vm/vm_object.h
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2003-04-28 03:45:35 +0000
committerAlan Cox <alc@FreeBSD.org>2003-04-28 03:45:35 +0000
commited6a7863137e088634a8104ec1f4262bc6340d75 (patch)
tree2946f2b3c5d7a731bb7189b5e1494af66484805c /sys/vm/vm_object.h
parent70b400a813bf45afdfebac44d412bbb4fdbf245d (diff)
downloadsrc-ed6a7863137e088634a8104ec1f4262bc6340d75.tar.gz
src-ed6a7863137e088634a8104ec1f4262bc6340d75.zip
- Define VM_OBJECT_LOCK_INIT().
- Avoid repeatedly mtx_init()ing and mtx_destroy()ing the vm_object's lock using UMA's uminit callback, in this case, vm_object_zinit().
Notes
Notes: svn path=/head/; revision=114145
Diffstat (limited to 'sys/vm/vm_object.h')
-rw-r--r--sys/vm/vm_object.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/vm/vm_object.h b/sys/vm/vm_object.h
index b7090c3f2672..8cf9467c93ee 100644
--- a/sys/vm/vm_object.h
+++ b/sys/vm/vm_object.h
@@ -173,6 +173,8 @@ extern vm_object_t kmem_object;
#define VM_OBJECT_LOCK(object) mtx_lock(&(object)->mtx)
#define VM_OBJECT_LOCK_ASSERT(object, type) \
mtx_assert(&(object)->mtx, (type))
+#define VM_OBJECT_LOCK_INIT(object) mtx_init(&(object)->mtx, "vm object", \
+ NULL, MTX_DEF | MTX_DUPOK)
#define VM_OBJECT_LOCKED(object) mtx_owned(&(object)->mtx)
#define VM_OBJECT_MTX(object) (&(object)->mtx)
#define VM_OBJECT_UNLOCK(object) mtx_unlock(&(object)->mtx)