summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_object.h
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2003-04-28 03:45:35 +0000
committeralc <alc@FreeBSD.org>2003-04-28 03:45:35 +0000
commit72d436f39acc536214c41cd8862692e290e2f31c (patch)
tree2946f2b3c5d7a731bb7189b5e1494af66484805c /sys/vm/vm_object.h
parentbeff3ce21838f1b3cb0e9967a133624d62325aa4 (diff)
downloadFreeBSD-src-72d436f39acc536214c41cd8862692e290e2f31c.zip
FreeBSD-src-72d436f39acc536214c41cd8862692e290e2f31c.tar.gz
- 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().
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 b7090c3..8cf9467 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)
OpenPOWER on IntegriCloud