hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/include/linux/kthread.h
....@@ -5,6 +5,8 @@
55 #include <linux/err.h>
66 #include <linux/sched.h>
77
8
+struct mm_struct;
9
+
810 __printf(4, 5)
911 struct task_struct *kthread_create_on_node(int (*threadfn)(void *data),
1012 void *data,
....@@ -58,7 +60,9 @@
5860 int kthread_stop(struct task_struct *k);
5961 bool kthread_should_stop(void);
6062 bool kthread_should_park(void);
63
+bool __kthread_should_park(struct task_struct *k);
6164 bool kthread_freezable_should_stop(bool *was_frozen);
65
+void *kthread_func(struct task_struct *k);
6266 void *kthread_data(struct task_struct *k);
6367 void *kthread_probe_data(struct task_struct *k);
6468 int kthread_park(struct task_struct *k);
....@@ -87,7 +91,7 @@
8791
8892 struct kthread_worker {
8993 unsigned int flags;
90
- spinlock_t lock;
94
+ raw_spinlock_t lock;
9195 struct list_head work_list;
9296 struct list_head delayed_work_list;
9397 struct task_struct *task;
....@@ -108,7 +112,7 @@
108112 };
109113
110114 #define KTHREAD_WORKER_INIT(worker) { \
111
- .lock = __SPIN_LOCK_UNLOCKED((worker).lock), \
115
+ .lock = __RAW_SPIN_LOCK_UNLOCKED((worker).lock), \
112116 .work_list = LIST_HEAD_INIT((worker).work_list), \
113117 .delayed_work_list = LIST_HEAD_INIT((worker).delayed_work_list),\
114118 }
....@@ -166,7 +170,7 @@
166170 #define kthread_init_delayed_work(dwork, fn) \
167171 do { \
168172 kthread_init_work(&(dwork)->work, (fn)); \
169
- __init_timer(&(dwork)->timer, \
173
+ timer_setup(&(dwork)->timer, \
170174 kthread_delayed_work_timer_fn, \
171175 TIMER_IRQSAFE); \
172176 } while (0)
....@@ -200,6 +204,9 @@
200204
201205 void kthread_destroy_worker(struct kthread_worker *worker);
202206
207
+void kthread_use_mm(struct mm_struct *mm);
208
+void kthread_unuse_mm(struct mm_struct *mm);
209
+
203210 struct cgroup_subsys_state;
204211
205212 #ifdef CONFIG_BLK_CGROUP