diff options
| author | Tejun Heo <tj@kernel.org> | 2015-08-25 14:19:29 -0400 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2015-08-25 14:19:29 -0400 |
| commit | 20f1f4b5ffb870631bf4a4e7c7ba10e3528ae6a6 (patch) | |
| tree | d5349c9c4844e37eff6eda7c3a78d5d9970b9ee8 /kernel | |
| parent | ce52399520e4b97466165737e00c7b528ae8c8f5 (diff) | |
| parent | 3e1d2eed39d804e48282931835c7203fa47fe1d9 (diff) | |
Merge branch 'for-4.3-unified-base' into for-4.3
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/cgroup.c | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 97e2da0d3b27..4ec1b7ee5de8 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
| @@ -145,6 +145,7 @@ static const char *cgroup_subsys_name[] = { | |||
| 145 | * part of that cgroup. | 145 | * part of that cgroup. |
| 146 | */ | 146 | */ |
| 147 | struct cgroup_root cgrp_dfl_root; | 147 | struct cgroup_root cgrp_dfl_root; |
| 148 | EXPORT_SYMBOL_GPL(cgrp_dfl_root); | ||
| 148 | 149 | ||
| 149 | /* | 150 | /* |
| 150 | * The default hierarchy always exists but is hidden until mounted for the | 151 | * The default hierarchy always exists but is hidden until mounted for the |
| @@ -1030,10 +1031,13 @@ static const struct file_operations proc_cgroupstats_operations; | |||
| 1030 | static char *cgroup_file_name(struct cgroup *cgrp, const struct cftype *cft, | 1031 | static char *cgroup_file_name(struct cgroup *cgrp, const struct cftype *cft, |
| 1031 | char *buf) | 1032 | char *buf) |
| 1032 | { | 1033 | { |
| 1034 | struct cgroup_subsys *ss = cft->ss; | ||
| 1035 | |||
| 1033 | if (cft->ss && !(cft->flags & CFTYPE_NO_PREFIX) && | 1036 | if (cft->ss && !(cft->flags & CFTYPE_NO_PREFIX) && |
| 1034 | !(cgrp->root->flags & CGRP_ROOT_NOPREFIX)) | 1037 | !(cgrp->root->flags & CGRP_ROOT_NOPREFIX)) |
| 1035 | snprintf(buf, CGROUP_FILE_NAME_MAX, "%s.%s", | 1038 | snprintf(buf, CGROUP_FILE_NAME_MAX, "%s.%s", |
| 1036 | cft->ss->name, cft->name); | 1039 | cgroup_on_dfl(cgrp) ? ss->name : ss->legacy_name, |
| 1040 | cft->name); | ||
| 1037 | else | 1041 | else |
| 1038 | strncpy(buf, cft->name, CGROUP_FILE_NAME_MAX); | 1042 | strncpy(buf, cft->name, CGROUP_FILE_NAME_MAX); |
| 1039 | return buf; | 1043 | return buf; |
| @@ -1335,9 +1339,10 @@ static int cgroup_show_options(struct seq_file *seq, | |||
| 1335 | struct cgroup_subsys *ss; | 1339 | struct cgroup_subsys *ss; |
| 1336 | int ssid; | 1340 | int ssid; |
| 1337 | 1341 | ||
| 1338 | for_each_subsys(ss, ssid) | 1342 | if (root != &cgrp_dfl_root) |
| 1339 | if (root->subsys_mask & (1 << ssid)) | 1343 | for_each_subsys(ss, ssid) |
| 1340 | seq_printf(seq, ",%s", ss->name); | 1344 | if (root->subsys_mask & (1 << ssid)) |
| 1345 | seq_printf(seq, ",%s", ss->legacy_name); | ||
| 1341 | if (root->flags & CGRP_ROOT_NOPREFIX) | 1346 | if (root->flags & CGRP_ROOT_NOPREFIX) |
| 1342 | seq_puts(seq, ",noprefix"); | 1347 | seq_puts(seq, ",noprefix"); |
| 1343 | if (root->flags & CGRP_ROOT_XATTR) | 1348 | if (root->flags & CGRP_ROOT_XATTR) |
| @@ -1450,7 +1455,7 @@ static int parse_cgroupfs_options(char *data, struct cgroup_sb_opts *opts) | |||
| 1450 | } | 1455 | } |
| 1451 | 1456 | ||
| 1452 | for_each_subsys(ss, i) { | 1457 | for_each_subsys(ss, i) { |
| 1453 | if (strcmp(token, ss->name)) | 1458 | if (strcmp(token, ss->legacy_name)) |
| 1454 | continue; | 1459 | continue; |
| 1455 | if (ss->disabled) | 1460 | if (ss->disabled) |
| 1456 | continue; | 1461 | continue; |
| @@ -4997,6 +5002,8 @@ int __init cgroup_init_early(void) | |||
| 4997 | 5002 | ||
| 4998 | ss->id = i; | 5003 | ss->id = i; |
| 4999 | ss->name = cgroup_subsys_name[i]; | 5004 | ss->name = cgroup_subsys_name[i]; |
| 5005 | if (!ss->legacy_name) | ||
| 5006 | ss->legacy_name = cgroup_subsys_name[i]; | ||
| 5000 | 5007 | ||
| 5001 | if (ss->early_init) | 5008 | if (ss->early_init) |
| 5002 | cgroup_init_subsys(ss, true); | 5009 | cgroup_init_subsys(ss, true); |
| @@ -5140,9 +5147,11 @@ int proc_cgroup_show(struct seq_file *m, struct pid_namespace *ns, | |||
| 5140 | continue; | 5147 | continue; |
| 5141 | 5148 | ||
| 5142 | seq_printf(m, "%d:", root->hierarchy_id); | 5149 | seq_printf(m, "%d:", root->hierarchy_id); |
| 5143 | for_each_subsys(ss, ssid) | 5150 | if (root != &cgrp_dfl_root) |
| 5144 | if (root->subsys_mask & (1 << ssid)) | 5151 | for_each_subsys(ss, ssid) |
| 5145 | seq_printf(m, "%s%s", count++ ? "," : "", ss->name); | 5152 | if (root->subsys_mask & (1 << ssid)) |
| 5153 | seq_printf(m, "%s%s", count++ ? "," : "", | ||
| 5154 | ss->legacy_name); | ||
| 5146 | if (strlen(root->name)) | 5155 | if (strlen(root->name)) |
| 5147 | seq_printf(m, "%sname=%s", count ? "," : "", | 5156 | seq_printf(m, "%sname=%s", count ? "," : "", |
| 5148 | root->name); | 5157 | root->name); |
| @@ -5182,7 +5191,7 @@ static int proc_cgroupstats_show(struct seq_file *m, void *v) | |||
| 5182 | 5191 | ||
| 5183 | for_each_subsys(ss, i) | 5192 | for_each_subsys(ss, i) |
| 5184 | seq_printf(m, "%s\t%d\t%d\t%d\n", | 5193 | seq_printf(m, "%s\t%d\t%d\t%d\n", |
| 5185 | ss->name, ss->root->hierarchy_id, | 5194 | ss->legacy_name, ss->root->hierarchy_id, |
| 5186 | atomic_read(&ss->root->nr_cgrps), !ss->disabled); | 5195 | atomic_read(&ss->root->nr_cgrps), !ss->disabled); |
| 5187 | 5196 | ||
| 5188 | mutex_unlock(&cgroup_mutex); | 5197 | mutex_unlock(&cgroup_mutex); |
| @@ -5469,12 +5478,14 @@ static int __init cgroup_disable(char *str) | |||
| 5469 | continue; | 5478 | continue; |
| 5470 | 5479 | ||
| 5471 | for_each_subsys(ss, i) { | 5480 | for_each_subsys(ss, i) { |
| 5472 | if (!strcmp(token, ss->name)) { | 5481 | if (strcmp(token, ss->name) && |
| 5473 | ss->disabled = 1; | 5482 | strcmp(token, ss->legacy_name)) |
| 5474 | printk(KERN_INFO "Disabling %s control group" | 5483 | continue; |
| 5475 | " subsystem\n", ss->name); | 5484 | |
| 5476 | break; | 5485 | ss->disabled = 1; |
| 5477 | } | 5486 | printk(KERN_INFO "Disabling %s control group subsystem\n", |
| 5487 | ss->name); | ||
| 5488 | break; | ||
| 5478 | } | 5489 | } |
| 5479 | } | 5490 | } |
| 5480 | return 1; | 5491 | return 1; |
