Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24549
b: refs/heads/master
c: c97d989
h: refs/heads/master
i:
  24547: d058693
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Mar 29, 2006
1 parent 0f11aa9 commit a923d36
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9b678ece42893b53aae5ed7cb8d7cb261cacb72c
refs/heads/master: c97d98931ac52ef110b62d9b75c6a6f2bfbc1898
12 changes: 0 additions & 12 deletions trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -1186,18 +1186,6 @@ extern void wait_task_inactive(task_t * p);
#define remove_parent(p) list_del_init(&(p)->sibling)
#define add_parent(p) list_add_tail(&(p)->sibling,&(p)->parent->children)

#define REMOVE_LINKS(p) do { \
if (thread_group_leader(p)) \
list_del_init(&(p)->tasks); \
remove_parent(p); \
} while (0)

#define SET_LINKS(p) do { \
if (thread_group_leader(p)) \
list_add_tail(&(p)->tasks,&init_task.tasks); \
add_parent(p); \
} while (0)

#define next_task(p) list_entry((p)->tasks.next, struct task_struct, tasks)
#define prev_task(p) list_entry((p)->tasks.prev, struct task_struct, tasks)

Expand Down
4 changes: 3 additions & 1 deletion trunk/kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@ static void __unhash_process(struct task_struct *p)
if (thread_group_leader(p)) {
detach_pid(p, PIDTYPE_PGID);
detach_pid(p, PIDTYPE_SID);

list_del_init(&p->tasks);
if (p->pid)
__get_cpu_var(process_counts)--;
}

REMOVE_LINKS(p);
remove_parent(p);
}

void release_task(struct task_struct * p)
Expand Down
4 changes: 3 additions & 1 deletion trunk/kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ static task_t *copy_process(unsigned long clone_flags,
*/
p->ioprio = current->ioprio;

SET_LINKS(p);
add_parent(p);
if (unlikely(p->ptrace & PT_PTRACED))
__ptrace_link(p, current->parent);

Expand All @@ -1191,6 +1191,8 @@ static task_t *copy_process(unsigned long clone_flags,
p->signal->session = current->signal->session;
attach_pid(p, PIDTYPE_PGID, process_group(p));
attach_pid(p, PIDTYPE_SID, p->signal->session);

list_add_tail(&p->tasks, &init_task.tasks);
if (p->pid)
__get_cpu_var(process_counts)++;
}
Expand Down

0 comments on commit a923d36

Please sign in to comment.