aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorJames Morris <james.morris@microsoft.com>2018-03-22 17:26:16 -0400
committerJames Morris <james.morris@microsoft.com>2018-03-22 17:26:16 -0400
commit5893ed18a26d1f56b97c0290b0cbbc2d49d6de28 (patch)
tree97aa931519fca28a0a12fad7485347198f8267cc /kernel/workqueue.c
parent7bd698b3c04e61ee9e03d4c2a55003f75df14dca (diff)
parentc698ca5278934c0ae32297a8725ced2e27585d7f (diff)
Merge tag 'v4.16-rc6' into next-general
Merge to Linux 4.16-rc6 at the request of Jarkko, for his TPM updates.
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c16
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)
4180EXPORT_SYMBOL_GPL(workqueue_set_max_active); 4180EXPORT_SYMBOL_GPL(workqueue_set_max_active);
4181 4181
4182/** 4182/**
4183 * current_work - retrieve %current task's work struct
4184 *
4185 * Determine if %current task is a workqueue worker and what it's working on.
4186 * Useful to find out the context that the %current task is running in.
4187 *
4188 * Return: work struct if %current task is a workqueue worker, %NULL otherwise.
4189 */
4190struct work_struct *current_work(void)
4191{
4192 struct worker *worker = current_wq_worker();
4193
4194 return worker ? worker->current_work : NULL;
4195}
4196EXPORT_SYMBOL(current_work);
4197
4198/**
4183 * current_is_workqueue_rescuer - is %current workqueue rescuer? 4199 * current_is_workqueue_rescuer - is %current workqueue rescuer?
4184 * 4200 *
4185 * Determine whether %current is a workqueue rescuer. Can be used from 4201 * Determine whether %current is a workqueue rescuer. Can be used from