aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2014-04-23 11:13:16 -0400
committerTejun Heo <tj@kernel.org>2014-04-23 11:13:16 -0400
commit6803c006282768ec850760766a6e4eb1a6ff87df (patch)
treee06bc433865262b4943d3e06e8f3530d34c509bc /kernel
parentbd53d617b34c781dac8e22dbc75e8f182d918ecf (diff)
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: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cgroup.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 2a4f88db3205..c66bfc8ee8a7 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -651,6 +651,10 @@ static void link_css_set(struct list_head *tmp_links, struct css_set *cset,
651 struct cgrp_cset_link *link; 651 struct cgrp_cset_link *link;
652 652
653 BUG_ON(list_empty(tmp_links)); 653 BUG_ON(list_empty(tmp_links));
654
655 if (cgroup_on_dfl(cgrp))
656 cset->dfl_cgrp = cgrp;
657
654 link = list_first_entry(tmp_links, struct cgrp_cset_link, cset_link); 658 link = list_first_entry(tmp_links, struct cgrp_cset_link, cset_link);
655 link->cset = cset; 659 link->cset = cset;
656 link->cgrp = cgrp; 660 link->cgrp = cgrp;