diff options
| author | 2018-03-08 15:52:08 +0100 | |
|---|---|---|
| committer | 2018-03-08 15:52:08 +0100 | |
| commit | 422caa5f7a455920369039d04c6070eb50d6146b (patch) | |
| tree | 8667d9587c412ee25660184f6e943ed10e445bc0 /kernel/workqueue.c | |
| parent | x86/mce/AMD: Carve out SMCA get_block_address() code (diff) | |
| parent | x86/MCE: Serialize sysfs changes (diff) | |
Merge branch 'ras/urgent' into ras/core
Pick up urgent fixes to apply further development changes.
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 |
