From 49f99b72515864c7f48e1d57295de7c122876049 Mon Sep 17 00:00:00 2001 From: attilio Date: Tue, 26 Feb 2013 17:22:08 +0000 Subject: Wrap the sleeps synchronized by the vm_object lock into the specific macro VM_OBJECT_SLEEP(). This hides some implementation details like the usage of the msleep() primitive and the necessity to access to the lock address directly. For this reason VM_OBJECT_MTX() macro is now retired. Sponsored by: EMC / Isilon storage division Reviewed by: alc Tested by: pho --- sys/vm/vm_object.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/vm/vm_object.h') diff --git a/sys/vm/vm_object.h b/sys/vm/vm_object.h index 8134752..0cb63e9 100644 --- a/sys/vm/vm_object.h +++ b/sys/vm/vm_object.h @@ -210,7 +210,9 @@ extern struct vm_object kmem_object_store; mtx_init(&(object)->mtx, "vm object", \ (type), MTX_DEF | MTX_DUPOK) #define VM_OBJECT_LOCKED(object) mtx_owned(&(object)->mtx) -#define VM_OBJECT_MTX(object) (&(object)->mtx) +#define VM_OBJECT_SLEEP(object, wchan, pri, wmesg, timo) \ + msleep((wchan), &(object)->mtx, (pri), \ + (wmesg), (timo)) #define VM_OBJECT_TRYLOCK(object) mtx_trylock(&(object)->mtx) #define VM_OBJECT_UNLOCK(object) mtx_unlock(&(object)->mtx) -- cgit v1.1