diff options
Diffstat (limited to 'include/linux/mutex.h')
-rw-r--r-- | include/linux/mutex.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index 94b48bd40dd7..a940fe435aca 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
@@ -51,7 +51,7 @@ struct mutex { | |||
51 | spinlock_t wait_lock; | 51 | spinlock_t wait_lock; |
52 | struct list_head wait_list; | 52 | struct list_head wait_list; |
53 | #if defined(CONFIG_DEBUG_MUTEXES) || defined(CONFIG_SMP) | 53 | #if defined(CONFIG_DEBUG_MUTEXES) || defined(CONFIG_SMP) |
54 | struct thread_info *owner; | 54 | struct task_struct *owner; |
55 | #endif | 55 | #endif |
56 | #ifdef CONFIG_DEBUG_MUTEXES | 56 | #ifdef CONFIG_DEBUG_MUTEXES |
57 | const char *name; | 57 | const char *name; |
@@ -132,6 +132,7 @@ static inline int mutex_is_locked(struct mutex *lock) | |||
132 | */ | 132 | */ |
133 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 133 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
134 | extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass); | 134 | extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass); |
135 | extern void _mutex_lock_nest_lock(struct mutex *lock, struct lockdep_map *nest_lock); | ||
135 | extern int __must_check mutex_lock_interruptible_nested(struct mutex *lock, | 136 | extern int __must_check mutex_lock_interruptible_nested(struct mutex *lock, |
136 | unsigned int subclass); | 137 | unsigned int subclass); |
137 | extern int __must_check mutex_lock_killable_nested(struct mutex *lock, | 138 | extern int __must_check mutex_lock_killable_nested(struct mutex *lock, |
@@ -140,6 +141,13 @@ extern int __must_check mutex_lock_killable_nested(struct mutex *lock, | |||
140 | #define mutex_lock(lock) mutex_lock_nested(lock, 0) | 141 | #define mutex_lock(lock) mutex_lock_nested(lock, 0) |
141 | #define mutex_lock_interruptible(lock) mutex_lock_interruptible_nested(lock, 0) | 142 | #define mutex_lock_interruptible(lock) mutex_lock_interruptible_nested(lock, 0) |
142 | #define mutex_lock_killable(lock) mutex_lock_killable_nested(lock, 0) | 143 | #define mutex_lock_killable(lock) mutex_lock_killable_nested(lock, 0) |
144 | |||
145 | #define mutex_lock_nest_lock(lock, nest_lock) \ | ||
146 | do { \ | ||
147 | typecheck(struct lockdep_map *, &(nest_lock)->dep_map); \ | ||
148 | _mutex_lock_nest_lock(lock, &(nest_lock)->dep_map); \ | ||
149 | } while (0) | ||
150 | |||
143 | #else | 151 | #else |
144 | extern void mutex_lock(struct mutex *lock); | 152 | extern void mutex_lock(struct mutex *lock); |
145 | extern int __must_check mutex_lock_interruptible(struct mutex *lock); | 153 | extern int __must_check mutex_lock_interruptible(struct mutex *lock); |
@@ -148,6 +156,7 @@ extern int __must_check mutex_lock_killable(struct mutex *lock); | |||
148 | # define mutex_lock_nested(lock, subclass) mutex_lock(lock) | 156 | # define mutex_lock_nested(lock, subclass) mutex_lock(lock) |
149 | # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock) | 157 | # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock) |
150 | # define mutex_lock_killable_nested(lock, subclass) mutex_lock_killable(lock) | 158 | # define mutex_lock_killable_nested(lock, subclass) mutex_lock_killable(lock) |
159 | # define mutex_lock_nest_lock(lock, nest_lock) mutex_lock(lock) | ||
151 | #endif | 160 | #endif |
152 | 161 | ||
153 | /* | 162 | /* |