]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/pid.h
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[linux-2.6-omap-h63xx.git] / include / linux / pid.h
index 22921ac4cfd948b88e10a06c0725b33363b38caf..bb206c56d1f0eb16877a0c664712edae4de9df1d 100644 (file)
@@ -147,9 +147,9 @@ pid_t pid_vnr(struct pid *pid);
 #define do_each_pid_task(pid, type, task)                              \
        do {                                                            \
                struct hlist_node *pos___;                              \
-               if (pid != NULL)                                        \
+               if ((pid) != NULL)                                      \
                        hlist_for_each_entry_rcu((task), pos___,        \
-                               &pid->tasks[type], pids[type].node) {
+                               &(pid)->tasks[type], pids[type].node) {
 
                        /*
                         * Both old and new leaders may be attached to
@@ -161,4 +161,13 @@ pid_t pid_vnr(struct pid *pid);
                        }                                               \
        } while (0)
 
+#define do_each_pid_thread(pid, type, task)                            \
+       do_each_pid_task(pid, type, task) {                             \
+               struct task_struct *tg___ = task;                       \
+               do {
+
+#define while_each_pid_thread(pid, type, task)                         \
+               } while_each_thread(tg___, task);                       \
+               task = tg___;                                           \
+       } while_each_pid_task(pid, type, task)
 #endif /* _LINUX_PID_H */