svn commit: r269642 - head/sys/vm

Konstantin Belousov kib at FreeBSD.org
Wed Aug 6 19:30:36 UTC 2014


Author: kib
Date: Wed Aug  6 19:30:35 2014
New Revision: 269642
URL: http://svnweb.freebsd.org/changeset/base/269642

Log:
  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

Modified:
  head/sys/vm/vm_object.h

Modified: head/sys/vm/vm_object.h
==============================================================================
--- head/sys/vm/vm_object.h	Wed Aug  6 19:09:21 2014	(r269641)
+++ head/sys/vm/vm_object.h	Wed Aug  6 19:30:35 2014	(r269642)
@@ -225,6 +225,8 @@ extern struct vm_object kmem_object_stor
 	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_stor
 	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)					\


More information about the svn-src-all mailing list