summaryrefslogtreecommitdiff
path: root/kernel/sys.c
diff options
context:
space:
mode:
authorPavel Emelianov <xemul@openvz.org>2007-10-19 10:39:46 +0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-19 22:53:37 +0400
commita47afb0f9d794d525a372c8d69902147cc88222a (patch)
tree7bd67280e2edc1c3b1803d4a93bee794088e9342 /kernel/sys.c
parent858d72ead4864da0fb0b89b919524125ce998e27 (diff)
downloadlinux-a47afb0f9d794d525a372c8d69902147cc88222a.tar.xz
pid namespaces: round up the API
The set of functions process_session, task_session, process_group and task_pgrp is confusing, as the names can be mixed with each other when looking at the code for a long time. The proposals are to * equip the functions that return the integer with _nr suffix to represent that fact, * and to make all functions work with task (not process) by making the common prefix of the same name. For monotony the routines signal_session() and set_signal_session() are replaced with task_session_nr() and set_task_session(), especially since they are only used with the explicit task->signal dereference. Signed-off-by: Pavel Emelianov <xemul@openvz.org> Acked-by: Serge E. Hallyn <serue@us.ibm.com> Cc: Kirill Korotaev <dev@openvz.org> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Cedric Le Goater <clg@fr.ibm.com> Cc: Herbert Poetzl <herbert@13thfloor.at> Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/sys.c')
-rw-r--r--kernel/sys.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index b8fcbc640193..4cfa213a5ac2 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -968,7 +968,7 @@ asmlinkage long sys_setpgid(pid_t pid, pid_t pgid)
if (err)
goto out;
- if (process_group(p) != pgid) {
+ if (task_pgrp_nr(p) != pgid) {
detach_pid(p, PIDTYPE_PGID);
p->signal->pgrp = pgid;
attach_pid(p, PIDTYPE_PGID, find_pid(pgid));
@@ -984,7 +984,7 @@ out:
asmlinkage long sys_getpgid(pid_t pid)
{
if (!pid)
- return process_group(current);
+ return task_pgrp_nr(current);
else {
int retval;
struct task_struct *p;
@@ -996,7 +996,7 @@ asmlinkage long sys_getpgid(pid_t pid)
if (p) {
retval = security_task_getpgid(p);
if (!retval)
- retval = process_group(p);
+ retval = task_pgrp_nr(p);
}
read_unlock(&tasklist_lock);
return retval;
@@ -1008,7 +1008,7 @@ asmlinkage long sys_getpgid(pid_t pid)
asmlinkage long sys_getpgrp(void)
{
/* SMP - assuming writes are word atomic this is fine */
- return process_group(current);
+ return task_pgrp_nr(current);
}
#endif
@@ -1016,7 +1016,7 @@ asmlinkage long sys_getpgrp(void)
asmlinkage long sys_getsid(pid_t pid)
{
if (!pid)
- return process_session(current);
+ return task_session_nr(current);
else {
int retval;
struct task_struct *p;
@@ -1028,7 +1028,7 @@ asmlinkage long sys_getsid(pid_t pid)
if (p) {
retval = security_task_getsid(p);
if (!retval)
- retval = process_session(p);
+ retval = task_session_nr(p);
}
read_unlock(&tasklist_lock);
return retval;
@@ -1065,7 +1065,7 @@ asmlinkage long sys_setsid(void)
group_leader->signal->tty = NULL;
spin_unlock(&group_leader->sighand->siglock);
- err = process_group(group_leader);
+ err = task_pgrp_nr(group_leader);
out:
write_unlock_irq(&tasklist_lock);
return err;