[PATCH] efs: Remove incorrect unlock_kernel from failure path in efs_symlink_readpage()
[linux-2.6.git] / include / linux / debug_locks.h
blob6a7047851e48b8174ffa0360e95e056a5d9921fa
1 #ifndef __LINUX_DEBUG_LOCKING_H
2 #define __LINUX_DEBUG_LOCKING_H
4 extern int debug_locks;
5 extern int debug_locks_silent;
7 /*
8 * Generic 'turn off all lock debugging' function:
9 */
10 extern int debug_locks_off(void);
13 * In the debug case we carry the caller's instruction pointer into
14 * other functions, but we dont want the function argument overhead
15 * in the nondebug case - hence these macros:
17 #define _RET_IP_ (unsigned long)__builtin_return_address(0)
18 #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; })
20 #define DEBUG_LOCKS_WARN_ON(c) \
21 ({ \
22 int __ret = 0; \
24 if (unlikely(c)) { \
25 if (debug_locks_off()) \
26 WARN_ON(1); \
27 __ret = 1; \
28 } \
29 __ret; \
32 #ifdef CONFIG_SMP
33 # define SMP_DEBUG_LOCKS_WARN_ON(c) DEBUG_LOCKS_WARN_ON(c)
34 #else
35 # define SMP_DEBUG_LOCKS_WARN_ON(c) do { } while (0)
36 #endif
38 #ifdef CONFIG_DEBUG_LOCKING_API_SELFTESTS
39 extern void locking_selftest(void);
40 #else
41 # define locking_selftest() do { } while (0)
42 #endif
44 #ifdef CONFIG_LOCKDEP
45 extern void debug_show_all_locks(void);
46 extern void debug_show_held_locks(struct task_struct *task);
47 extern void debug_check_no_locks_freed(const void *from, unsigned long len);
48 extern void debug_check_no_locks_held(struct task_struct *task);
49 #else
50 static inline void debug_show_all_locks(void)
54 static inline void debug_show_held_locks(struct task_struct *task)
58 static inline void
59 debug_check_no_locks_freed(const void *from, unsigned long len)
63 static inline void
64 debug_check_no_locks_held(struct task_struct *task)
67 #endif
69 #endif