diff options
-rw-r--r-- | include/linux/pid.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/pid.h b/include/linux/pid.h index 359121086de1..8cf9b11ed264 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h | |||
@@ -119,4 +119,17 @@ extern void FASTCALL(free_pid(struct pid *pid)); | |||
119 | 1; }) ); \ | 119 | 1; }) ); \ |
120 | } | 120 | } |
121 | 121 | ||
122 | #define do_each_pid_task(pid, type, task) \ | ||
123 | if ((task = pid_task(pid, type))) { \ | ||
124 | prefetch(pid_next(task, type)); \ | ||
125 | do { | ||
126 | |||
127 | #define while_each_pid_task(pid, type, task) \ | ||
128 | } while (pid_next(task, type) && ({ \ | ||
129 | task = pid_next_task(task, type); \ | ||
130 | rcu_dereference(task); \ | ||
131 | prefetch(pid_next(task, type)); \ | ||
132 | 1; }) ); \ | ||
133 | } | ||
134 | |||
122 | #endif /* _LINUX_PID_H */ | 135 | #endif /* _LINUX_PID_H */ |