| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * lib/debug_locks.c |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 21 | 22 | * that would just muddy the log. So we report the first one and |
|---|
| 22 | 23 | * shut up after that. |
|---|
| 23 | 24 | */ |
|---|
| 24 | | -int debug_locks = 1; |
|---|
| 25 | +int debug_locks __read_mostly = 1; |
|---|
| 25 | 26 | EXPORT_SYMBOL_GPL(debug_locks); |
|---|
| 26 | 27 | |
|---|
| 27 | 28 | /* |
|---|
| .. | .. |
|---|
| 29 | 30 | * 'silent failure': nothing is printed to the console when |
|---|
| 30 | 31 | * a locking bug is detected. |
|---|
| 31 | 32 | */ |
|---|
| 32 | | -int debug_locks_silent; |
|---|
| 33 | +int debug_locks_silent __read_mostly; |
|---|
| 33 | 34 | EXPORT_SYMBOL_GPL(debug_locks_silent); |
|---|
| 34 | 35 | |
|---|
| 35 | 36 | /* |
|---|
| .. | .. |
|---|
| 37 | 38 | */ |
|---|
| 38 | 39 | int debug_locks_off(void) |
|---|
| 39 | 40 | { |
|---|
| 40 | | - if (debug_locks && __debug_locks_off()) { |
|---|
| 41 | | - if (!debug_locks_silent) { |
|---|
| 42 | | - console_verbose(); |
|---|
| 43 | | - return 1; |
|---|
| 44 | | - } |
|---|
| 45 | | - } |
|---|
| 41 | + if (debug_locks && __debug_locks_off() && !debug_locks_silent) |
|---|
| 42 | + return 1; |
|---|
| 46 | 43 | return 0; |
|---|
| 47 | 44 | } |
|---|
| 48 | 45 | EXPORT_SYMBOL_GPL(debug_locks_off); |
|---|