Skip to contentSkip to conversation

remove add_parent()'s parent argument

PATCH New Oleg Nesterov 1 participant 1 message Feb 3, 2006

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 remove add_parent()'s parent argument

(this patch doesn't conflict with any of Eric's patches)

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.

include/linux/sched.h renamed from include/linux/sched.h~1_ADD +2 -2
@@ -1175,7 +1175,7 @@ extern void wait_task_inactive(task_t * 
 #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))				\
@@ -1186,7 +1186,7 @@ extern void wait_task_inactive(task_t * 
 #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)
kernel/exit.c renamed from kernel/exit.c~1_ADD +1 -1
@@ -1251,7 +1251,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);
 
fs/exec.c renamed from fs/exec.c~1_ADD +2 -2
@@ -715,8 +715,8 @@ static int de_thread(struct task_struct 
 		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);
arch/mips/kernel/irixsig.c renamed from arch/mips/kernel/irixsig.c~1_ADD +2 -2
@@ -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