[PATCH v2 2/2] sched/wait: Pass wq_flags to __wait_event_interruptible_locked()
From: Mani Tofigh via B4 Relay
Date: Sun Nov 22 2026 - 19:35:34 EST
From: Mani Tofigh <mt4022@xxxxxxxxxxxx>
Commit cea5f91daa3a ("wait-event: clean up the internal helper
arguments") made ___wait_event() take the wait entry's flags instead of
a 0/1 argument for whether it is exclusive.
__wait_event_interruptible_locked() still takes the 0/1 argument.
Pass wq_flags here too, so the _exclusive_locked variants say
WQ_FLAG_EXCLUSIVE rather than an unexplained 1.
No functional change.
Signed-off-by: Mani Tofigh <mt4022@xxxxxxxxxxxx>
---
include/linux/wait.h | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/include/linux/wait.h b/include/linux/wait.h
index b3e94c71cd3e..6c039d92c770 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -770,12 +770,11 @@ do { \
extern int do_wait_intr(wait_queue_head_t *, wait_queue_entry_t *);
extern int do_wait_intr_irq(wait_queue_head_t *, wait_queue_entry_t *);
-#define __wait_event_interruptible_locked(wq, condition, exclusive, fn) \
+#define __wait_event_interruptible_locked(wq, condition, wq_flags, fn) \
({ \
int __ret; \
DEFINE_WAIT(__wait); \
- if (exclusive) \
- __wait.flags |= WQ_FLAG_EXCLUSIVE; \
+ __wait.flags = (wq_flags); \
do { \
__ret = fn(&(wq), &__wait); \
if (__ret) \
@@ -870,7 +869,8 @@ extern int do_wait_intr_irq(wait_queue_head_t *, wait_queue_entry_t *);
*/
#define wait_event_interruptible_exclusive_locked(wq, condition) \
((condition) \
- ? 0 : __wait_event_interruptible_locked(wq, condition, 1, do_wait_intr))
+ ? 0 : __wait_event_interruptible_locked(wq, condition, \
+ WQ_FLAG_EXCLUSIVE, do_wait_intr))
/**
* wait_event_interruptible_exclusive_locked_irq - sleep until a condition gets true
@@ -901,7 +901,8 @@ extern int do_wait_intr_irq(wait_queue_head_t *, wait_queue_entry_t *);
*/
#define wait_event_interruptible_exclusive_locked_irq(wq, condition) \
((condition) \
- ? 0 : __wait_event_interruptible_locked(wq, condition, 1, do_wait_intr_irq))
+ ? 0 : __wait_event_interruptible_locked(wq, condition, \
+ WQ_FLAG_EXCLUSIVE, do_wait_intr_irq))
#define __wait_event_killable(wq, condition) \
--
2.53.0