-#define for_each_task_pid(who, type, task, elem, pid) \
- if ((pid = find_pid(type, who))) \
- for (elem = pid->task_list.next, \
- prefetch(elem->next), \
- task = pid_task(elem, type); \
- elem != &pid->task_list; \
- elem = elem->next, prefetch(elem->next), \
- task = pid_task(elem, type))
+#define do_each_task_pid(who, type, task) \
+ if ((task = find_task_by_pid_type(type, who))) { \
+ prefetch((task)->pids[type].pid_list.next); \
+ do {
+
+#define while_each_task_pid(who, type, task) \
+ } while (task = pid_task((task)->pids[type].pid_list.next,\
+ type), \
+ prefetch((task)->pids[type].pid_list.next), \
+ hlist_unhashed(&(task)->pids[type].pid_chain)); \
+ } \