summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2017-05-05 21:45:14 +0300
committerEric W. Biederman <ebiederm@xmission.com>2018-07-21 18:43:12 +0300
commit1fb53567a3633740aac8761eb7023dc5671f0edb (patch)
tree4d3dd286e1490f5cb837f28c55b7121d557a277f /include
parent2896b0f09f2617f953b8038978106cc4cbb4c52b (diff)
downloadlinux-1fb53567a3633740aac8761eb7023dc5671f0edb.tar.xz
pids: Move task_pid_type into sched/signal.h
The function is general and inline so there is no need to hide it inside of exit.c Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/sched/signal.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h
index 113d1ad1ced7..d8ef0a3d2e7e 100644
--- a/include/linux/sched/signal.h
+++ b/include/linux/sched/signal.h
@@ -556,6 +556,14 @@ extern bool current_is_single_threaded(void);
typedef int (*proc_visitor)(struct task_struct *p, void *data);
void walk_process_tree(struct task_struct *top, proc_visitor, void *);
+static inline
+struct pid *task_pid_type(struct task_struct *task, enum pid_type type)
+{
+ if (type != PIDTYPE_PID)
+ task = task->group_leader;
+ return task->pids[type].pid;
+}
+
static inline int get_nr_threads(struct task_struct *tsk)
{
return tsk->signal->nr_threads;