diff options
Diffstat (limited to 'kernel/lockdep.c')
-rw-r--r-- | kernel/lockdep.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index e4bdda8dcf04..4fa6eeb4e8a7 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c | |||
@@ -291,14 +291,12 @@ void lockdep_off(void) | |||
291 | { | 291 | { |
292 | current->lockdep_recursion++; | 292 | current->lockdep_recursion++; |
293 | } | 293 | } |
294 | |||
295 | EXPORT_SYMBOL(lockdep_off); | 294 | EXPORT_SYMBOL(lockdep_off); |
296 | 295 | ||
297 | void lockdep_on(void) | 296 | void lockdep_on(void) |
298 | { | 297 | { |
299 | current->lockdep_recursion--; | 298 | current->lockdep_recursion--; |
300 | } | 299 | } |
301 | |||
302 | EXPORT_SYMBOL(lockdep_on); | 300 | EXPORT_SYMBOL(lockdep_on); |
303 | 301 | ||
304 | /* | 302 | /* |
@@ -580,7 +578,8 @@ static void print_lock_class_header(struct lock_class *class, int depth) | |||
580 | /* | 578 | /* |
581 | * printk all lock dependencies starting at <entry>: | 579 | * printk all lock dependencies starting at <entry>: |
582 | */ | 580 | */ |
583 | static void print_lock_dependencies(struct lock_class *class, int depth) | 581 | static void __used |
582 | print_lock_dependencies(struct lock_class *class, int depth) | ||
584 | { | 583 | { |
585 | struct lock_list *entry; | 584 | struct lock_list *entry; |
586 | 585 | ||
@@ -2512,7 +2511,6 @@ void lockdep_init_map(struct lockdep_map *lock, const char *name, | |||
2512 | if (subclass) | 2511 | if (subclass) |
2513 | register_lock_class(lock, subclass, 1); | 2512 | register_lock_class(lock, subclass, 1); |
2514 | } | 2513 | } |
2515 | |||
2516 | EXPORT_SYMBOL_GPL(lockdep_init_map); | 2514 | EXPORT_SYMBOL_GPL(lockdep_init_map); |
2517 | 2515 | ||
2518 | /* | 2516 | /* |
@@ -2693,8 +2691,9 @@ static int check_unlock(struct task_struct *curr, struct lockdep_map *lock, | |||
2693 | } | 2691 | } |
2694 | 2692 | ||
2695 | static int | 2693 | static int |
2696 | __lock_set_subclass(struct lockdep_map *lock, | 2694 | __lock_set_class(struct lockdep_map *lock, const char *name, |
2697 | unsigned int subclass, unsigned long ip) | 2695 | struct lock_class_key *key, unsigned int subclass, |
2696 | unsigned long ip) | ||
2698 | { | 2697 | { |
2699 | struct task_struct *curr = current; | 2698 | struct task_struct *curr = current; |
2700 | struct held_lock *hlock, *prev_hlock; | 2699 | struct held_lock *hlock, *prev_hlock; |
@@ -2721,6 +2720,7 @@ __lock_set_subclass(struct lockdep_map *lock, | |||
2721 | return print_unlock_inbalance_bug(curr, lock, ip); | 2720 | return print_unlock_inbalance_bug(curr, lock, ip); |
2722 | 2721 | ||
2723 | found_it: | 2722 | found_it: |
2723 | lockdep_init_map(lock, name, key, 0); | ||
2724 | class = register_lock_class(lock, subclass, 0); | 2724 | class = register_lock_class(lock, subclass, 0); |
2725 | hlock->class_idx = class - lock_classes + 1; | 2725 | hlock->class_idx = class - lock_classes + 1; |
2726 | 2726 | ||
@@ -2905,9 +2905,9 @@ static void check_flags(unsigned long flags) | |||
2905 | #endif | 2905 | #endif |
2906 | } | 2906 | } |
2907 | 2907 | ||
2908 | void | 2908 | void lock_set_class(struct lockdep_map *lock, const char *name, |
2909 | lock_set_subclass(struct lockdep_map *lock, | 2909 | struct lock_class_key *key, unsigned int subclass, |
2910 | unsigned int subclass, unsigned long ip) | 2910 | unsigned long ip) |
2911 | { | 2911 | { |
2912 | unsigned long flags; | 2912 | unsigned long flags; |
2913 | 2913 | ||
@@ -2917,13 +2917,12 @@ lock_set_subclass(struct lockdep_map *lock, | |||
2917 | raw_local_irq_save(flags); | 2917 | raw_local_irq_save(flags); |
2918 | current->lockdep_recursion = 1; | 2918 | current->lockdep_recursion = 1; |
2919 | check_flags(flags); | 2919 | check_flags(flags); |
2920 | if (__lock_set_subclass(lock, subclass, ip)) | 2920 | if (__lock_set_class(lock, name, key, subclass, ip)) |
2921 | check_chain_key(current); | 2921 | check_chain_key(current); |
2922 | current->lockdep_recursion = 0; | 2922 | current->lockdep_recursion = 0; |
2923 | raw_local_irq_restore(flags); | 2923 | raw_local_irq_restore(flags); |
2924 | } | 2924 | } |
2925 | 2925 | EXPORT_SYMBOL_GPL(lock_set_class); | |
2926 | EXPORT_SYMBOL_GPL(lock_set_subclass); | ||
2927 | 2926 | ||
2928 | /* | 2927 | /* |
2929 | * We are not always called with irqs disabled - do that here, | 2928 | * We are not always called with irqs disabled - do that here, |
@@ -2947,7 +2946,6 @@ void lock_acquire(struct lockdep_map *lock, unsigned int subclass, | |||
2947 | current->lockdep_recursion = 0; | 2946 | current->lockdep_recursion = 0; |
2948 | raw_local_irq_restore(flags); | 2947 | raw_local_irq_restore(flags); |
2949 | } | 2948 | } |
2950 | |||
2951 | EXPORT_SYMBOL_GPL(lock_acquire); | 2949 | EXPORT_SYMBOL_GPL(lock_acquire); |
2952 | 2950 | ||
2953 | void lock_release(struct lockdep_map *lock, int nested, | 2951 | void lock_release(struct lockdep_map *lock, int nested, |
@@ -2965,7 +2963,6 @@ void lock_release(struct lockdep_map *lock, int nested, | |||
2965 | current->lockdep_recursion = 0; | 2963 | current->lockdep_recursion = 0; |
2966 | raw_local_irq_restore(flags); | 2964 | raw_local_irq_restore(flags); |
2967 | } | 2965 | } |
2968 | |||
2969 | EXPORT_SYMBOL_GPL(lock_release); | 2966 | EXPORT_SYMBOL_GPL(lock_release); |
2970 | 2967 | ||
2971 | #ifdef CONFIG_LOCK_STAT | 2968 | #ifdef CONFIG_LOCK_STAT |
@@ -3450,7 +3447,6 @@ retry: | |||
3450 | if (unlock) | 3447 | if (unlock) |
3451 | read_unlock(&tasklist_lock); | 3448 | read_unlock(&tasklist_lock); |
3452 | } | 3449 | } |
3453 | |||
3454 | EXPORT_SYMBOL_GPL(debug_show_all_locks); | 3450 | EXPORT_SYMBOL_GPL(debug_show_all_locks); |
3455 | 3451 | ||
3456 | /* | 3452 | /* |
@@ -3471,7 +3467,6 @@ void debug_show_held_locks(struct task_struct *task) | |||
3471 | { | 3467 | { |
3472 | __debug_show_held_locks(task); | 3468 | __debug_show_held_locks(task); |
3473 | } | 3469 | } |
3474 | |||
3475 | EXPORT_SYMBOL_GPL(debug_show_held_locks); | 3470 | EXPORT_SYMBOL_GPL(debug_show_held_locks); |
3476 | 3471 | ||
3477 | void lockdep_sys_exit(void) | 3472 | void lockdep_sys_exit(void) |