diff options
author | jhb <jhb@FreeBSD.org> | 2008-09-10 19:13:30 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2008-09-10 19:13:30 +0000 |
commit | af0471aaecf118efcab5180cdca70a1151722ae3 (patch) | |
tree | 5defb101ad58952942e4cc44e94404cf65868d19 /sys/sys/lock.h | |
parent | bc107b3828d742160ad1da66c6e2577731499014 (diff) | |
download | FreeBSD-src-af0471aaecf118efcab5180cdca70a1151722ae3.zip FreeBSD-src-af0471aaecf118efcab5180cdca70a1151722ae3.tar.gz |
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
Diffstat (limited to 'sys/sys/lock.h')
-rw-r--r-- | sys/sys/lock.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/sys/lock.h b/sys/sys/lock.h index b10cc23..b2f7782 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_ */ |