diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-07-03 03:24:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-03 18:27:01 -0400 |
commit | 9e7f4d451e99b7592a96ad0efaf8bcc1e7b2f854 (patch) | |
tree | bc61ead5d497222f93acebbb5cbe1debf6b758ee /kernel | |
parent | 61f4c3d6db3ecbdd4e1a2a7a1710c1410d085dd1 (diff) |
[PATCH] lockdep: rename DEBUG_WARN_ON()
Rename DEBUG_WARN_ON() to the less generic DEBUG_LOCKS_WARN_ON() name, so that
it's clear that this is a lock-debugging internal mechanism.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/mutex-debug.c | 30 | ||||
-rw-r--r-- | kernel/mutex-debug.h | 14 | ||||
-rw-r--r-- | kernel/mutex.c | 6 | ||||
-rw-r--r-- | kernel/mutex.h | 2 |
4 files changed, 26 insertions, 26 deletions
diff --git a/kernel/mutex-debug.c b/kernel/mutex-debug.c index e38e4bac97ca..fe0e9f2714d3 100644 --- a/kernel/mutex-debug.c +++ b/kernel/mutex-debug.c | |||
@@ -373,7 +373,7 @@ void debug_mutex_set_owner(struct mutex *lock, | |||
373 | struct thread_info *new_owner __IP_DECL__) | 373 | struct thread_info *new_owner __IP_DECL__) |
374 | { | 374 | { |
375 | lock->owner = new_owner; | 375 | lock->owner = new_owner; |
376 | DEBUG_WARN_ON(!list_empty(&lock->held_list)); | 376 | DEBUG_LOCKS_WARN_ON(!list_empty(&lock->held_list)); |
377 | if (debug_mutex_on) { | 377 | if (debug_mutex_on) { |
378 | list_add_tail(&lock->held_list, &debug_mutex_held_locks); | 378 | list_add_tail(&lock->held_list, &debug_mutex_held_locks); |
379 | lock->acquire_ip = ip; | 379 | lock->acquire_ip = ip; |
@@ -389,22 +389,22 @@ void debug_mutex_init_waiter(struct mutex_waiter *waiter) | |||
389 | 389 | ||
390 | void debug_mutex_wake_waiter(struct mutex *lock, struct mutex_waiter *waiter) | 390 | void debug_mutex_wake_waiter(struct mutex *lock, struct mutex_waiter *waiter) |
391 | { | 391 | { |
392 | SMP_DEBUG_WARN_ON(!spin_is_locked(&lock->wait_lock)); | 392 | SMP_DEBUG_LOCKS_WARN_ON(!spin_is_locked(&lock->wait_lock)); |
393 | DEBUG_WARN_ON(list_empty(&lock->wait_list)); | 393 | DEBUG_LOCKS_WARN_ON(list_empty(&lock->wait_list)); |
394 | DEBUG_WARN_ON(waiter->magic != waiter); | 394 | DEBUG_LOCKS_WARN_ON(waiter->magic != waiter); |
395 | DEBUG_WARN_ON(list_empty(&waiter->list)); | 395 | DEBUG_LOCKS_WARN_ON(list_empty(&waiter->list)); |
396 | } | 396 | } |
397 | 397 | ||
398 | void debug_mutex_free_waiter(struct mutex_waiter *waiter) | 398 | void debug_mutex_free_waiter(struct mutex_waiter *waiter) |
399 | { | 399 | { |
400 | DEBUG_WARN_ON(!list_empty(&waiter->list)); | 400 | DEBUG_LOCKS_WARN_ON(!list_empty(&waiter->list)); |
401 | memset(waiter, MUTEX_DEBUG_FREE, sizeof(*waiter)); | 401 | memset(waiter, MUTEX_DEBUG_FREE, sizeof(*waiter)); |
402 | } | 402 | } |
403 | 403 | ||
404 | void debug_mutex_add_waiter(struct mutex *lock, struct mutex_waiter *waiter, | 404 | void debug_mutex_add_waiter(struct mutex *lock, struct mutex_waiter *waiter, |
405 | struct thread_info *ti __IP_DECL__) | 405 | struct thread_info *ti __IP_DECL__) |
406 | { | 406 | { |
407 | SMP_DEBUG_WARN_ON(!spin_is_locked(&lock->wait_lock)); | 407 | SMP_DEBUG_LOCKS_WARN_ON(!spin_is_locked(&lock->wait_lock)); |
408 | check_deadlock(lock, 0, ti, ip); | 408 | check_deadlock(lock, 0, ti, ip); |
409 | /* Mark the current thread as blocked on the lock: */ | 409 | /* Mark the current thread as blocked on the lock: */ |
410 | ti->task->blocked_on = waiter; | 410 | ti->task->blocked_on = waiter; |
@@ -414,9 +414,9 @@ void debug_mutex_add_waiter(struct mutex *lock, struct mutex_waiter *waiter, | |||
414 | void mutex_remove_waiter(struct mutex *lock, struct mutex_waiter *waiter, | 414 | void mutex_remove_waiter(struct mutex *lock, struct mutex_waiter *waiter, |
415 | struct thread_info *ti) | 415 | struct thread_info *ti) |
416 | { | 416 | { |
417 | DEBUG_WARN_ON(list_empty(&waiter->list)); | 417 | DEBUG_LOCKS_WARN_ON(list_empty(&waiter->list)); |
418 | DEBUG_WARN_ON(waiter->task != ti->task); | 418 | DEBUG_LOCKS_WARN_ON(waiter->task != ti->task); |
419 | DEBUG_WARN_ON(ti->task->blocked_on != waiter); | 419 | DEBUG_LOCKS_WARN_ON(ti->task->blocked_on != waiter); |
420 | ti->task->blocked_on = NULL; | 420 | ti->task->blocked_on = NULL; |
421 | 421 | ||
422 | list_del_init(&waiter->list); | 422 | list_del_init(&waiter->list); |
@@ -425,11 +425,11 @@ void mutex_remove_waiter(struct mutex *lock, struct mutex_waiter *waiter, | |||
425 | 425 | ||
426 | void debug_mutex_unlock(struct mutex *lock) | 426 | void debug_mutex_unlock(struct mutex *lock) |
427 | { | 427 | { |
428 | DEBUG_WARN_ON(lock->magic != lock); | 428 | DEBUG_LOCKS_WARN_ON(lock->magic != lock); |
429 | DEBUG_WARN_ON(!lock->wait_list.prev && !lock->wait_list.next); | 429 | DEBUG_LOCKS_WARN_ON(!lock->wait_list.prev && !lock->wait_list.next); |
430 | DEBUG_WARN_ON(lock->owner != current_thread_info()); | 430 | DEBUG_LOCKS_WARN_ON(lock->owner != current_thread_info()); |
431 | if (debug_mutex_on) { | 431 | if (debug_mutex_on) { |
432 | DEBUG_WARN_ON(list_empty(&lock->held_list)); | 432 | DEBUG_LOCKS_WARN_ON(list_empty(&lock->held_list)); |
433 | list_del_init(&lock->held_list); | 433 | list_del_init(&lock->held_list); |
434 | } | 434 | } |
435 | } | 435 | } |
@@ -456,7 +456,7 @@ void debug_mutex_init(struct mutex *lock, const char *name) | |||
456 | */ | 456 | */ |
457 | void fastcall mutex_destroy(struct mutex *lock) | 457 | void fastcall mutex_destroy(struct mutex *lock) |
458 | { | 458 | { |
459 | DEBUG_WARN_ON(mutex_is_locked(lock)); | 459 | DEBUG_LOCKS_WARN_ON(mutex_is_locked(lock)); |
460 | lock->magic = NULL; | 460 | lock->magic = NULL; |
461 | } | 461 | } |
462 | 462 | ||
diff --git a/kernel/mutex-debug.h b/kernel/mutex-debug.h index a5196c36a5fd..8417b52ebd65 100644 --- a/kernel/mutex-debug.h +++ b/kernel/mutex-debug.h | |||
@@ -65,10 +65,10 @@ extern void debug_mutex_init(struct mutex *lock, const char *name); | |||
65 | do { \ | 65 | do { \ |
66 | struct mutex *l = container_of(lock, struct mutex, wait_lock); \ | 66 | struct mutex *l = container_of(lock, struct mutex, wait_lock); \ |
67 | \ | 67 | \ |
68 | DEBUG_WARN_ON(in_interrupt()); \ | 68 | DEBUG_LOCKS_WARN_ON(in_interrupt()); \ |
69 | debug_spin_lock_save(&debug_mutex_lock, flags); \ | 69 | debug_spin_lock_save(&debug_mutex_lock, flags); \ |
70 | spin_lock(lock); \ | 70 | spin_lock(lock); \ |
71 | DEBUG_WARN_ON(l->magic != l); \ | 71 | DEBUG_LOCKS_WARN_ON(l->magic != l); \ |
72 | } while (0) | 72 | } while (0) |
73 | 73 | ||
74 | #define spin_unlock_mutex(lock, flags) \ | 74 | #define spin_unlock_mutex(lock, flags) \ |
@@ -95,7 +95,7 @@ do { \ | |||
95 | } \ | 95 | } \ |
96 | } while (0) | 96 | } while (0) |
97 | 97 | ||
98 | #define DEBUG_WARN_ON(c) \ | 98 | #define DEBUG_LOCKS_WARN_ON(c) \ |
99 | do { \ | 99 | do { \ |
100 | if (unlikely(c && debug_mutex_on)) { \ | 100 | if (unlikely(c && debug_mutex_on)) { \ |
101 | DEBUG_OFF(); \ | 101 | DEBUG_OFF(); \ |
@@ -110,10 +110,10 @@ do { \ | |||
110 | } while (0) | 110 | } while (0) |
111 | 111 | ||
112 | #ifdef CONFIG_SMP | 112 | #ifdef CONFIG_SMP |
113 | # define SMP_DEBUG_WARN_ON(c) DEBUG_WARN_ON(c) | 113 | # define SMP_DEBUG_LOCKS_WARN_ON(c) DEBUG_LOCKS_WARN_ON(c) |
114 | # define SMP_DEBUG_BUG_ON(c) DEBUG_BUG_ON(c) | 114 | # define SMP_DEBUG_BUG_ON(c) DEBUG_BUG_ON(c) |
115 | #else | 115 | #else |
116 | # define SMP_DEBUG_WARN_ON(c) do { } while (0) | 116 | # define SMP_DEBUG_LOCKS_WARN_ON(c) do { } while (0) |
117 | # define SMP_DEBUG_BUG_ON(c) do { } while (0) | 117 | # define SMP_DEBUG_BUG_ON(c) do { } while (0) |
118 | #endif | 118 | #endif |
119 | 119 | ||
diff --git a/kernel/mutex.c b/kernel/mutex.c index 7043db21bbce..101ceeb38925 100644 --- a/kernel/mutex.c +++ b/kernel/mutex.c | |||
@@ -183,8 +183,8 @@ __mutex_lock_common(struct mutex *lock, long state __IP_DECL__) | |||
183 | 183 | ||
184 | debug_mutex_free_waiter(&waiter); | 184 | debug_mutex_free_waiter(&waiter); |
185 | 185 | ||
186 | DEBUG_WARN_ON(list_empty(&lock->held_list)); | 186 | DEBUG_LOCKS_WARN_ON(list_empty(&lock->held_list)); |
187 | DEBUG_WARN_ON(lock->owner != task->thread_info); | 187 | DEBUG_LOCKS_WARN_ON(lock->owner != task->thread_info); |
188 | 188 | ||
189 | return 0; | 189 | return 0; |
190 | } | 190 | } |
@@ -206,7 +206,7 @@ __mutex_unlock_slowpath(atomic_t *lock_count __IP_DECL__) | |||
206 | struct mutex *lock = container_of(lock_count, struct mutex, count); | 206 | struct mutex *lock = container_of(lock_count, struct mutex, count); |
207 | unsigned long flags; | 207 | unsigned long flags; |
208 | 208 | ||
209 | DEBUG_WARN_ON(lock->owner != current_thread_info()); | 209 | DEBUG_LOCKS_WARN_ON(lock->owner != current_thread_info()); |
210 | 210 | ||
211 | spin_lock_mutex(&lock->wait_lock, flags); | 211 | spin_lock_mutex(&lock->wait_lock, flags); |
212 | 212 | ||
diff --git a/kernel/mutex.h b/kernel/mutex.h index 069189947257..7e1ed48d1a6c 100644 --- a/kernel/mutex.h +++ b/kernel/mutex.h | |||
@@ -16,7 +16,7 @@ | |||
16 | #define mutex_remove_waiter(lock, waiter, ti) \ | 16 | #define mutex_remove_waiter(lock, waiter, ti) \ |
17 | __list_del((waiter)->list.prev, (waiter)->list.next) | 17 | __list_del((waiter)->list.prev, (waiter)->list.next) |
18 | 18 | ||
19 | #define DEBUG_WARN_ON(c) do { } while (0) | 19 | #define DEBUG_LOCKS_WARN_ON(c) do { } while (0) |
20 | #define debug_mutex_set_owner(lock, new_owner) do { } while (0) | 20 | #define debug_mutex_set_owner(lock, new_owner) do { } while (0) |
21 | #define debug_mutex_clear_owner(lock) do { } while (0) | 21 | #define debug_mutex_clear_owner(lock) do { } while (0) |
22 | #define debug_mutex_init_waiter(waiter) do { } while (0) | 22 | #define debug_mutex_init_waiter(waiter) do { } while (0) |