提交 558cb325 编写于 作者: E Eric W. Biederman 提交者: Linus Torvalds

[PATCH] pid: add do_each_pid_task

To avoid pid rollover confusion the kernel needs to work with struct pid *
instead of pid_t.  Currently there is not an iterator that walks through all
of the tasks of a given pid type starting with a struct pid.  This prevents us
replacing some pid_t instances with struct pid.  So this patch adds
do_each_pid_task which walks through the set of task for a given pid type
starting with a struct pid.
Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 22c935f4
......@@ -119,4 +119,17 @@ extern void FASTCALL(free_pid(struct pid *pid));
1; }) ); \
}
#define do_each_pid_task(pid, type, task) \
if ((task = pid_task(pid, type))) { \
prefetch(pid_next(task, type)); \
do {
#define while_each_pid_task(pid, type, task) \
} while (pid_next(task, type) && ({ \
task = pid_next_task(task, type); \
rcu_dereference(task); \
prefetch(pid_next(task, type)); \
1; }) ); \
}
#endif /* _LINUX_PID_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册