aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sys.c
diff options
context:
space:
mode:
authorPavel Emelianov <xemul@openvz.org>2007-10-19 02:39:46 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-19 14:53:37 -0400
commita47afb0f9d794d525a372c8d69902147cc88222a (patch)
tree7bd67280e2edc1c3b1803d4a93bee794088e9342 /kernel/sys.c
parent858d72ead4864da0fb0b89b919524125ce998e27 (diff)
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)
968 if (err) 968 if (err)
969 goto out; 969 goto out;
970 970
971 if (process_group(p) != pgid) { 971 if (task_pgrp_nr(p) != pgid) {
972 detach_pid(p, PIDTYPE_PGID); 972 detach_pid(p, PIDTYPE_PGID);
973 p->signal->pgrp = pgid; 973 p->signal->pgrp = pgid;
974 attach_pid(p, PIDTYPE_PGID, find_pid(pgid)); 974 attach_pid(p, PIDTYPE_PGID, find_pid(pgid));
@@ -984,7 +984,7 @@ out:
984asmlinkage long sys_getpgid(pid_t pid) 984asmlinkage long sys_getpgid(pid_t pid)
985{ 985{
986 if (!pid) 986 if (!pid)
987 return process_group(current); 987 return task_pgrp_nr(current);
988 else { 988 else {
989 int retval; 989 int retval;
990 struct task_struct *p; 990 struct task_struct *p;
@@ -996,7 +996,7 @@ asmlinkage long sys_getpgid(pid_t pid)
996 if (p) { 996 if (p) {
997 retval = security_task_getpgid(p); 997 retval = security_task_getpgid(p);
998 if (!retval) 998 if (!retval)
999 retval = process_group(p); 999 retval = task_pgrp_nr(p);
1000 } 1000 }
1001 read_unlock(&tasklist_lock); 1001 read_unlock(&tasklist_lock);
1002 return retval; 1002 return retval;
@@ -1008,7 +1008,7 @@ asmlinkage long sys_getpgid(pid_t pid)
1008asmlinkage long sys_getpgrp(void) 1008asmlinkage long sys_getpgrp(void)
1009{ 1009{
1010 /* SMP - assuming writes are word atomic this is fine */ 1010 /* SMP - assuming writes are word atomic this is fine */
1011 return process_group(current); 1011 return task_pgrp_nr(current);
1012} 1012}
1013 1013
1014#endif 1014#endif
@@ -1016,7 +1016,7 @@ asmlinkage long sys_getpgrp(void)
1016asmlinkage long sys_getsid(pid_t pid) 1016asmlinkage long sys_getsid(pid_t pid)
1017{ 1017{
1018 if (!pid) 1018 if (!pid)
1019 return process_session(current); 1019 return task_session_nr(current);
1020 else { 1020 else {
1021 int retval; 1021 int retval;
1022 struct task_struct *p; 1022 struct task_struct *p;
@@ -1028,7 +1028,7 @@ asmlinkage long sys_getsid(pid_t pid)
1028 if (p) { 1028 if (p) {
1029 retval = security_task_getsid(p); 1029 retval = security_task_getsid(p);
1030 if (!retval) 1030 if (!retval)
1031 retval = process_session(p); 1031 retval = task_session_nr(p);
1032 } 1032 }
1033 read_unlock(&tasklist_lock); 1033 read_unlock(&tasklist_lock);
1034 return retval; 1034 return retval;
@@ -1065,7 +1065,7 @@ asmlinkage long sys_setsid(void)
1065 group_leader->signal->tty = NULL; 1065 group_leader->signal->tty = NULL;
1066 spin_unlock(&group_leader->sighand->siglock); 1066 spin_unlock(&group_leader->sighand->siglock);
1067 1067
1068 err = process_group(group_leader); 1068 err = task_pgrp_nr(group_leader);
1069out: 1069out:
1070 write_unlock_irq(&tasklist_lock); 1070 write_unlock_irq(&tasklist_lock);
1071 return err; 1071 return err;