.. | .. |
---|
5 | 5 | #include <linux/err.h> |
---|
6 | 6 | #include <linux/sched.h> |
---|
7 | 7 | |
---|
| 8 | +struct mm_struct; |
---|
| 9 | + |
---|
8 | 10 | __printf(4, 5) |
---|
9 | 11 | struct task_struct *kthread_create_on_node(int (*threadfn)(void *data), |
---|
10 | 12 | void *data, |
---|
.. | .. |
---|
58 | 60 | int kthread_stop(struct task_struct *k); |
---|
59 | 61 | bool kthread_should_stop(void); |
---|
60 | 62 | bool kthread_should_park(void); |
---|
| 63 | +bool __kthread_should_park(struct task_struct *k); |
---|
61 | 64 | bool kthread_freezable_should_stop(bool *was_frozen); |
---|
| 65 | +void *kthread_func(struct task_struct *k); |
---|
62 | 66 | void *kthread_data(struct task_struct *k); |
---|
63 | 67 | void *kthread_probe_data(struct task_struct *k); |
---|
64 | 68 | int kthread_park(struct task_struct *k); |
---|
.. | .. |
---|
87 | 91 | |
---|
88 | 92 | struct kthread_worker { |
---|
89 | 93 | unsigned int flags; |
---|
90 | | - spinlock_t lock; |
---|
| 94 | + raw_spinlock_t lock; |
---|
91 | 95 | struct list_head work_list; |
---|
92 | 96 | struct list_head delayed_work_list; |
---|
93 | 97 | struct task_struct *task; |
---|
.. | .. |
---|
108 | 112 | }; |
---|
109 | 113 | |
---|
110 | 114 | #define KTHREAD_WORKER_INIT(worker) { \ |
---|
111 | | - .lock = __SPIN_LOCK_UNLOCKED((worker).lock), \ |
---|
| 115 | + .lock = __RAW_SPIN_LOCK_UNLOCKED((worker).lock), \ |
---|
112 | 116 | .work_list = LIST_HEAD_INIT((worker).work_list), \ |
---|
113 | 117 | .delayed_work_list = LIST_HEAD_INIT((worker).delayed_work_list),\ |
---|
114 | 118 | } |
---|
.. | .. |
---|
166 | 170 | #define kthread_init_delayed_work(dwork, fn) \ |
---|
167 | 171 | do { \ |
---|
168 | 172 | kthread_init_work(&(dwork)->work, (fn)); \ |
---|
169 | | - __init_timer(&(dwork)->timer, \ |
---|
| 173 | + timer_setup(&(dwork)->timer, \ |
---|
170 | 174 | kthread_delayed_work_timer_fn, \ |
---|
171 | 175 | TIMER_IRQSAFE); \ |
---|
172 | 176 | } while (0) |
---|
.. | .. |
---|
200 | 204 | |
---|
201 | 205 | void kthread_destroy_worker(struct kthread_worker *worker); |
---|
202 | 206 | |
---|
| 207 | +void kthread_use_mm(struct mm_struct *mm); |
---|
| 208 | +void kthread_unuse_mm(struct mm_struct *mm); |
---|
| 209 | + |
---|
203 | 210 | struct cgroup_subsys_state; |
---|
204 | 211 | |
---|
205 | 212 | #ifdef CONFIG_BLK_CGROUP |
---|