summaryrefslogtreecommitdiff
path: root/include/linux/sched
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2017-09-26 20:45:33 +0300
committerEric W. Biederman <ebiederm@xmission.com>2018-07-21 18:43:12 +0300
commit7a36094d61bfe9843de5484ff0140227983ac5d5 (patch)
tree7ebb9918a753ad3b0c8cd4ed128e7a99c3dd2f99 /include/linux/sched
parent1fb53567a3633740aac8761eb7023dc5671f0edb (diff)
downloadlinux-7a36094d61bfe9843de5484ff0140227983ac5d5.tar.xz
pids: Compute task_tgid using signal->leader_pid
The cost is the the same and this removes the need to worry about complications that come from de_thread and group_leader changing. __task_pid_nr_ns has been updated to take advantage of this change. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'include/linux/sched')
-rw-r--r--include/linux/sched/signal.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h
index d8ef0a3d2e7e..b95a272c1ab5 100644
--- a/include/linux/sched/signal.h
+++ b/include/linux/sched/signal.h
@@ -564,6 +564,11 @@ struct pid *task_pid_type(struct task_struct *task, enum pid_type type)
return task->pids[type].pid;
}
+static inline struct pid *task_tgid(struct task_struct *task)
+{
+ return task->signal->leader_pid;
+}
+
static inline int get_nr_threads(struct task_struct *tsk)
{
return tsk->signal->nr_threads;