.. | .. |
---|
28 | 28 | unsigned int is_wait_die; |
---|
29 | 29 | }; |
---|
30 | 30 | |
---|
| 31 | +struct ww_mutex { |
---|
| 32 | + struct mutex base; |
---|
| 33 | + struct ww_acquire_ctx *ctx; |
---|
| 34 | +#ifdef CONFIG_DEBUG_MUTEXES |
---|
| 35 | + struct ww_class *ww_class; |
---|
| 36 | +#endif |
---|
| 37 | +}; |
---|
| 38 | + |
---|
31 | 39 | struct ww_acquire_ctx { |
---|
32 | 40 | struct task_struct *task; |
---|
33 | 41 | unsigned long stamp; |
---|
.. | .. |
---|
45 | 53 | #ifdef CONFIG_DEBUG_WW_MUTEX_SLOWPATH |
---|
46 | 54 | unsigned int deadlock_inject_interval; |
---|
47 | 55 | unsigned int deadlock_inject_countdown; |
---|
48 | | -#endif |
---|
49 | | -}; |
---|
50 | | - |
---|
51 | | -struct ww_mutex { |
---|
52 | | - struct mutex base; |
---|
53 | | - struct ww_acquire_ctx *ctx; |
---|
54 | | -#ifdef CONFIG_DEBUG_MUTEXES |
---|
55 | | - struct ww_class *ww_class; |
---|
56 | 56 | #endif |
---|
57 | 57 | }; |
---|
58 | 58 | |
---|
.. | .. |
---|
181 | 181 | */ |
---|
182 | 182 | static inline void ww_acquire_fini(struct ww_acquire_ctx *ctx) |
---|
183 | 183 | { |
---|
| 184 | +#ifdef CONFIG_DEBUG_LOCK_ALLOC |
---|
| 185 | + mutex_release(&ctx->dep_map, _THIS_IP_); |
---|
| 186 | +#endif |
---|
184 | 187 | #ifdef CONFIG_DEBUG_MUTEXES |
---|
185 | | - mutex_release(&ctx->dep_map, 0, _THIS_IP_); |
---|
186 | | - |
---|
187 | 188 | DEBUG_LOCKS_WARN_ON(ctx->acquired); |
---|
188 | 189 | if (!IS_ENABLED(CONFIG_PROVE_LOCKING)) |
---|
189 | 190 | /* |
---|