]> Pileus Git - ~andy/linux/blobdiff - kernel/workqueue_internal.h
tracing: Add "perf" trace_clock
[~andy/linux] / kernel / workqueue_internal.h
index 02549fa04587c39d77300fe3018316a5dee39ee8..07650264ec15dd3212e1fb0ec421528d99eecc83 100644 (file)
@@ -8,8 +8,8 @@
 #define _KERNEL_WORKQUEUE_INTERNAL_H
 
 #include <linux/workqueue.h>
+#include <linux/kthread.h>
 
-struct global_cwq;
 struct worker_pool;
 
 /*
@@ -28,7 +28,7 @@ struct worker {
 
        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 */
@@ -44,6 +44,16 @@ struct worker {
        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.