mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-18 20:34:01 +00:00
Merge branch 'for-3.10-fixes' into for-3.11
Merging to receive 7805d000db
("cgroup: fix a subtle bug in descendant
pre-order walk") so that further iterator updates can build upon it.
Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
commit
3f33e64f4a
2 changed files with 9 additions and 11 deletions
|
@ -709,7 +709,7 @@ struct cgroup *cgroup_rightmost_descendant(struct cgroup *pos);
|
||||||
*
|
*
|
||||||
* If a subsystem synchronizes against the parent in its ->css_online() and
|
* If a subsystem synchronizes against the parent in its ->css_online() and
|
||||||
* before starting iterating, and synchronizes against @pos on each
|
* 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.
|
* guaranteed to be visible in the future iterations.
|
||||||
*
|
*
|
||||||
* In other words, the following guarantees that a descendant can't escape
|
* In other words, the following guarantees that a descendant can't escape
|
||||||
|
|
|
@ -2736,13 +2736,14 @@ static int cgroup_add_file(struct cgroup *cgrp, struct cgroup_subsys *subsys,
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cfe->type = (void *)cft;
|
||||||
|
cfe->dentry = dentry;
|
||||||
|
dentry->d_fsdata = cfe;
|
||||||
|
simple_xattrs_init(&cfe->xattrs);
|
||||||
|
|
||||||
mode = cgroup_file_mode(cft);
|
mode = cgroup_file_mode(cft);
|
||||||
error = cgroup_create_file(dentry, mode | S_IFREG, cgrp->root->sb);
|
error = cgroup_create_file(dentry, mode | S_IFREG, cgrp->root->sb);
|
||||||
if (!error) {
|
if (!error) {
|
||||||
cfe->type = (void *)cft;
|
|
||||||
cfe->dentry = dentry;
|
|
||||||
dentry->d_fsdata = cfe;
|
|
||||||
simple_xattrs_init(&cfe->xattrs);
|
|
||||||
list_add_tail(&cfe->node, &parent->files);
|
list_add_tail(&cfe->node, &parent->files);
|
||||||
cfe = NULL;
|
cfe = NULL;
|
||||||
}
|
}
|
||||||
|
@ -2990,11 +2991,8 @@ struct cgroup *cgroup_next_descendant_pre(struct cgroup *pos,
|
||||||
WARN_ON_ONCE(!rcu_read_lock_held());
|
WARN_ON_ONCE(!rcu_read_lock_held());
|
||||||
|
|
||||||
/* if first iteration, pretend we just visited @cgroup */
|
/* if first iteration, pretend we just visited @cgroup */
|
||||||
if (!pos) {
|
if (!pos)
|
||||||
if (list_empty(&cgroup->children))
|
|
||||||
return NULL;
|
|
||||||
pos = cgroup;
|
pos = cgroup;
|
||||||
}
|
|
||||||
|
|
||||||
/* visit the first child if exists */
|
/* visit the first child if exists */
|
||||||
next = list_first_or_null_rcu(&pos->children, struct cgroup, sibling);
|
next = list_first_or_null_rcu(&pos->children, struct cgroup, sibling);
|
||||||
|
@ -3002,14 +3000,14 @@ struct cgroup *cgroup_next_descendant_pre(struct cgroup *pos,
|
||||||
return next;
|
return next;
|
||||||
|
|
||||||
/* no child, visit my or the closest ancestor's next sibling */
|
/* no child, visit my or the closest ancestor's next sibling */
|
||||||
do {
|
while (pos != cgroup) {
|
||||||
next = list_entry_rcu(pos->sibling.next, struct cgroup,
|
next = list_entry_rcu(pos->sibling.next, struct cgroup,
|
||||||
sibling);
|
sibling);
|
||||||
if (&next->sibling != &pos->parent->children)
|
if (&next->sibling != &pos->parent->children)
|
||||||
return next;
|
return next;
|
||||||
|
|
||||||
pos = pos->parent;
|
pos = pos->parent;
|
||||||
} while (pos != cgroup);
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue