Commit b0f31274 authored by James Morris's avatar James Morris Committed by Linus Torvalds

[PATCH] SELinux scalability: add spin_trylock_irq and spin_trylock_irqsave

This patch from Kaigai Kohei <kaigai@ak.jp.nec.com> adds irq and irqsave
trylock spinlock variants for use by the SELinux AVC RCU patch.
Signed-off-by: default avatarKaigai Kohei <kaigai@ak.jp.nec.com>
Signed-off-by: default avatarStephen Smalley <sds@epoch.ncsc.mil>
Signed-off-by: default avatarJames Morris <jmorris@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 5e238ceb
......@@ -468,6 +468,20 @@ do { \
#define spin_trylock_bh(lock) __cond_lock(_spin_trylock_bh(lock))
#define spin_trylock_irq(lock) \
({ \
local_irq_disable(); \
_spin_trylock(lock) ? \
1 : ({local_irq_enable(); 0; }); \
})
#define spin_trylock_irqsave(lock, flags) \
({ \
local_irq_save(flags); \
_spin_trylock(lock) ? \
1 : ({local_irq_restore(flags); 0;}); \
})
#ifdef CONFIG_LOCKMETER
extern void _metered_spin_lock (spinlock_t *lock);
extern void _metered_spin_unlock (spinlock_t *lock);
......
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