]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - include/linux/kthread.h
treewide: Remove TIMER_FUNC_TYPE and TIMER_DATA_TYPE casts
[mirror_ubuntu-bionic-kernel.git] / include / linux / kthread.h
index 86d53a3cb497ff0d587952f4b9073da2f71e98a2..c1961761311dbfd5968d6ed64ea91ca3c7d25b0e 100644 (file)
@@ -4,6 +4,7 @@
 /* Simple interface for creating and stopping kernel threads without mess. */
 #include <linux/err.h>
 #include <linux/sched.h>
+#include <linux/cgroup.h>
 
 __printf(4, 5)
 struct task_struct *kthread_create_on_node(int (*threadfn)(void *data),
@@ -117,8 +118,7 @@ struct kthread_delayed_work {
 
 #define KTHREAD_DELAYED_WORK_INIT(dwork, fn) {                         \
        .work = KTHREAD_WORK_INIT((dwork).work, (fn)),                  \
-       .timer = __TIMER_INITIALIZER((TIMER_FUNC_TYPE)kthread_delayed_work_timer_fn,\
-                                    (TIMER_DATA_TYPE)&(dwork.timer),   \
+       .timer = __TIMER_INITIALIZER(kthread_delayed_work_timer_fn,\
                                     TIMER_IRQSAFE),                    \
        }
 
@@ -164,10 +164,9 @@ extern void __kthread_init_worker(struct kthread_worker *worker,
 #define kthread_init_delayed_work(dwork, fn)                           \
        do {                                                            \
                kthread_init_work(&(dwork)->work, (fn));                \
-               __setup_timer(&(dwork)->timer,                          \
-                             (TIMER_FUNC_TYPE)kthread_delayed_work_timer_fn,\
-                             (TIMER_DATA_TYPE)&(dwork)->timer,         \
-                             TIMER_IRQSAFE);                           \
+               __init_timer(&(dwork)->timer,                           \
+                            kthread_delayed_work_timer_fn,             \
+                            TIMER_IRQSAFE);                            \
        } while (0)
 
 int kthread_worker_fn(void *worker_ptr);
@@ -199,4 +198,14 @@ bool kthread_cancel_delayed_work_sync(struct kthread_delayed_work *work);
 
 void kthread_destroy_worker(struct kthread_worker *worker);
 
+#ifdef CONFIG_BLK_CGROUP
+void kthread_associate_blkcg(struct cgroup_subsys_state *css);
+struct cgroup_subsys_state *kthread_blkcg(void);
+#else
+static inline void kthread_associate_blkcg(struct cgroup_subsys_state *css) { }
+static inline struct cgroup_subsys_state *kthread_blkcg(void)
+{
+       return NULL;
+}
+#endif
 #endif /* _LINUX_KTHREAD_H */