aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2008-07-25 04:47:53 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-25 13:53:40 -0400
commitef1ca236b8d645349ed6569598ae3f6c1b9511c0 (patch)
treea193741b4aca43c90fcf2bf8be0d999d27b99eba /kernel/workqueue.c
parenta67da70dc0955580665f5444f318b92e69a3c272 (diff)
workqueues: queue_work() can use queue_work_on()
queue_work() can use queue_work_on() to avoid the code duplication. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 4fcb75b98443..fe08a8512ddd 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -159,14 +159,11 @@ static void __queue_work(struct cpu_workqueue_struct *cwq,
159 */ 159 */
160int queue_work(struct workqueue_struct *wq, struct work_struct *work) 160int queue_work(struct workqueue_struct *wq, struct work_struct *work)
161{ 161{
162 int ret = 0; 162 int ret;
163
164 ret = queue_work_on(get_cpu(), wq, work);
165 put_cpu();
163 166
164 if (!test_and_set_bit(WORK_STRUCT_PENDING, work_data_bits(work))) {
165 BUG_ON(!list_empty(&work->entry));
166 __queue_work(wq_per_cpu(wq, get_cpu()), work);
167 put_cpu();
168 ret = 1;
169 }
170 return ret; 167 return ret;
171} 168}
172EXPORT_SYMBOL_GPL(queue_work); 169EXPORT_SYMBOL_GPL(queue_work);