Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=85868995d9d82de5b0de38d695559daddffef893
Commit:     85868995d9d82de5b0de38d695559daddffef893
Parent:     0e29b24aa6b3eb6c161cbb9e42fc20b47e67a7c6
Author:     Sukadev Bhattiprolu <[EMAIL PROTECTED]>
AuthorDate: Thu May 10 22:23:03 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri May 11 08:29:35 2007 -0700

    Use struct pid parameter in copy_process()
    
    Modify copy_process() to take a struct pid * parameter instead of a pid_t.
    This simplifies the code a bit and also avoids having to call find_pid() to
    convert the pid_t to a struct pid.
    
    Changelog:
        - Fixed Badari Pulavarty's comments and passed in &init_struct_pid
          from fork_idle().
        - Fixed Eric Biederman's comments and simplified this patch and
          used a new patch to remove the likely(pid) check.
    
    Signed-off-by: Sukadev Bhattiprolu <[EMAIL PROTECTED]>
    Cc: Cedric Le Goater <[EMAIL PROTECTED]>
    Cc: Dave Hansen <[EMAIL PROTECTED]>
    Cc: Serge Hallyn <[EMAIL PROTECTED]>
    Cc: Eric Biederman <[EMAIL PROTECTED]>
    Cc: <[EMAIL PROTECTED]>
    Acked-by: Eric W. Biederman <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 kernel/fork.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/kernel/fork.c b/kernel/fork.c
index 6031800..cf13c44 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -956,7 +956,7 @@ static struct task_struct *copy_process(unsigned long 
clone_flags,
                                        unsigned long stack_size,
                                        int __user *parent_tidptr,
                                        int __user *child_tidptr,
-                                       int pid)
+                                       struct pid *pid)
 {
        int retval;
        struct task_struct *p = NULL;
@@ -1023,7 +1023,7 @@ static struct task_struct *copy_process(unsigned long 
clone_flags,
        p->did_exec = 0;
        delayacct_tsk_init(p);  /* Must remain after dup_task_struct() */
        copy_flags(clone_flags, p);
-       p->pid = pid;
+       p->pid = pid_nr(pid);
        retval = -EFAULT;
        if (clone_flags & CLONE_PARENT_SETTID)
                if (put_user(p->pid, parent_tidptr))
@@ -1261,7 +1261,7 @@ static struct task_struct *copy_process(unsigned long 
clone_flags,
                        list_add_tail_rcu(&p->tasks, &init_task.tasks);
                        __get_cpu_var(process_counts)++;
                }
-               attach_pid(p, PIDTYPE_PID, find_pid(p->pid));
+               attach_pid(p, PIDTYPE_PID, pid);
                nr_threads++;
        }
 
@@ -1325,7 +1325,8 @@ struct task_struct * __cpuinit fork_idle(int cpu)
        struct task_struct *task;
        struct pt_regs regs;
 
-       task = copy_process(CLONE_VM, 0, idle_regs(&regs), 0, NULL, NULL, 0);
+       task = copy_process(CLONE_VM, 0, idle_regs(&regs), 0, NULL, NULL,
+                               &init_struct_pid);
        if (!IS_ERR(task))
                init_idle(task, cpu);
 
@@ -1375,7 +1376,7 @@ long do_fork(unsigned long clone_flags,
                        clone_flags |= CLONE_PTRACE;
        }
 
-       p = copy_process(clone_flags, stack_start, regs, stack_size, 
parent_tidptr, child_tidptr, nr);
+       p = copy_process(clone_flags, stack_start, regs, stack_size, 
parent_tidptr, child_tidptr, pid);
        /*
         * Do this prior waking up the new thread - the thread pointer
         * might get invalid after that point, if the thread exits quickly.
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to