diff options
Diffstat (limited to 'include/linux/lglock.h')
| -rw-r--r-- | include/linux/lglock.h | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/include/linux/lglock.h b/include/linux/lglock.h index f01e5f6d1f07..0d24e932db0b 100644 --- a/include/linux/lglock.h +++ b/include/linux/lglock.h | |||
| @@ -32,20 +32,13 @@ | |||
| 32 | #define br_write_lock(name) lg_global_lock(name) | 32 | #define br_write_lock(name) lg_global_lock(name) |
| 33 | #define br_write_unlock(name) lg_global_unlock(name) | 33 | #define br_write_unlock(name) lg_global_unlock(name) |
| 34 | 34 | ||
| 35 | #define DEFINE_BRLOCK(name) DEFINE_LGLOCK(name) | 35 | #define DEFINE_BRLOCK(name) DEFINE_LGLOCK(name) |
| 36 | #define DEFINE_STATIC_BRLOCK(name) DEFINE_STATIC_LGLOCK(name) | ||
| 36 | 37 | ||
| 37 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 38 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
| 38 | #define LOCKDEP_INIT_MAP lockdep_init_map | 39 | #define LOCKDEP_INIT_MAP lockdep_init_map |
| 39 | |||
| 40 | #define DEFINE_LGLOCK_LOCKDEP(name) \ | ||
| 41 | struct lock_class_key name##_lock_key; \ | ||
| 42 | struct lockdep_map name##_lock_dep_map; \ | ||
| 43 | EXPORT_SYMBOL(name##_lock_dep_map) | ||
| 44 | |||
| 45 | #else | 40 | #else |
| 46 | #define LOCKDEP_INIT_MAP(a, b, c, d) | 41 | #define LOCKDEP_INIT_MAP(a, b, c, d) |
| 47 | |||
| 48 | #define DEFINE_LGLOCK_LOCKDEP(name) | ||
| 49 | #endif | 42 | #endif |
| 50 | 43 | ||
| 51 | struct lglock { | 44 | struct lglock { |
| @@ -57,11 +50,15 @@ struct lglock { | |||
| 57 | }; | 50 | }; |
| 58 | 51 | ||
| 59 | #define DEFINE_LGLOCK(name) \ | 52 | #define DEFINE_LGLOCK(name) \ |
| 60 | DEFINE_LGLOCK_LOCKDEP(name); \ | 53 | static DEFINE_PER_CPU(arch_spinlock_t, name ## _lock) \ |
| 61 | DEFINE_PER_CPU(arch_spinlock_t, name ## _lock) \ | ||
| 62 | = __ARCH_SPIN_LOCK_UNLOCKED; \ | 54 | = __ARCH_SPIN_LOCK_UNLOCKED; \ |
| 63 | struct lglock name = { .lock = &name ## _lock } | 55 | struct lglock name = { .lock = &name ## _lock } |
| 64 | 56 | ||
| 57 | #define DEFINE_STATIC_LGLOCK(name) \ | ||
| 58 | static DEFINE_PER_CPU(arch_spinlock_t, name ## _lock) \ | ||
| 59 | = __ARCH_SPIN_LOCK_UNLOCKED; \ | ||
| 60 | static struct lglock name = { .lock = &name ## _lock } | ||
| 61 | |||
| 65 | void lg_lock_init(struct lglock *lg, char *name); | 62 | void lg_lock_init(struct lglock *lg, char *name); |
| 66 | void lg_local_lock(struct lglock *lg); | 63 | void lg_local_lock(struct lglock *lg); |
| 67 | void lg_local_unlock(struct lglock *lg); | 64 | void lg_local_unlock(struct lglock *lg); |
