#define _KERNEL_WORKQUEUE_INTERNAL_H
#include <linux/workqueue.h>
+#include <linux/kthread.h>
-struct global_cwq;
struct worker_pool;
/*
struct work_struct *current_work; /* L: work being processed */
work_func_t current_func; /* L: current_work's fn */
- struct cpu_workqueue_struct *current_cwq; /* L: current_work's cwq */
+ struct pool_workqueue *current_pwq; /* L: current_work's pwq */
struct list_head scheduled; /* L: scheduled works */
struct task_struct *task; /* I: worker task */
struct worker_pool *pool; /* I: the associated pool */
struct workqueue_struct *rescue_wq; /* I: the workqueue to rescue */
};
+/**
+ * current_wq_worker - return struct worker if %current is a workqueue worker
+ */
+static inline struct worker *current_wq_worker(void)
+{
+ if (current->flags & PF_WQ_WORKER)
+ return kthread_data(current);
+ return NULL;
+}
+
/*
* Scheduler hooks for concurrency managed workqueue. Only to be used from
* sched.c and workqueue.c.