diff options
| author | Ingo Molnar <[email protected]> | 2018-03-20 10:01:37 +0100 |
|---|---|---|
| committer | Ingo Molnar <[email protected]> | 2018-03-20 10:01:37 +0100 |
| commit | 3eb93ea3272d428aab3c03e2dd272a78a7729ba8 (patch) | |
| tree | 63ca8b7e7feccb109f4b5cb868939da395c7632f /kernel/workqueue.c | |
| parent | 5927145efd5de71976e62e2822511b13014d7e56 (diff) | |
| parent | 565977a3d929fc4427769117a8ac976ec16776d5 (diff) | |
Merge branch 'x86/mm' into x86/dma, to pick up dependencies
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'kernel/workqueue.c')
| -rw-r--r-- | kernel/workqueue.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 017044c26233..bb9a519cbf50 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -4180,6 +4180,22 @@ void workqueue_set_max_active(struct workqueue_struct *wq, int max_active) EXPORT_SYMBOL_GPL(workqueue_set_max_active); /** + * current_work - retrieve %current task's work struct + * + * Determine if %current task is a workqueue worker and what it's working on. + * Useful to find out the context that the %current task is running in. + * + * Return: work struct if %current task is a workqueue worker, %NULL otherwise. + */ +struct work_struct *current_work(void) +{ + struct worker *worker = current_wq_worker(); + + return worker ? worker->current_work : NULL; +} +EXPORT_SYMBOL(current_work); + +/** * current_is_workqueue_rescuer - is %current workqueue rescuer? * * Determine whether %current is a workqueue rescuer. Can be used from |