| .. | .. |
|---|
| 32 | 32 | } |
|---|
| 33 | 33 | EXPORT_SYMBOL(swake_up_locked); |
|---|
| 34 | 34 | |
|---|
| 35 | +/* |
|---|
| 36 | + * Wake up all waiters. This is an interface which is solely exposed for |
|---|
| 37 | + * completions and not for general usage. |
|---|
| 38 | + * |
|---|
| 39 | + * It is intentionally different from swake_up_all() to allow usage from |
|---|
| 40 | + * hard interrupt context and interrupt disabled regions. |
|---|
| 41 | + */ |
|---|
| 42 | +void swake_up_all_locked(struct swait_queue_head *q) |
|---|
| 43 | +{ |
|---|
| 44 | + while (!list_empty(&q->task_list)) |
|---|
| 45 | + swake_up_locked(q); |
|---|
| 46 | +} |
|---|
| 47 | + |
|---|
| 35 | 48 | void swake_up_one(struct swait_queue_head *q) |
|---|
| 36 | 49 | { |
|---|
| 37 | 50 | unsigned long flags; |
|---|
| .. | .. |
|---|
| 69 | 82 | } |
|---|
| 70 | 83 | EXPORT_SYMBOL(swake_up_all); |
|---|
| 71 | 84 | |
|---|
| 72 | | -static void __prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait) |
|---|
| 85 | +void __prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait) |
|---|
| 73 | 86 | { |
|---|
| 74 | 87 | wait->task = current; |
|---|
| 75 | 88 | if (list_empty(&wait->task_list)) |
|---|
| .. | .. |
|---|
| 93 | 106 | long ret = 0; |
|---|
| 94 | 107 | |
|---|
| 95 | 108 | raw_spin_lock_irqsave(&q->lock, flags); |
|---|
| 96 | | - if (unlikely(signal_pending_state(state, current))) { |
|---|
| 109 | + if (signal_pending_state(state, current)) { |
|---|
| 97 | 110 | /* |
|---|
| 98 | 111 | * See prepare_to_wait_event(). TL;DR, subsequent swake_up_one() |
|---|
| 99 | 112 | * must not see us. |
|---|