summaryrefslogtreecommitdiff
path: root/include/linux/kthread.h
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2023-09-08 02:40:48 +0300
committerAndrew Morton <akpm@linux-foundation.org>2023-10-04 20:41:57 +0300
commit6309727ef27162deabd5c095c11af24970fba5a2 (patch)
tree84e15c2ddc239bd049b2de325d63067badb85a1d /include/linux/kthread.h
parented5378a387fd7c382497f2abcf4605e030b64044 (diff)
downloadlinux-6309727ef27162deabd5c095c11af24970fba5a2.tar.xz
kthread: add kthread_stop_put
Add a kthread_stop_put() helper that stops a thread and puts its task struct. Use it to replace the various instances of kthread_stop() followed by put_task_struct(). Remove the kthread_stop_put() macro in usbip that is similar but doesn't return the result of kthread_stop(). [agruenba@redhat.com: fix kerneldoc comment] Link: https://lkml.kernel.org/r/20230911111730.2565537-1-agruenba@redhat.com [akpm@linux-foundation.org: document kthread_stop_put()'s argument] Link: https://lkml.kernel.org/r/20230907234048.2499820-1-agruenba@redhat.com Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux/kthread.h')
-rw-r--r--include/linux/kthread.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/kthread.h b/include/linux/kthread.h
index 2c30ade43bc8..b11f53c1ba2e 100644
--- a/include/linux/kthread.h
+++ b/include/linux/kthread.h
@@ -86,6 +86,7 @@ void free_kthread_struct(struct task_struct *k);
void kthread_bind(struct task_struct *k, unsigned int cpu);
void kthread_bind_mask(struct task_struct *k, const struct cpumask *mask);
int kthread_stop(struct task_struct *k);
+int kthread_stop_put(struct task_struct *k);
bool kthread_should_stop(void);
bool kthread_should_park(void);
bool kthread_should_stop_or_park(void);