locking/rwsem, security/apparmor: Replace homebrew use of write_can_lock() with lockdep
The lockdep subsystem provides a robust way to assert that a lock is held, so use that instead of write_can_lock, which can give incorrect results for qrwlocks. Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: John Johansen <john.johansen@canonical.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: paulmck@linux.vnet.ibm.com Link: http://lkml.kernel.org/r/1507055129-12300-1-git-send-email-will.deacon@arm.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
@@ -19,17 +19,6 @@
|
||||
|
||||
#include "match.h"
|
||||
|
||||
/* Provide our own test for whether a write lock is held for asserts
|
||||
* this is because on none SMP systems write_can_lock will always
|
||||
* resolve to true, which is what you want for code making decisions
|
||||
* based on it, but wrong for asserts checking that the lock is held
|
||||
*/
|
||||
#ifdef CONFIG_SMP
|
||||
#define write_is_locked(X) !write_can_lock(X)
|
||||
#else
|
||||
#define write_is_locked(X) (1)
|
||||
#endif /* CONFIG_SMP */
|
||||
|
||||
/*
|
||||
* DEBUG remains global (no per profile flag) since it is mostly used in sysctl
|
||||
* which is not related to profile accesses.
|
||||
|
Reference in New Issue
Block a user