[PATCH] remove add_parent()'s parent argument
authorOleg Nesterov <oleg@tv-sign.ru>
Wed, 29 Mar 2006 00:11:05 +0000 (16:11 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 29 Mar 2006 02:36:41 +0000 (18:36 -0800)
add_parent(p, parent) is always called with parent == p->parent, and it makes
no sense to do it differently.  This patch removes this argument.

No changes in affected .o files.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/mips/kernel/irixsig.c
fs/exec.c
include/linux/sched.h
kernel/exit.c

index 08273a2a501d5ca1b837a80bbf1826d269b90113..8150f071f80afdb28da541119655369ac6686312 100644 (file)
@@ -603,7 +603,7 @@ repeat:
                        /* move to end of parent's list to avoid starvation */
                        write_lock_irq(&tasklist_lock);
                        remove_parent(p);
-                       add_parent(p, p->parent);
+                       add_parent(p);
                        write_unlock_irq(&tasklist_lock);
                        retval = ru ? getrusage(p, RUSAGE_BOTH, ru) : 0;
                        if (retval)
@@ -643,7 +643,7 @@ repeat:
                                write_lock_irq(&tasklist_lock);
                                remove_parent(p);
                                p->parent = p->real_parent;
-                               add_parent(p, p->parent);
+                               add_parent(p);
                                do_notify_parent(p, SIGCHLD);
                                write_unlock_irq(&tasklist_lock);
                        } else
index db0769447d33bf8743be643261d1ff8ab0fcbad0..9046ad2b061411ef8bbbab4cff13592ca84fbc74 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -725,8 +725,8 @@ static int de_thread(struct task_struct *tsk)
                current->group_leader = current;
                leader->group_leader = leader;
 
-               add_parent(current, current->parent);
-               add_parent(leader, leader->parent);
+               add_parent(current);
+               add_parent(leader);
                if (ptrace) {
                        current->ptrace = ptrace;
                        __ptrace_link(current, parent);
index 5f5ab98bbb6b66c0165703780f0c59a1d43b4dc1..b4b14c32b28a1d21e9a91c665feb1cfbac0e98d9 100644 (file)
@@ -1184,7 +1184,7 @@ extern void wait_task_inactive(task_t * p);
 #endif
 
 #define remove_parent(p)       list_del_init(&(p)->sibling)
-#define add_parent(p, parent)  list_add_tail(&(p)->sibling,&(parent)->children)
+#define add_parent(p)          list_add_tail(&(p)->sibling,&(p)->parent->children)
 
 #define REMOVE_LINKS(p) do {                                   \
        if (thread_group_leader(p))                             \
@@ -1195,7 +1195,7 @@ extern void wait_task_inactive(task_t * p);
 #define SET_LINKS(p) do {                                      \
        if (thread_group_leader(p))                             \
                list_add_tail(&(p)->tasks,&init_task.tasks);    \
-       add_parent(p, (p)->parent);                             \
+       add_parent(p);                                          \
        } while (0)
 
 #define next_task(p)   list_entry((p)->tasks.next, struct task_struct, tasks)
index e04a59405e9991c027c583165d43be60c904c223..df26c33037d2f8aed94f504ed7ac7c5d30d3a32e 100644 (file)
@@ -1281,7 +1281,7 @@ bail_ref:
 
        /* move to end of parent's list to avoid starvation */
        remove_parent(p);
-       add_parent(p, p->parent);
+       add_parent(p);
 
        write_unlock_irq(&tasklist_lock);