summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2007-10-18 23:40:39 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-19 11:53:43 -0700
commit9a2e70572e94e21e7ec4186702d045415422bda0 (patch)
treea6cd54dc559cbf6840dac4077f507a961486e21b /kernel
parent270f722d4d5f94b02fd48eed47e57917ab00a858 (diff)
Isolate the explicit usage of signal->pgrp
The pgrp field is not used widely around the kernel so it is now marked as deprecated with appropriate comment. The initialization of INIT_SIGNALS is trimmed because a) they are set to 0 automatically; b) gcc cannot properly initialize two anonymous (the second one is the one with the session) unions. In this particular case to make it compile we'd have to add some field initialized right before the .pgrp. This is the same patch as the 1ec320afdc9552c92191d5f89fcd1ebe588334ca one (from Cedric), but for the pgrp field. Some progress report: We have to deprecate the pid, tgid, session and pgrp fields on struct task_struct and struct signal_struct. The session and pgrp are already deprecated. The tgid value is close to being such - the worst known usage in in fs/locks.c and audit code. The pid field deprecation is mainly blocked by numerous printk-s around the kernel that print the tsk->pid to log. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Cc: Oleg Nesterov <oleg@tv-sign.ru> Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com> Cc: Cedric Le Goater <clg@fr.ibm.com> Cc: Serge Hallyn <serue@us.ibm.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Herbert Poetzl <herbert@13thfloor.at> 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/exit.c2
-rw-r--r--kernel/fork.c4
-rw-r--r--kernel/sys.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 68d27039ef7d..6838d4d77e05 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -306,7 +306,7 @@ void __set_special_pids(pid_t session, pid_t pgrp)
}
if (task_pgrp_nr(curr) != pgrp) {
detach_pid(curr, PIDTYPE_PGID);
- curr->signal->pgrp = pgrp;
+ set_task_pgrp(curr, pgrp);
attach_pid(curr, PIDTYPE_PGID, find_pid(pgrp));
}
}
diff --git a/kernel/fork.c b/kernel/fork.c
index 240aa6601f5b..9d40367dd5db 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1293,13 +1293,13 @@ static struct task_struct *copy_process(unsigned long clone_flags,
if (clone_flags & CLONE_NEWPID) {
p->nsproxy->pid_ns->child_reaper = p;
p->signal->tty = NULL;
- p->signal->pgrp = p->pid;
+ set_task_pgrp(p, p->pid);
set_task_session(p, p->pid);
attach_pid(p, PIDTYPE_PGID, pid);
attach_pid(p, PIDTYPE_SID, pid);
} else {
p->signal->tty = current->signal->tty;
- p->signal->pgrp = task_pgrp_nr(current);
+ set_task_pgrp(p, task_pgrp_nr(current));
set_task_session(p, task_session_nr(current));
attach_pid(p, PIDTYPE_PGID,
task_pgrp(current));
diff --git a/kernel/sys.c b/kernel/sys.c
index 2befc299129d..304b5410d746 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -977,7 +977,7 @@ asmlinkage long sys_setpgid(pid_t pid, pid_t pgid)
detach_pid(p, PIDTYPE_PGID);
pid = find_vpid(pgid);
attach_pid(p, PIDTYPE_PGID, pid);
- p->signal->pgrp = pid_nr(pid);
+ set_task_pgrp(p, pid_nr(pid));
}
err = 0;