diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-07-03 03:24:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-03 18:27:04 -0400 |
commit | ef5d4707b9065c0cf8a69fa3716893f3b75201ba (patch) | |
tree | 9ec92f31356bf404486c1b26df9fa40bd784f983 /kernel/mutex-debug.c | |
parent | 8a25d5debff2daee280e83e09d8c25d67c26a972 (diff) |
[PATCH] lockdep: prove mutex locking correctness
Use the lock validator framework to prove mutex locking correctness.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/mutex-debug.c')
-rw-r--r-- | kernel/mutex-debug.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/mutex-debug.c b/kernel/mutex-debug.c index 5569766a1ea2..e3203c654dda 100644 --- a/kernel/mutex-debug.c +++ b/kernel/mutex-debug.c | |||
@@ -83,12 +83,16 @@ void debug_mutex_unlock(struct mutex *lock) | |||
83 | DEBUG_LOCKS_WARN_ON(lock->owner != current_thread_info()); | 83 | DEBUG_LOCKS_WARN_ON(lock->owner != current_thread_info()); |
84 | } | 84 | } |
85 | 85 | ||
86 | void debug_mutex_init(struct mutex *lock, const char *name) | 86 | void debug_mutex_init(struct mutex *lock, const char *name, |
87 | struct lock_class_key *key) | ||
87 | { | 88 | { |
89 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
88 | /* | 90 | /* |
89 | * Make sure we are not reinitializing a held lock: | 91 | * Make sure we are not reinitializing a held lock: |
90 | */ | 92 | */ |
91 | debug_check_no_locks_freed((void *)lock, sizeof(*lock)); | 93 | debug_check_no_locks_freed((void *)lock, sizeof(*lock)); |
94 | lockdep_init_map(&lock->dep_map, name, key); | ||
95 | #endif | ||
92 | lock->owner = NULL; | 96 | lock->owner = NULL; |
93 | lock->magic = lock; | 97 | lock->magic = lock; |
94 | } | 98 | } |