summaryrefslogtreecommitdiffstats
path: root/kernel/kthread.c
diff options
context:
space:
mode:
authorMike Christie <michael.christie@oracle.com>2023-03-10 23:03:23 +0100
committerChristian Brauner (Microsoft) <brauner@kernel.org>2023-03-12 10:52:46 +0100
commitcf587db2ee0261c74d04f61f39783db88a0b65e4 (patch)
tree5fecb82e0ea27438d473a165f274b9355ce0cd42 /kernel/kthread.c
parentcsky: Remove kernel_thread declaration (diff)
downloadlinux-cf587db2ee0261c74d04f61f39783db88a0b65e4.tar.xz
linux-cf587db2ee0261c74d04f61f39783db88a0b65e4.zip
kernel: Allow a kernel thread's name to be set in copy_process
This patch allows kernel users to pass in the thread name so it can be set during creation instead of having to use set_task_comm after the thread is created. Signed-off-by: Mike Christie <michael.christie@oracle.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Diffstat (limited to 'kernel/kthread.c')
-rw-r--r--kernel/kthread.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/kthread.c b/kernel/kthread.c
index 7e6751b29101..fa4a12ddf7fb 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -396,7 +396,8 @@ static void create_kthread(struct kthread_create_info *create)
current->pref_node_fork = create->node;
#endif
/* We want our own signal handler (we take no signals by default). */
- pid = kernel_thread(kthread, create, CLONE_FS | CLONE_FILES | SIGCHLD);
+ pid = kernel_thread(kthread, create, NULL,
+ CLONE_FS | CLONE_FILES | SIGCHLD);
if (pid < 0) {
/* Release the structure when caller killed by a fatal signal. */
struct completion *done = xchg(&create->done, NULL);