fork: allow kernel code to call copy_process
authorMike Christie <michael.christie@oracle.com>
Fri, 10 Mar 2023 22:03:29 +0000 (16:03 -0600)
committerChristian Brauner (Microsoft) <brauner@kernel.org>
Sun, 12 Mar 2023 09:54:43 +0000 (10:54 +0100)
The next patch adds helpers like create_io_thread, but for use by the
vhost layer. There are several functions, so they are in their own file
instead of cluttering up fork.c. This patch allows that new file to
call copy_process.

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>
include/linux/sched/task.h
kernel/fork.c

index 00c54bfac0b56cfba95973944565083f99ac437d..537cbf9a2adeab8ef6bc372474ab63afe292d74d 100644 (file)
@@ -93,6 +93,8 @@ extern void exit_files(struct task_struct *);
 extern void exit_itimers(struct task_struct *);
 
 extern pid_t kernel_clone(struct kernel_clone_args *kargs);
+struct task_struct *copy_process(struct pid *pid, int trace, int node,
+                                struct kernel_clone_args *args);
 struct task_struct *create_io_thread(int (*fn)(void *), void *arg, int node);
 struct task_struct *fork_idle(int);
 extern pid_t kernel_thread(int (*fn)(void *), void *arg, const char *name,
index 2918c685ede5cb6f1f9ccdd06ad93de66f1698a5..3363f284c6cd2337c480597d127fa72f79eedd32 100644 (file)
@@ -2016,7 +2016,7 @@ static void rv_task_fork(struct task_struct *p)
  * parts of the process environment (as per the clone
  * flags). The actual kick-off is left to the caller.
  */
-static __latent_entropy struct task_struct *copy_process(
+__latent_entropy struct task_struct *copy_process(
                                        struct pid *pid,
                                        int trace,
                                        int node,