diff options
author | Petr Mladek <pmladek@suse.com> | 2016-10-11 16:55:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-11 18:06:33 -0400 |
commit | e700591ae03896c16974d4e1ab58eb296aaa5f59 (patch) | |
tree | f3f19732810a1287d52631b37538f28f2c9af58a | |
parent | d0c75f33f065bf58833c43ac7b5ccfcb60131510 (diff) |
kthread: rename probe_kthread_data() to kthread_probe_data()
Patch series "kthread: Kthread worker API improvements"
The intention of this patchset is to make it easier to manipulate and
maintain kthreads. Especially, I want to replace all the custom main
cycles with a generic one. Also I want to make the kthreads sleep in a
consistent state in a common place when there is no work.
This patch (of 11):
A good practice is to prefix the names of functions by the name of the
subsystem.
This patch fixes the name of probe_kthread_data(). The other wrong
functions names are part of the kthread worker API and will be fixed
separately.
Link: http://lkml.kernel.org/r/1470754545-17632-2-git-send-email-pmladek@suse.com
Signed-off-by: Petr Mladek <pmladek@suse.com>
Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Tejun Heo <tj@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Borislav Petkov <bp@suse.de>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | include/linux/kthread.h | 2 | ||||
-rw-r--r-- | kernel/kthread.c | 4 | ||||
-rw-r--r-- | kernel/workqueue.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/kthread.h b/include/linux/kthread.h index e691b6a23f72..c792ee1628d0 100644 --- a/include/linux/kthread.h +++ b/include/linux/kthread.h | |||
@@ -44,7 +44,7 @@ bool kthread_should_stop(void); | |||
44 | bool kthread_should_park(void); | 44 | bool kthread_should_park(void); |
45 | bool kthread_freezable_should_stop(bool *was_frozen); | 45 | bool kthread_freezable_should_stop(bool *was_frozen); |
46 | void *kthread_data(struct task_struct *k); | 46 | void *kthread_data(struct task_struct *k); |
47 | void *probe_kthread_data(struct task_struct *k); | 47 | void *kthread_probe_data(struct task_struct *k); |
48 | int kthread_park(struct task_struct *k); | 48 | int kthread_park(struct task_struct *k); |
49 | void kthread_unpark(struct task_struct *k); | 49 | void kthread_unpark(struct task_struct *k); |
50 | void kthread_parkme(void); | 50 | void kthread_parkme(void); |
diff --git a/kernel/kthread.c b/kernel/kthread.c index 4ab4c3766a80..7e77b728f96b 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c | |||
@@ -138,7 +138,7 @@ void *kthread_data(struct task_struct *task) | |||
138 | } | 138 | } |
139 | 139 | ||
140 | /** | 140 | /** |
141 | * probe_kthread_data - speculative version of kthread_data() | 141 | * kthread_probe_data - speculative version of kthread_data() |
142 | * @task: possible kthread task in question | 142 | * @task: possible kthread task in question |
143 | * | 143 | * |
144 | * @task could be a kthread task. Return the data value specified when it | 144 | * @task could be a kthread task. Return the data value specified when it |
@@ -146,7 +146,7 @@ void *kthread_data(struct task_struct *task) | |||
146 | * inaccessible for any reason, %NULL is returned. This function requires | 146 | * inaccessible for any reason, %NULL is returned. This function requires |
147 | * that @task itself is safe to dereference. | 147 | * that @task itself is safe to dereference. |
148 | */ | 148 | */ |
149 | void *probe_kthread_data(struct task_struct *task) | 149 | void *kthread_probe_data(struct task_struct *task) |
150 | { | 150 | { |
151 | struct kthread *kthread = to_kthread(task); | 151 | struct kthread *kthread = to_kthread(task); |
152 | void *data = NULL; | 152 | void *data = NULL; |
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index bd81f0390277..479d840db286 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -4261,7 +4261,7 @@ void print_worker_info(const char *log_lvl, struct task_struct *task) | |||
4261 | * This function is called without any synchronization and @task | 4261 | * This function is called without any synchronization and @task |
4262 | * could be in any state. Be careful with dereferences. | 4262 | * could be in any state. Be careful with dereferences. |
4263 | */ | 4263 | */ |
4264 | worker = probe_kthread_data(task); | 4264 | worker = kthread_probe_data(task); |
4265 | 4265 | ||
4266 | /* | 4266 | /* |
4267 | * Carefully copy the associated workqueue's workfn and name. Keep | 4267 | * Carefully copy the associated workqueue's workfn and name. Keep |