aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2013-07-03 18:08:26 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 19:08:02 -0400
commit81dabb464139324c005159f5afba377104d8828d (patch)
tree6f105f6a2a4f32b8ff45efb51889b172452e7282
parent3f4185483832ccf3d2977923db576fa689c2abce (diff)
exit.c: unexport __set_special_pids()
Move __set_special_pids() from exit.c to sys.c close to its single caller and make it static. And rename it to set_special_pids(), another helper with this name has gone away. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/sched.h2
-rw-r--r--kernel/exit.c11
-rw-r--r--kernel/sys.c13
3 files changed, 12 insertions, 14 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index ec80684a0127..cdd5407b37e2 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1950,8 +1950,6 @@ extern struct task_struct *find_task_by_vpid(pid_t nr);
1950extern struct task_struct *find_task_by_pid_ns(pid_t nr, 1950extern struct task_struct *find_task_by_pid_ns(pid_t nr,
1951 struct pid_namespace *ns); 1951 struct pid_namespace *ns);
1952 1952
1953extern void __set_special_pids(struct pid *pid);
1954
1955/* per-UID process charging. */ 1953/* per-UID process charging. */
1956extern struct user_struct * alloc_uid(kuid_t); 1954extern struct user_struct * alloc_uid(kuid_t);
1957static inline struct user_struct *get_uid(struct user_struct *u) 1955static inline struct user_struct *get_uid(struct user_struct *u)
diff --git a/kernel/exit.c b/kernel/exit.c
index 7bb73f9d09db..3a77cd9390a1 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -312,17 +312,6 @@ kill_orphaned_pgrp(struct task_struct *tsk, struct task_struct *parent)
312 } 312 }
313} 313}
314 314
315void __set_special_pids(struct pid *pid)
316{
317 struct task_struct *curr = current->group_leader;
318
319 if (task_session(curr) != pid)
320 change_pid(curr, PIDTYPE_SID, pid);
321
322 if (task_pgrp(curr) != pid)
323 change_pid(curr, PIDTYPE_PGID, pid);
324}
325
326/* 315/*
327 * Let kernel threads use this to say that they allow a certain signal. 316 * Let kernel threads use this to say that they allow a certain signal.
328 * Must not be used if kthread was cloned with CLONE_SIGHAND. 317 * Must not be used if kthread was cloned with CLONE_SIGHAND.
diff --git a/kernel/sys.c b/kernel/sys.c
index 7bf50dcc6d53..071de900c824 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1309,6 +1309,17 @@ out:
1309 return retval; 1309 return retval;
1310} 1310}
1311 1311
1312static void set_special_pids(struct pid *pid)
1313{
1314 struct task_struct *curr = current->group_leader;
1315
1316 if (task_session(curr) != pid)
1317 change_pid(curr, PIDTYPE_SID, pid);
1318
1319 if (task_pgrp(curr) != pid)
1320 change_pid(curr, PIDTYPE_PGID, pid);
1321}
1322
1312SYSCALL_DEFINE0(setsid) 1323SYSCALL_DEFINE0(setsid)
1313{ 1324{
1314 struct task_struct *group_leader = current->group_leader; 1325 struct task_struct *group_leader = current->group_leader;
@@ -1328,7 +1339,7 @@ SYSCALL_DEFINE0(setsid)
1328 goto out; 1339 goto out;
1329 1340
1330 group_leader->signal->leader = 1; 1341 group_leader->signal->leader = 1;
1331 __set_special_pids(sid); 1342 set_special_pids(sid);
1332 1343
1333 proc_clear_tty(group_leader); 1344 proc_clear_tty(group_leader);
1334 1345