From a47afb0f9d794d525a372c8d69902147cc88222a Mon Sep 17 00:00:00 2001 From: Pavel Emelianov Date: Thu, 18 Oct 2007 23:39:46 -0700 Subject: 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 Acked-by: Serge E. Hallyn Cc: Kirill Korotaev Cc: "Eric W. Biederman" Cc: Cedric Le Goater Cc: Herbert Poetzl Cc: Sukadev Bhattiprolu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- kernel/sys.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'kernel/sys.c') diff --git a/kernel/sys.c b/kernel/sys.c index b8fcbc64019..4cfa213a5ac 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; -- cgit v1.2.3