summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2014-08-06 19:30:35 +0000
committerkib <kib@FreeBSD.org>2014-08-06 19:30:35 +0000
commita39918dab4c1ed3e65ec2b9ee9308745cefdbddc (patch)
tree886622891ccf4b382a2c2a861e5f36061d5206c7 /sys/vm
parent66e227922e63a562491961db8036e9f5f4005b4f (diff)
downloadFreeBSD-src-a39918dab4c1ed3e65ec2b9ee9308745cefdbddc.zip
FreeBSD-src-a39918dab4c1ed3e65ec2b9ee9308745cefdbddc.tar.gz
Add wrappers to assert that vm object is unlocked and for try upgrade.
Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_object.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/vm/vm_object.h b/sys/vm/vm_object.h
index 1f6c7c2..48ba743 100644
--- a/sys/vm/vm_object.h
+++ b/sys/vm/vm_object.h
@@ -225,6 +225,8 @@ extern struct vm_object kmem_object_store;
rw_assert(&(object)->lock, RA_RLOCKED)
#define VM_OBJECT_ASSERT_WLOCKED(object) \
rw_assert(&(object)->lock, RA_WLOCKED)
+#define VM_OBJECT_ASSERT_UNLOCKED(object) \
+ rw_assert(&(object)->lock, RA_UNLOCKED)
#define VM_OBJECT_LOCK_DOWNGRADE(object) \
rw_downgrade(&(object)->lock)
#define VM_OBJECT_RLOCK(object) \
@@ -237,6 +239,8 @@ extern struct vm_object kmem_object_store;
rw_try_rlock(&(object)->lock)
#define VM_OBJECT_TRYWLOCK(object) \
rw_try_wlock(&(object)->lock)
+#define VM_OBJECT_TRYUPGRADE(object) \
+ rw_try_upgrade(&(object)->lock)
#define VM_OBJECT_WLOCK(object) \
rw_wlock(&(object)->lock)
#define VM_OBJECT_WUNLOCK(object) \
OpenPOWER on IntegriCloud