aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/mutex-debug.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-07-03 03:24:30 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-03 18:27:01 -0400
commit9e7f4d451e99b7592a96ad0efaf8bcc1e7b2f854 (patch)
treebc61ead5d497222f93acebbb5cbe1debf6b758ee /kernel/mutex-debug.c
parent61f4c3d6db3ecbdd4e1a2a7a1710c1410d085dd1 (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/mutex-debug.c')
-rw-r--r--kernel/mutex-debug.c30
1 files changed, 15 insertions, 15 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
390void debug_mutex_wake_waiter(struct mutex *lock, struct mutex_waiter *waiter) 390void 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
398void debug_mutex_free_waiter(struct mutex_waiter *waiter) 398void 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
404void debug_mutex_add_waiter(struct mutex *lock, struct mutex_waiter *waiter, 404void 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,
414void mutex_remove_waiter(struct mutex *lock, struct mutex_waiter *waiter, 414void 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
426void debug_mutex_unlock(struct mutex *lock) 426void 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 */
457void fastcall mutex_destroy(struct mutex *lock) 457void 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