* the start of the next iteration by, for example, bumping the css refcnt.
  */
 #define cgroup_for_each_child(pos, cgrp)                               \
-       for ((pos) = list_first_or_null_rcu(&(cgrp)->children,          \
-                                           struct cgroup, sibling);    \
-            (pos); (pos) = cgroup_next_child((pos), (cgrp)))
+       for ((pos) = cgroup_next_child(NULL, (cgrp)); (pos);            \
+            (pos) = cgroup_next_child((pos), (cgrp)))
 
 struct cgroup *cgroup_next_descendant_pre(struct cgroup *pos,
                                          struct cgroup *cgroup);
 
                pos = cgroup;
 
        /* visit the first child if exists */
-       next = list_first_or_null_rcu(&pos->children, struct cgroup, sibling);
+       next = cgroup_next_child(NULL, pos);
        if (next)
                return next;
 
                last = pos;
                /* ->prev isn't RCU safe, walk ->next till the end */
                pos = NULL;
-               list_for_each_entry_rcu(tmp, &last->children, sibling)
+               cgroup_for_each_child(tmp, last)
                        pos = tmp;
        } while (pos);
 
 
        do {
                last = pos;
-               pos = list_first_or_null_rcu(&pos->children, struct cgroup,
-                                            sibling);
+               pos = cgroup_next_child(NULL, pos);
        } while (pos);
 
        return last;