aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/wait.h9
-rw-r--r--kernel/wait.c14
2 files changed, 2 insertions, 21 deletions
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 0081147a9fe8..ef609f842fac 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -108,15 +108,6 @@ static inline int waitqueue_active(wait_queue_head_t *q)
108 return !list_empty(&q->task_list); 108 return !list_empty(&q->task_list);
109} 109}
110 110
111/*
112 * Used to distinguish between sync and async io wait context:
113 * sync i/o typically specifies a NULL wait queue entry or a wait
114 * queue entry bound to a task (current task) to wake up.
115 * aio specifies a wait queue entry with an async notification
116 * callback routine, not associated with any task.
117 */
118#define is_sync_wait(wait) (!(wait) || ((wait)->private))
119
120extern void add_wait_queue(wait_queue_head_t *q, wait_queue_t *wait); 111extern void add_wait_queue(wait_queue_head_t *q, wait_queue_t *wait);
121extern void add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t *wait); 112extern void add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t *wait);
122extern void remove_wait_queue(wait_queue_head_t *q, wait_queue_t *wait); 113extern void remove_wait_queue(wait_queue_head_t *q, wait_queue_t *wait);
diff --git a/kernel/wait.c b/kernel/wait.c
index c275c56cf2d3..cd87131f2fc2 100644
--- a/kernel/wait.c
+++ b/kernel/wait.c
@@ -72,12 +72,7 @@ prepare_to_wait(wait_queue_head_t *q, wait_queue_t *wait, int state)
72 spin_lock_irqsave(&q->lock, flags); 72 spin_lock_irqsave(&q->lock, flags);
73 if (list_empty(&wait->task_list)) 73 if (list_empty(&wait->task_list))
74 __add_wait_queue(q, wait); 74 __add_wait_queue(q, wait);
75 /* 75 set_current_state(state);
76 * don't alter the task state if this is just going to
77 * queue an async wait queue callback
78 */
79 if (is_sync_wait(wait))
80 set_current_state(state);
81 spin_unlock_irqrestore(&q->lock, flags); 76 spin_unlock_irqrestore(&q->lock, flags);
82} 77}
83EXPORT_SYMBOL(prepare_to_wait); 78EXPORT_SYMBOL(prepare_to_wait);
@@ -91,12 +86,7 @@ prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int state)
91 spin_lock_irqsave(&q->lock, flags); 86 spin_lock_irqsave(&q->lock, flags);
92 if (list_empty(&wait->task_list)) 87 if (list_empty(&wait->task_list))
93 __add_wait_queue_tail(q, wait); 88 __add_wait_queue_tail(q, wait);
94 /* 89 set_current_state(state);
95 * don't alter the task state if this is just going to
96 * queue an async wait queue callback
97 */
98 if (is_sync_wait(wait))
99 set_current_state(state);
100 spin_unlock_irqrestore(&q->lock, flags); 90 spin_unlock_irqrestore(&q->lock, flags);
101} 91}
102EXPORT_SYMBOL(prepare_to_wait_exclusive); 92EXPORT_SYMBOL(prepare_to_wait_exclusive);