aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/lock.h
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2008-09-10 19:13:30 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2008-09-10 19:13:30 +0000
commit413134305e0038936cfa246a56ab91903d35e19c (patch)
tree5defb101ad58952942e4cc44e94404cf65868d19 /sys/sys/lock.h
parentceee59fa5ac606fe28b18086dd07f526ef717f55 (diff)
downloadsrc-413134305e0038936cfa246a56ab91903d35e19c.tar.gz
src-413134305e0038936cfa246a56ab91903d35e19c.zip
Teach WITNESS about the interlocks used with lockmgr. This removes a bunch
of spurious witness warnings since lockmgr grew witness support. Before this, every time you passed an interlock to a lockmgr lock WITNESS treated it as a LOR. Reviewed by: attilio
Notes
Notes: svn path=/head/; revision=182914
Diffstat (limited to 'sys/sys/lock.h')
-rw-r--r--sys/sys/lock.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/sys/lock.h b/sys/sys/lock.h
index b10cc23a1dad..b2f778252a57 100644
--- a/sys/sys/lock.h
+++ b/sys/sys/lock.h
@@ -203,7 +203,8 @@ void spinlock_exit(void);
void witness_init(struct lock_object *, const char *);
void witness_destroy(struct lock_object *);
int witness_defineorder(struct lock_object *, struct lock_object *);
-void witness_checkorder(struct lock_object *, int, const char *, int);
+void witness_checkorder(struct lock_object *, int, const char *, int,
+ struct lock_object *);
void witness_lock(struct lock_object *, int, const char *, int);
void witness_upgrade(struct lock_object *, int, const char *, int);
void witness_downgrade(struct lock_object *, int, const char *, int);
@@ -231,8 +232,8 @@ void witness_thread_exit(struct thread *);
#define WITNESS_DESTROY(lock) \
witness_destroy(lock)
-#define WITNESS_CHECKORDER(lock, flags, file, line) \
- witness_checkorder((lock), (flags), (file), (line))
+#define WITNESS_CHECKORDER(lock, flags, file, line, interlock) \
+ witness_checkorder((lock), (flags), (file), (line), (interlock))
#define WITNESS_DEFINEORDER(lock1, lock2) \
witness_defineorder((struct lock_object *)(lock1), \
@@ -276,7 +277,7 @@ void witness_thread_exit(struct thread *);
#define WITNESS_INIT(lock, type)
#define WITNESS_DESTROY(lock)
#define WITNESS_DEFINEORDER(lock1, lock2) 0
-#define WITNESS_CHECKORDER(lock, flags, file, line)
+#define WITNESS_CHECKORDER(lock, flags, file, line, interlock)
#define WITNESS_LOCK(lock, flags, file, line)
#define WITNESS_UPGRADE(lock, flags, file, line)
#define WITNESS_DOWNGRADE(lock, flags, file, line)
@@ -296,10 +297,10 @@ void witness_thread_exit(struct thread *);
*/
#define witness_check(l) \
WITNESS_CHECKORDER(&(l)->lock_object, LOP_EXCLUSIVE, LOCK_FILE, \
- LOCK_LINE)
+ LOCK_LINE, NULL)
#define witness_check_shared(l) \
- WITNESS_CHECKORDER(&(l)->lock_object, 0, LOCK_FILE, LOCK_LINE)
+ WITNESS_CHECKORDER(&(l)->lock_object, 0, LOCK_FILE, LOCK_LINE, NULL)
#endif /* _KERNEL */
#endif /* _SYS_LOCK_H_ */