[PATCH 03/15] proc: export next_tgid()
From: Andrey Vagin
Date: Mon Apr 11 2016 - 19:39:42 EST
It's going to be used in task_diag
Signed-off-by: Andrey Vagin <avagin@xxxxxxxxxx>
---
fs/proc/base.c | 6 +-----
fs/proc/internal.h | 6 ++++++
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 614f1d0..9e5fd1c 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -3071,11 +3071,7 @@ out:
* Find the first task with tgid >= tgid
*
*/
-struct tgid_iter {
- unsigned int tgid;
- struct task_struct *task;
-};
-static struct tgid_iter next_tgid(struct pid_namespace *ns, struct tgid_iter iter)
+struct tgid_iter next_tgid(struct pid_namespace *ns, struct tgid_iter iter)
{
struct pid *pid;
diff --git a/fs/proc/internal.h b/fs/proc/internal.h
index 49145e2..2a2b1e6 100644
--- a/fs/proc/internal.h
+++ b/fs/proc/internal.h
@@ -304,6 +304,12 @@ extern unsigned long task_statm(struct mm_struct *,
unsigned long *, unsigned long *);
extern void task_mem(struct seq_file *, struct mm_struct *);
+struct tgid_iter {
+ unsigned int tgid;
+ struct task_struct *task;
+};
+struct tgid_iter next_tgid(struct pid_namespace *ns, struct tgid_iter iter);
+
struct task_struct *
task_next_child(struct task_struct *parent, struct task_struct *prev, unsigned int pos);
--
2.5.5