History

futex: Allow for compiling out PI support

This makes it possible to preserve basic futex support and compile out the PI support when RT mutexes are not available.

Nicolas Pitre committed 9 years ago

Commit bc2eecd1 parent f06e8c54 files · +63 −2Browse files

Showing the changes to kernel/locking (1 of 4 files). Show all

Unified · Split

kernel/locking/rtmutex_common.h+29−0
@@ -40,6 +40,9 @@ struct rt_mutex_waiter { · 39 unmodified lines
4040 /*
4141 * Various helpers to access the waiters-tree:
4242 */
43+
44+#ifdef CONFIG_RT_MUTEXES
45+
4346 static inline int rt_mutex_has_waiters(struct rt_mutex *lock)
4447 {
4548 return !RB_EMPTY_ROOT(&lock->waiters);
@@ -69,6 +72,32 @@ task_top_pi_waiter(struct task_struct *p) · 23 unmodified lines
6972 pi_tree_entry);
7073 }
7174
75+#else
76+
77+static inline int rt_mutex_has_waiters(struct rt_mutex *lock)
78+{
79+ return false;
80+}
81+
82+static inline struct rt_mutex_waiter *
83+rt_mutex_top_waiter(struct rt_mutex *lock)
84+{
85+ return NULL;
86+}
87+
88+static inline int task_has_pi_waiters(struct task_struct *p)
89+{
90+ return false;
91+}
92+
93+static inline struct rt_mutex_waiter *
94+task_top_pi_waiter(struct task_struct *p)
95+{
96+ return NULL;
97+}
98+
99+#endif
100+
72101 /*
73102 * lock->owner state tracking:
74103 */