aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2019-08-08 08:47:14 +0200
committerPeter Zijlstra <peterz@infradead.org>2019-08-08 09:09:25 +0200
commite57d143091f1c0b1a98140a4d2e63e113afb62c0 (patch)
tree1100b05a0b77cb5f9b91baa2b412b6940076b106
parentlocking/mutex: Use mutex flags macro instead of hard code (diff)
downloadlinux-dev-e57d143091f1c0b1a98140a4d2e63e113afb62c0.tar.xz
linux-dev-e57d143091f1c0b1a98140a4d2e63e113afb62c0.zip
mutex: Fix up mutex_waiter usage
The patch moving bits into mutex.c was a little too much; by also moving struct mutex_waiter a few less common CONFIGs would no longer build. Fixes: 5f35d5a66b3e ("locking/mutex: Make __mutex_owner static to mutex.c") Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
-rw-r--r--include/linux/mutex.h13
-rw-r--r--kernel/locking/mutex.c13
-rw-r--r--kernel/locking/mutex.h2
3 files changed, 13 insertions, 15 deletions
diff --git a/include/linux/mutex.h b/include/linux/mutex.h
index eb8c62aba263..aca8f36dfac9 100644
--- a/include/linux/mutex.h
+++ b/include/linux/mutex.h
@@ -65,6 +65,19 @@ struct mutex {
#endif
};
+/*
+ * This is the control structure for tasks blocked on mutex,
+ * which resides on the blocked task's kernel stack:
+ */
+struct mutex_waiter {
+ struct list_head list;
+ struct task_struct *task;
+ struct ww_acquire_ctx *ww_ctx;
+#ifdef CONFIG_DEBUG_MUTEXES
+ void *magic;
+#endif
+};
+
#ifdef CONFIG_DEBUG_MUTEXES
#define __DEBUG_MUTEX_INITIALIZER(lockname) \
diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c
index b4bcb0236d7a..468a9b8422e3 100644
--- a/kernel/locking/mutex.c
+++ b/kernel/locking/mutex.c
@@ -36,19 +36,6 @@
# include "mutex.h"
#endif
-/*
- * This is the control structure for tasks blocked on mutex,
- * which resides on the blocked task's kernel stack:
- */
-struct mutex_waiter {
- struct list_head list;
- struct task_struct *task;
- struct ww_acquire_ctx *ww_ctx;
-#ifdef CONFIG_DEBUG_MUTEXES
- void *magic;
-#endif
-};
-
void
__mutex_init(struct mutex *lock, const char *name, struct lock_class_key *key)
{
diff --git a/kernel/locking/mutex.h b/kernel/locking/mutex.h
index 7cde5c6d414e..1c2287d3fa71 100644
--- a/kernel/locking/mutex.h
+++ b/kernel/locking/mutex.h
@@ -19,8 +19,6 @@
#define debug_mutex_unlock(lock) do { } while (0)
#define debug_mutex_init(lock, name, key) do { } while (0)
-struct mutex_waiter;
-
static inline void
debug_mutex_lock_common(struct mutex *lock, struct mutex_waiter *waiter)
{