diff options
Diffstat (limited to 'kernel/exit.c')
| -rw-r--r-- | kernel/exit.c | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 7f7ef2258553..6664c084783d 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
| @@ -134,8 +134,8 @@ static void delayed_put_task_struct(struct rcu_head *rhp) | |||
| 134 | 134 | ||
| 135 | void release_task(struct task_struct * p) | 135 | void release_task(struct task_struct * p) |
| 136 | { | 136 | { |
| 137 | struct task_struct *leader; | ||
| 137 | int zap_leader; | 138 | int zap_leader; |
| 138 | task_t *leader; | ||
| 139 | repeat: | 139 | repeat: |
| 140 | atomic_dec(&p->user->processes); | 140 | atomic_dec(&p->user->processes); |
| 141 | write_lock_irq(&tasklist_lock); | 141 | write_lock_irq(&tasklist_lock); |
| @@ -209,7 +209,7 @@ out: | |||
| 209 | * | 209 | * |
| 210 | * "I ask you, have you ever known what it is to be an orphan?" | 210 | * "I ask you, have you ever known what it is to be an orphan?" |
| 211 | */ | 211 | */ |
| 212 | static int will_become_orphaned_pgrp(int pgrp, task_t *ignored_task) | 212 | static int will_become_orphaned_pgrp(int pgrp, struct task_struct *ignored_task) |
| 213 | { | 213 | { |
| 214 | struct task_struct *p; | 214 | struct task_struct *p; |
| 215 | int ret = 1; | 215 | int ret = 1; |
| @@ -582,7 +582,8 @@ static void exit_mm(struct task_struct * tsk) | |||
| 582 | mmput(mm); | 582 | mmput(mm); |
| 583 | } | 583 | } |
| 584 | 584 | ||
| 585 | static inline void choose_new_parent(task_t *p, task_t *reaper) | 585 | static inline void |
| 586 | choose_new_parent(struct task_struct *p, struct task_struct *reaper) | ||
| 586 | { | 587 | { |
| 587 | /* | 588 | /* |
| 588 | * Make sure we're not reparenting to ourselves and that | 589 | * Make sure we're not reparenting to ourselves and that |
| @@ -592,7 +593,8 @@ static inline void choose_new_parent(task_t *p, task_t *reaper) | |||
| 592 | p->real_parent = reaper; | 593 | p->real_parent = reaper; |
| 593 | } | 594 | } |
| 594 | 595 | ||
| 595 | static void reparent_thread(task_t *p, task_t *father, int traced) | 596 | static void |
| 597 | reparent_thread(struct task_struct *p, struct task_struct *father, int traced) | ||
| 596 | { | 598 | { |
| 597 | /* We don't want people slaying init. */ | 599 | /* We don't want people slaying init. */ |
| 598 | if (p->exit_signal != -1) | 600 | if (p->exit_signal != -1) |
| @@ -656,8 +658,8 @@ static void reparent_thread(task_t *p, task_t *father, int traced) | |||
| 656 | * group, and if no such member exists, give it to | 658 | * group, and if no such member exists, give it to |
| 657 | * the global child reaper process (ie "init") | 659 | * the global child reaper process (ie "init") |
| 658 | */ | 660 | */ |
| 659 | static void forget_original_parent(struct task_struct * father, | 661 | static void |
| 660 | struct list_head *to_release) | 662 | forget_original_parent(struct task_struct *father, struct list_head *to_release) |
| 661 | { | 663 | { |
| 662 | struct task_struct *p, *reaper = father; | 664 | struct task_struct *p, *reaper = father; |
| 663 | struct list_head *_p, *_n; | 665 | struct list_head *_p, *_n; |
| @@ -680,7 +682,7 @@ static void forget_original_parent(struct task_struct * father, | |||
| 680 | */ | 682 | */ |
| 681 | list_for_each_safe(_p, _n, &father->children) { | 683 | list_for_each_safe(_p, _n, &father->children) { |
| 682 | int ptrace; | 684 | int ptrace; |
| 683 | p = list_entry(_p,struct task_struct,sibling); | 685 | p = list_entry(_p, struct task_struct, sibling); |
| 684 | 686 | ||
| 685 | ptrace = p->ptrace; | 687 | ptrace = p->ptrace; |
| 686 | 688 | ||
| @@ -709,7 +711,7 @@ static void forget_original_parent(struct task_struct * father, | |||
| 709 | list_add(&p->ptrace_list, to_release); | 711 | list_add(&p->ptrace_list, to_release); |
| 710 | } | 712 | } |
| 711 | list_for_each_safe(_p, _n, &father->ptrace_children) { | 713 | list_for_each_safe(_p, _n, &father->ptrace_children) { |
| 712 | p = list_entry(_p,struct task_struct,ptrace_list); | 714 | p = list_entry(_p, struct task_struct, ptrace_list); |
| 713 | choose_new_parent(p, reaper); | 715 | choose_new_parent(p, reaper); |
| 714 | reparent_thread(p, father, 1); | 716 | reparent_thread(p, father, 1); |
| 715 | } | 717 | } |
| @@ -829,7 +831,7 @@ static void exit_notify(struct task_struct *tsk) | |||
| 829 | 831 | ||
| 830 | list_for_each_safe(_p, _n, &ptrace_dead) { | 832 | list_for_each_safe(_p, _n, &ptrace_dead) { |
| 831 | list_del_init(_p); | 833 | list_del_init(_p); |
| 832 | t = list_entry(_p,struct task_struct,ptrace_list); | 834 | t = list_entry(_p, struct task_struct, ptrace_list); |
| 833 | release_task(t); | 835 | release_task(t); |
| 834 | } | 836 | } |
| 835 | 837 | ||
| @@ -933,10 +935,9 @@ fastcall NORET_TYPE void do_exit(long code) | |||
| 933 | if (unlikely(current->pi_state_cache)) | 935 | if (unlikely(current->pi_state_cache)) |
| 934 | kfree(current->pi_state_cache); | 936 | kfree(current->pi_state_cache); |
| 935 | /* | 937 | /* |
| 936 | * If DEBUG_MUTEXES is on, make sure we are holding no locks: | 938 | * Make sure we are holding no locks: |
| 937 | */ | 939 | */ |
| 938 | mutex_debug_check_no_locks_held(tsk); | 940 | debug_check_no_locks_held(tsk); |
| 939 | rt_mutex_debug_check_no_locks_held(tsk); | ||
| 940 | 941 | ||
| 941 | if (tsk->io_context) | 942 | if (tsk->io_context) |
| 942 | exit_io_context(); | 943 | exit_io_context(); |
| @@ -1011,7 +1012,7 @@ asmlinkage void sys_exit_group(int error_code) | |||
| 1011 | do_group_exit((error_code & 0xff) << 8); | 1012 | do_group_exit((error_code & 0xff) << 8); |
| 1012 | } | 1013 | } |
| 1013 | 1014 | ||
| 1014 | static int eligible_child(pid_t pid, int options, task_t *p) | 1015 | static int eligible_child(pid_t pid, int options, struct task_struct *p) |
| 1015 | { | 1016 | { |
| 1016 | if (pid > 0) { | 1017 | if (pid > 0) { |
| 1017 | if (p->pid != pid) | 1018 | if (p->pid != pid) |
| @@ -1052,12 +1053,13 @@ static int eligible_child(pid_t pid, int options, task_t *p) | |||
| 1052 | return 1; | 1053 | return 1; |
| 1053 | } | 1054 | } |
| 1054 | 1055 | ||
| 1055 | static int wait_noreap_copyout(task_t *p, pid_t pid, uid_t uid, | 1056 | static int wait_noreap_copyout(struct task_struct *p, pid_t pid, uid_t uid, |
| 1056 | int why, int status, | 1057 | int why, int status, |
| 1057 | struct siginfo __user *infop, | 1058 | struct siginfo __user *infop, |
| 1058 | struct rusage __user *rusagep) | 1059 | struct rusage __user *rusagep) |
| 1059 | { | 1060 | { |
| 1060 | int retval = rusagep ? getrusage(p, RUSAGE_BOTH, rusagep) : 0; | 1061 | int retval = rusagep ? getrusage(p, RUSAGE_BOTH, rusagep) : 0; |
| 1062 | |||
| 1061 | put_task_struct(p); | 1063 | put_task_struct(p); |
| 1062 | if (!retval) | 1064 | if (!retval) |
| 1063 | retval = put_user(SIGCHLD, &infop->si_signo); | 1065 | retval = put_user(SIGCHLD, &infop->si_signo); |
| @@ -1082,7 +1084,7 @@ static int wait_noreap_copyout(task_t *p, pid_t pid, uid_t uid, | |||
| 1082 | * the lock and this task is uninteresting. If we return nonzero, we have | 1084 | * the lock and this task is uninteresting. If we return nonzero, we have |
| 1083 | * released the lock and the system call should return. | 1085 | * released the lock and the system call should return. |
| 1084 | */ | 1086 | */ |
| 1085 | static int wait_task_zombie(task_t *p, int noreap, | 1087 | static int wait_task_zombie(struct task_struct *p, int noreap, |
| 1086 | struct siginfo __user *infop, | 1088 | struct siginfo __user *infop, |
| 1087 | int __user *stat_addr, struct rusage __user *ru) | 1089 | int __user *stat_addr, struct rusage __user *ru) |
| 1088 | { | 1090 | { |
| @@ -1244,8 +1246,8 @@ static int wait_task_zombie(task_t *p, int noreap, | |||
| 1244 | * the lock and this task is uninteresting. If we return nonzero, we have | 1246 | * the lock and this task is uninteresting. If we return nonzero, we have |
| 1245 | * released the lock and the system call should return. | 1247 | * released the lock and the system call should return. |
| 1246 | */ | 1248 | */ |
| 1247 | static int wait_task_stopped(task_t *p, int delayed_group_leader, int noreap, | 1249 | static int wait_task_stopped(struct task_struct *p, int delayed_group_leader, |
| 1248 | struct siginfo __user *infop, | 1250 | int noreap, struct siginfo __user *infop, |
| 1249 | int __user *stat_addr, struct rusage __user *ru) | 1251 | int __user *stat_addr, struct rusage __user *ru) |
| 1250 | { | 1252 | { |
| 1251 | int retval, exit_code; | 1253 | int retval, exit_code; |
| @@ -1359,7 +1361,7 @@ bail_ref: | |||
| 1359 | * the lock and this task is uninteresting. If we return nonzero, we have | 1361 | * the lock and this task is uninteresting. If we return nonzero, we have |
| 1360 | * released the lock and the system call should return. | 1362 | * released the lock and the system call should return. |
| 1361 | */ | 1363 | */ |
| 1362 | static int wait_task_continued(task_t *p, int noreap, | 1364 | static int wait_task_continued(struct task_struct *p, int noreap, |
| 1363 | struct siginfo __user *infop, | 1365 | struct siginfo __user *infop, |
| 1364 | int __user *stat_addr, struct rusage __user *ru) | 1366 | int __user *stat_addr, struct rusage __user *ru) |
| 1365 | { | 1367 | { |
| @@ -1445,7 +1447,7 @@ repeat: | |||
| 1445 | int ret; | 1447 | int ret; |
| 1446 | 1448 | ||
| 1447 | list_for_each(_p,&tsk->children) { | 1449 | list_for_each(_p,&tsk->children) { |
| 1448 | p = list_entry(_p,struct task_struct,sibling); | 1450 | p = list_entry(_p, struct task_struct, sibling); |
| 1449 | 1451 | ||
| 1450 | ret = eligible_child(pid, options, p); | 1452 | ret = eligible_child(pid, options, p); |
| 1451 | if (!ret) | 1453 | if (!ret) |
