Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

locking/local_lock: Expose dep_map in local_trylock_t.

lockdep_is_held() macro assumes that "struct lockdep_map dep_map;"
is a top level field of any lock that participates in LOCKDEP.
Make it so for local_trylock_t.

Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Harry Yoo <harry.yoo@oracle.com>
Reviewed-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>

authored by

Alexei Starovoitov and committed by
Vlastimil Babka
212b0f07 1b237f19

+6 -3
+6 -3
include/linux/local_lock_internal.h
··· 17 17 18 18 /* local_trylock() and local_trylock_irqsave() only work with local_trylock_t */ 19 19 typedef struct { 20 - local_lock_t llock; 20 + #ifdef CONFIG_DEBUG_LOCK_ALLOC 21 + struct lockdep_map dep_map; 22 + struct task_struct *owner; 23 + #endif 21 24 u8 acquired; 22 25 } local_trylock_t; 23 26 ··· 34 31 .owner = NULL, 35 32 36 33 # define LOCAL_TRYLOCK_DEBUG_INIT(lockname) \ 37 - .llock = { LOCAL_LOCK_DEBUG_INIT((lockname).llock) }, 34 + LOCAL_LOCK_DEBUG_INIT(lockname) 38 35 39 36 static inline void local_lock_acquire(local_lock_t *l) 40 37 { ··· 84 81 local_lock_debug_init(lock); \ 85 82 } while (0) 86 83 87 - #define __local_trylock_init(lock) __local_lock_init(lock.llock) 84 + #define __local_trylock_init(lock) __local_lock_init((local_lock_t *)lock) 88 85 89 86 #define __spinlock_nested_bh_init(lock) \ 90 87 do { \