summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/spinlock.h18
-rw-r--r--include/linux/spinlock_api_smp.h2
2 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 54ad37089c49..57f670d78f7c 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -199,6 +199,21 @@ do { \
BUILD_CHECK_IRQ_FLAGS(flags); \
flags = _write_lock_irqsave(lock); \
} while (0)
+
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+#define spin_lock_irqsave_nested(lock, flags, subclass) \
+ do { \
+ BUILD_CHECK_IRQ_FLAGS(flags); \
+ flags = _spin_lock_irqsave_nested(lock, subclass); \
+ } while (0)
+#else
+#define spin_lock_irqsave_nested(lock, flags, subclass) \
+ do { \
+ BUILD_CHECK_IRQ_FLAGS(flags); \
+ flags = _spin_lock_irqsave(lock); \
+ } while (0)
+#endif
+
#else
#define spin_lock_irqsave(lock, flags) \
do { \
@@ -215,6 +230,9 @@ do { \
BUILD_CHECK_IRQ_FLAGS(flags); \
_write_lock_irqsave(lock, flags); \
} while (0)
+#define spin_lock_irqsave_nested(lock, flags, subclass) \
+ spin_lock_irqsave(lock, flags)
+
#endif
#define spin_lock_irq(lock) _spin_lock_irq(lock)
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h
index 8828b8155e9c..8a2307ce7296 100644
--- a/include/linux/spinlock_api_smp.h
+++ b/include/linux/spinlock_api_smp.h
@@ -32,6 +32,8 @@ void __lockfunc _read_lock_irq(rwlock_t *lock) __acquires(lock);
void __lockfunc _write_lock_irq(rwlock_t *lock) __acquires(lock);
unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock)
__acquires(lock);
+unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclass)
+ __acquires(lock);
unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock)
__acquires(lock);
unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock)
OpenPOWER on IntegriCloud