diff options
author | attilio <attilio@FreeBSD.org> | 2013-02-26 17:22:08 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2013-02-26 17:22:08 +0000 |
commit | 49f99b72515864c7f48e1d57295de7c122876049 (patch) | |
tree | d12fba4cf5910edb9bb22ed8053661fbc959e1fa /sys/vm/vm_object.h | |
parent | d9ff8818e59c14ea0e7fc65590570396d4fdec2a (diff) | |
download | FreeBSD-src-49f99b72515864c7f48e1d57295de7c122876049.zip FreeBSD-src-49f99b72515864c7f48e1d57295de7c122876049.tar.gz |
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
Diffstat (limited to 'sys/vm/vm_object.h')
-rw-r--r-- | sys/vm/vm_object.h | 4 |
1 files changed, 3 insertions, 1 deletions
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) |