diff options
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r-- | kernel/cgroup.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index f55af3daffc2..fd572d057691 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -84,7 +84,7 @@ struct cgroupfs_root { | |||
84 | /* Tracks how many cgroups are currently defined in hierarchy.*/ | 84 | /* Tracks how many cgroups are currently defined in hierarchy.*/ |
85 | int number_of_cgroups; | 85 | int number_of_cgroups; |
86 | 86 | ||
87 | /* A list running through the mounted hierarchies */ | 87 | /* A list running through the active hierarchies */ |
88 | struct list_head root_list; | 88 | struct list_head root_list; |
89 | 89 | ||
90 | /* Hierarchy-specific flags */ | 90 | /* Hierarchy-specific flags */ |
@@ -148,8 +148,8 @@ static int notify_on_release(const struct cgroup *cgrp) | |||
148 | #define for_each_subsys(_root, _ss) \ | 148 | #define for_each_subsys(_root, _ss) \ |
149 | list_for_each_entry(_ss, &_root->subsys_list, sibling) | 149 | list_for_each_entry(_ss, &_root->subsys_list, sibling) |
150 | 150 | ||
151 | /* for_each_root() allows you to iterate across the active hierarchies */ | 151 | /* for_each_active_root() allows you to iterate across the active hierarchies */ |
152 | #define for_each_root(_root) \ | 152 | #define for_each_active_root(_root) \ |
153 | list_for_each_entry(_root, &roots, root_list) | 153 | list_for_each_entry(_root, &roots, root_list) |
154 | 154 | ||
155 | /* the list of cgroups eligible for automatic release. Protected by | 155 | /* the list of cgroups eligible for automatic release. Protected by |
@@ -1111,10 +1111,9 @@ static void cgroup_kill_sb(struct super_block *sb) { | |||
1111 | } | 1111 | } |
1112 | write_unlock(&css_set_lock); | 1112 | write_unlock(&css_set_lock); |
1113 | 1113 | ||
1114 | if (!list_empty(&root->root_list)) { | 1114 | list_del(&root->root_list); |
1115 | list_del(&root->root_list); | 1115 | root_count--; |
1116 | root_count--; | 1116 | |
1117 | } | ||
1118 | mutex_unlock(&cgroup_mutex); | 1117 | mutex_unlock(&cgroup_mutex); |
1119 | 1118 | ||
1120 | kfree(root); | 1119 | kfree(root); |
@@ -2559,7 +2558,6 @@ int __init cgroup_init_early(void) | |||
2559 | INIT_HLIST_NODE(&init_css_set.hlist); | 2558 | INIT_HLIST_NODE(&init_css_set.hlist); |
2560 | css_set_count = 1; | 2559 | css_set_count = 1; |
2561 | init_cgroup_root(&rootnode); | 2560 | init_cgroup_root(&rootnode); |
2562 | list_add(&rootnode.root_list, &roots); | ||
2563 | root_count = 1; | 2561 | root_count = 1; |
2564 | init_task.cgroups = &init_css_set; | 2562 | init_task.cgroups = &init_css_set; |
2565 | 2563 | ||
@@ -2666,15 +2664,12 @@ static int proc_cgroup_show(struct seq_file *m, void *v) | |||
2666 | 2664 | ||
2667 | mutex_lock(&cgroup_mutex); | 2665 | mutex_lock(&cgroup_mutex); |
2668 | 2666 | ||
2669 | for_each_root(root) { | 2667 | for_each_active_root(root) { |
2670 | struct cgroup_subsys *ss; | 2668 | struct cgroup_subsys *ss; |
2671 | struct cgroup *cgrp; | 2669 | struct cgroup *cgrp; |
2672 | int subsys_id; | 2670 | int subsys_id; |
2673 | int count = 0; | 2671 | int count = 0; |
2674 | 2672 | ||
2675 | /* Skip this hierarchy if it has no active subsystems */ | ||
2676 | if (!root->actual_subsys_bits) | ||
2677 | continue; | ||
2678 | seq_printf(m, "%lu:", root->subsys_bits); | 2673 | seq_printf(m, "%lu:", root->subsys_bits); |
2679 | for_each_subsys(root, ss) | 2674 | for_each_subsys(root, ss) |
2680 | seq_printf(m, "%s%s", count++ ? "," : "", ss->name); | 2675 | seq_printf(m, "%s%s", count++ ? "," : "", ss->name); |