aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorLai Jiangshan <laijs@cn.fujitsu.com>2015-05-20 02:41:19 -0400
committerTejun Heo <tj@kernel.org>2015-05-21 17:26:22 -0400
commit37b1ef31a568fc02e53587620226e5f3c66454c8 (patch)
treea6aba27cbbf72c03ae9f773a46230861fd0c2eac /kernel/workqueue.c
parent899a94fe15a8e928277ff0d0402c086fa67fe16f (diff)
workqueue: move flush_scheduled_work() to workqueue.h
flush_scheduled_work() is just a simple call to flush_work(). Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index ad8dc2b9efc3..c9eaa4e5c867 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -2959,36 +2959,6 @@ int schedule_on_each_cpu(work_func_t func)
2959} 2959}
2960 2960
2961/** 2961/**
2962 * flush_scheduled_work - ensure that any scheduled work has run to completion.
2963 *
2964 * Forces execution of the kernel-global workqueue and blocks until its
2965 * completion.
2966 *
2967 * Think twice before calling this function! It's very easy to get into
2968 * trouble if you don't take great care. Either of the following situations
2969 * will lead to deadlock:
2970 *
2971 * One of the work items currently on the workqueue needs to acquire
2972 * a lock held by your code or its caller.
2973 *
2974 * Your code is running in the context of a work routine.
2975 *
2976 * They will be detected by lockdep when they occur, but the first might not
2977 * occur very often. It depends on what work items are on the workqueue and
2978 * what locks they need, which you have no control over.
2979 *
2980 * In most situations flushing the entire workqueue is overkill; you merely
2981 * need to know that a particular work item isn't queued and isn't running.
2982 * In such cases you should use cancel_delayed_work_sync() or
2983 * cancel_work_sync() instead.
2984 */
2985void flush_scheduled_work(void)
2986{
2987 flush_workqueue(system_wq);
2988}
2989EXPORT_SYMBOL(flush_scheduled_work);
2990
2991/**
2992 * execute_in_process_context - reliably execute the routine with user context 2962 * execute_in_process_context - reliably execute the routine with user context
2993 * @fn: the function to execute 2963 * @fn: the function to execute
2994 * @ew: guaranteed storage for the execute work structure (must 2964 * @ew: guaranteed storage for the execute work structure (must