Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 376558
b: refs/heads/master
c: 7805d00
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo committed May 24, 2013
1 parent 2180c70 commit ce10250
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d6cbf35dac8a3dadb9103379820c96d7c85df3d9
refs/heads/master: 7805d000db30a3787a4c969bab6ae4d8a5fd8ce6
2 changes: 1 addition & 1 deletion trunk/include/linux/cgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ struct cgroup *cgroup_rightmost_descendant(struct cgroup *pos);
*
* If a subsystem synchronizes against the parent in its ->css_online() and
* before starting iterating, and synchronizes against @pos on each
* iteration, any descendant cgroup which finished ->css_offline() is
* iteration, any descendant cgroup which finished ->css_online() is
* guaranteed to be visible in the future iterations.
*
* In other words, the following guarantees that a descendant can't escape
Expand Down
9 changes: 3 additions & 6 deletions trunk/kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -2954,26 +2954,23 @@ struct cgroup *cgroup_next_descendant_pre(struct cgroup *pos,
WARN_ON_ONCE(!rcu_read_lock_held());

/* if first iteration, pretend we just visited @cgroup */
if (!pos) {
if (list_empty(&cgroup->children))
return NULL;
if (!pos)
pos = cgroup;
}

/* visit the first child if exists */
next = list_first_or_null_rcu(&pos->children, struct cgroup, sibling);
if (next)
return next;

/* no child, visit my or the closest ancestor's next sibling */
do {
while (pos != cgroup) {
next = list_entry_rcu(pos->sibling.next, struct cgroup,
sibling);
if (&next->sibling != &pos->parent->children)
return next;

pos = pos->parent;
} while (pos != cgroup);
}

return NULL;
}
Expand Down

0 comments on commit ce10250

Please sign in to comment.