Commit e4587838 authored by Thomas Gleixner's avatar Thomas Gleixner

locks: Fix PREEMPT=y, LOCKBREAK=y, DEBUG_LOCK_ALLOC=n compile

Should be folded back into the atomic lock conversion
Reported-by: default avatarWill Schmidt <will_schmidt@vnet.ibm.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 6cffa489
......@@ -9,8 +9,8 @@
* (We do this in a function because inlining it would be excessive.)
*/
#define BUILD_LOCK_OPS(op, locktype) \
void __lockfunc _##op##_lock(locktype##_t *lock) \
#define BUILD_LOCK_OPS(prefix, op, locktype) \
void __lockfunc _##prefix##_lock(locktype##_t *lock) \
{ \
for (;;) { \
preempt_disable(); \
......@@ -20,15 +20,15 @@ void __lockfunc _##op##_lock(locktype##_t *lock) \
\
if (!(lock)->break_lock) \
(lock)->break_lock = 1; \
while (!op##_can_lock(lock) && (lock)->break_lock) \
while (!prefix##_can_lock(lock) && (lock)->break_lock) \
_raw_##op##_relax(&lock->raw_lock); \
} \
(lock)->break_lock = 0; \
} \
\
EXPORT_SYMBOL(_##op##_lock); \
EXPORT_SYMBOL(_##prefix##_lock); \
\
unsigned long __lockfunc _##op##_lock_irqsave(locktype##_t *lock) \
unsigned long __lockfunc _##prefix##_lock_irqsave(locktype##_t *lock) \
{ \
unsigned long flags; \
\
......@@ -42,23 +42,23 @@ unsigned long __lockfunc _##op##_lock_irqsave(locktype##_t *lock) \
\
if (!(lock)->break_lock) \
(lock)->break_lock = 1; \
while (!op##_can_lock(lock) && (lock)->break_lock) \
while (!prefix##_can_lock(lock) && (lock)->break_lock) \
_raw_##op##_relax(&lock->raw_lock); \
} \
(lock)->break_lock = 0; \
return flags; \
} \
\
EXPORT_SYMBOL(_##op##_lock_irqsave); \
EXPORT_SYMBOL(_##prefix##_lock_irqsave); \
\
void __lockfunc _##op##_lock_irq(locktype##_t *lock) \
void __lockfunc _##prefix##_lock_irq(locktype##_t *lock) \
{ \
_##op##_lock_irqsave(lock); \
_##prefix##_lock_irqsave(lock); \
} \
\
EXPORT_SYMBOL(_##op##_lock_irq); \
EXPORT_SYMBOL(_##prefix##_lock_irq); \
\
void __lockfunc _##op##_lock_bh(locktype##_t *lock) \
void __lockfunc _##prefix##_lock_bh(locktype##_t *lock) \
{ \
unsigned long flags; \
\
......@@ -67,9 +67,9 @@ void __lockfunc _##op##_lock_bh(locktype##_t *lock) \
/* irq-disabling. We use the generic preemption-aware */ \
/* function: */ \
/**/ \
flags = _##op##_lock_irqsave(lock); \
flags = _##prefix##_lock_irqsave(lock); \
local_bh_disable(); \
local_irq_restore(flags); \
} \
\
EXPORT_SYMBOL(_##op##_lock_bh)
EXPORT_SYMBOL(_##prefix##_lock_bh)
......@@ -146,8 +146,8 @@ EXPORT_SYMBOL(_write_lock);
* _[read|write]_lock_irqsave()
* _[read|write]_lock_bh()
*/
BUILD_LOCK_OPS(read, rwlock);
BUILD_LOCK_OPS(write, rwlock);
BUILD_LOCK_OPS(read, read, rwlock);
BUILD_LOCK_OPS(write, write, rwlock);
#endif /* CONFIG_PREEMPT */
......
......@@ -100,7 +100,7 @@ EXPORT_SYMBOL(_atomic_spin_lock);
* _atomic_spin_lock_irqsave()
* _atomic_spin_lock_bh()
*/
BUILD_LOCK_OPS(atomic_spin, atomic_spinlock);
BUILD_LOCK_OPS(atomic_spin, spin, atomic_spinlock);
#endif /* CONFIG_PREEMPT */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment