cgroup: make css_for_each_descendant() and friends include the origin css in the...
[linux-2.6-block.git] / mm / memcontrol.c
index 2885e3e85047cf6192319109b52076bcd19b0d81..b89d4cbc0c0801f89986a934b6ac165b4f704352 100644 (file)
@@ -1079,14 +1079,7 @@ static struct mem_cgroup *__mem_cgroup_iter_next(struct mem_cgroup *root,
 {
        struct cgroup_subsys_state *prev_css, *next_css;
 
-       /*
-        * Root is not visited by cgroup iterators so it needs an
-        * explicit visit.
-        */
-       if (!last_visited)
-               return root;
-
-       prev_css = (last_visited == root) ? NULL : &last_visited->css;
+       prev_css = last_visited ? &last_visited->css : NULL;
 skip_node:
        next_css = css_next_descendant_pre(prev_css, &root->css);