Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1481197b50114d7212d659d41cb97f31a8934883
Commit:     1481197b50114d7212d659d41cb97f31a8934883
Parent:     bdb9441e9c325d50b5ae17f7d3205d65b8ed2e5f
Author:     Dale Farnsworth <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 25 23:03:02 2008 +0100
Committer:  Peter Zijlstra <[EMAIL PROTECTED]>
CommitDate: Mon Feb 25 23:03:02 2008 +0100

    Subject: lockdep: include all lock classes in all_lock_classes
    Add each lock class to the all_lock_classes list when it is
    first registered.
    
    Previously, lock classes were added to all_lock_classes when
    the lock class was first used.  Since one of the uses of the
    list is to find unused locks, this didn't work well.
    
    Signed-off-by: Dale Farnsworth <[EMAIL PROTECTED]>
    Signed-off-by: Peter Zijlstra <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
---
 kernel/lockdep.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index 3574379..81a4e4a 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -779,6 +779,10 @@ register_lock_class(struct lockdep_map *lock, unsigned int 
subclass, int force)
         * parallel walking of the hash-list safe:
         */
        list_add_tail_rcu(&class->hash_entry, hash_head);
+       /*
+        * Add it to the global list of classes:
+        */
+       list_add_tail_rcu(&class->lock_entry, &all_lock_classes);
 
        if (verbose(class)) {
                graph_unlock();
@@ -2282,10 +2286,6 @@ static int mark_lock(struct task_struct *curr, struct 
held_lock *this,
                        return 0;
                break;
        case LOCK_USED:
-               /*
-                * Add it to the global list of classes:
-                */
-               list_add_tail_rcu(&this->class->lock_entry, &all_lock_classes);
                debug_atomic_dec(&nr_unused_locks);
                break;
        default:
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to