提交 6803c006 编写于 作者: T Tejun Heo

cgroup: add css_set->dfl_cgrp

To implement the unified hierarchy behavior, we'll need to be able to
determine the associated cgroup on the default hierarchy from css_set.
Let's add css_set->dfl_cgrp so that it can be accessed conveniently
and efficiently.
Signed-off-by: NTejun Heo <tj@kernel.org>
Acked-by: NLi Zefan <lizefan@huawei.com>
上级 bd53d617
...@@ -354,6 +354,9 @@ struct css_set { ...@@ -354,6 +354,9 @@ struct css_set {
*/ */
struct list_head cgrp_links; struct list_head cgrp_links;
/* the default cgroup associated with this css_set */
struct cgroup *dfl_cgrp;
/* /*
* Set of subsystem states, one for each subsystem. This array is * Set of subsystem states, one for each subsystem. This array is
* immutable after creation apart from the init_css_set during * immutable after creation apart from the init_css_set during
......
...@@ -651,6 +651,10 @@ static void link_css_set(struct list_head *tmp_links, struct css_set *cset, ...@@ -651,6 +651,10 @@ static void link_css_set(struct list_head *tmp_links, struct css_set *cset,
struct cgrp_cset_link *link; struct cgrp_cset_link *link;
BUG_ON(list_empty(tmp_links)); BUG_ON(list_empty(tmp_links));
if (cgroup_on_dfl(cgrp))
cset->dfl_cgrp = cgrp;
link = list_first_entry(tmp_links, struct cgrp_cset_link, cset_link); link = list_first_entry(tmp_links, struct cgrp_cset_link, cset_link);
link->cset = cset; link->cset = cset;
link->cgrp = cgrp; link->cgrp = cgrp;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册