aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2008-02-08 07:19:19 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 12:22:29 -0500
commitfea9d175545b38cb3e84569400419eb81bc90fa3 (patch)
tree0d43fe9ed2ea6104ee8b15a3eb8da081dd08fd35 /kernel
parent46f382d2b69d2221086b823f0dbc8f32c027cac2 (diff)
ITIMER_REAL: convert to use struct pid
signal_struct->tsk points to the ->group_leader and thus we have the nasty code in de_thread() which has to change it and restart ->real_timer if the leader is changed. Use "struct pid *leader_pid" instead. This also allows us to kill now unneeded send_group_sig_info(). Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Acked-by: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Davide Libenzi <davidel@xmailserver.org> Cc: Pavel Emelyanov <xemul@openvz.org> Acked-by: Roland McGrath <roland@redhat.com> Acked-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/fork.c2
-rw-r--r--kernel/itimer.c2
-rw-r--r--kernel/signal.c14
3 files changed, 2 insertions, 16 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index b2ef8e4fad70..ca54d9704644 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -909,7 +909,6 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
909 hrtimer_init(&sig->real_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 909 hrtimer_init(&sig->real_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
910 sig->it_real_incr.tv64 = 0; 910 sig->it_real_incr.tv64 = 0;
911 sig->real_timer.function = it_real_fn; 911 sig->real_timer.function = it_real_fn;
912 sig->tsk = tsk;
913 912
914 sig->it_virt_expires = cputime_zero; 913 sig->it_virt_expires = cputime_zero;
915 sig->it_virt_incr = cputime_zero; 914 sig->it_virt_incr = cputime_zero;
@@ -1338,6 +1337,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1338 if (clone_flags & CLONE_NEWPID) 1337 if (clone_flags & CLONE_NEWPID)
1339 p->nsproxy->pid_ns->child_reaper = p; 1338 p->nsproxy->pid_ns->child_reaper = p;
1340 1339
1340 p->signal->leader_pid = pid;
1341 p->signal->tty = current->signal->tty; 1341 p->signal->tty = current->signal->tty;
1342 set_task_pgrp(p, task_pgrp_nr(current)); 1342 set_task_pgrp(p, task_pgrp_nr(current));
1343 set_task_session(p, task_session_nr(current)); 1343 set_task_session(p, task_session_nr(current));
diff --git a/kernel/itimer.c b/kernel/itimer.c
index 2fab344dbf56..ab982747d9bd 100644
--- a/kernel/itimer.c
+++ b/kernel/itimer.c
@@ -132,7 +132,7 @@ enum hrtimer_restart it_real_fn(struct hrtimer *timer)
132 struct signal_struct *sig = 132 struct signal_struct *sig =
133 container_of(timer, struct signal_struct, real_timer); 133 container_of(timer, struct signal_struct, real_timer);
134 134
135 send_group_sig_info(SIGALRM, SEND_SIG_PRIV, sig->tsk); 135 kill_pid_info(SIGALRM, SEND_SIG_PRIV, sig->leader_pid);
136 136
137 return HRTIMER_NORESTART; 137 return HRTIMER_NORESTART;
138} 138}
diff --git a/kernel/signal.c b/kernel/signal.c
index b0b43a4ad8dd..cc45a6b69134 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1205,20 +1205,6 @@ send_sig(int sig, struct task_struct *p, int priv)
1205 return send_sig_info(sig, __si_special(priv), p); 1205 return send_sig_info(sig, __si_special(priv), p);
1206} 1206}
1207 1207
1208/*
1209 * This is the entry point for "process-wide" signals.
1210 * They will go to an appropriate thread in the thread group.
1211 */
1212int
1213send_group_sig_info(int sig, struct siginfo *info, struct task_struct *p)
1214{
1215 int ret;
1216 read_lock(&tasklist_lock);
1217 ret = group_send_sig_info(sig, info, p);
1218 read_unlock(&tasklist_lock);
1219 return ret;
1220}
1221
1222void 1208void
1223force_sig(int sig, struct task_struct *p) 1209force_sig(int sig, struct task_struct *p)
1224{ 1210{