diff options
author | Tejun Heo <tj@kernel.org> | 2014-07-15 11:05:09 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-07-15 11:05:09 -0400 |
commit | 5577964e64692e17cc498854b7e0833e6532cd64 (patch) | |
tree | 92474a4bf3de98268a3af979130a88e934ea7345 | |
parent | a14c6874be09a05a48093df8df87ca021f310332 (diff) |
cgroup: rename cgroup_subsys->base_cftypes to ->legacy_cftypes
Currently, cgroup_subsys->base_cftypes is used for both the unified
default hierarchy and legacy ones and subsystems can mark each file
with either CFTYPE_ONLY_ON_DFL or CFTYPE_INSANE if it has to appear
only on one of them. This is quite hairy and error-prone. Also, we
may end up exposing interface files to the default hierarchy without
thinking it through.
cgroup_subsys will grow two separate cftype arrays and apply each only
on the hierarchies of the matching type. This will allow organizing
cftypes in a lot clearer way and encourage subsystems to scrutinize
the interface which is being exposed in the new default hierarchy.
In preparation, this patch renames cgroup_subsys->base_cftypes to
cgroup_subsys->legacy_cftypes. This patch is pure rename.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Li Zefan <lizefan@huawei.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Aristeu Rozanski <aris@redhat.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
-rw-r--r-- | block/blk-cgroup.c | 2 | ||||
-rw-r--r-- | include/linux/cgroup.h | 2 | ||||
-rw-r--r-- | kernel/cgroup.c | 4 | ||||
-rw-r--r-- | kernel/cgroup_freezer.c | 2 | ||||
-rw-r--r-- | kernel/cpuset.c | 2 | ||||
-rw-r--r-- | kernel/sched/core.c | 2 | ||||
-rw-r--r-- | kernel/sched/cpuacct.c | 2 | ||||
-rw-r--r-- | mm/memcontrol.c | 2 | ||||
-rw-r--r-- | net/core/netclassid_cgroup.c | 2 | ||||
-rw-r--r-- | net/core/netprio_cgroup.c | 2 | ||||
-rw-r--r-- | security/device_cgroup.c | 2 |
11 files changed, 12 insertions, 12 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 63c3cd454d1e..5cfbc723041c 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c | |||
@@ -924,7 +924,7 @@ struct cgroup_subsys blkio_cgrp_subsys = { | |||
924 | .css_offline = blkcg_css_offline, | 924 | .css_offline = blkcg_css_offline, |
925 | .css_free = blkcg_css_free, | 925 | .css_free = blkcg_css_free, |
926 | .can_attach = blkcg_can_attach, | 926 | .can_attach = blkcg_can_attach, |
927 | .base_cftypes = blkcg_files, | 927 | .legacy_cftypes = blkcg_files, |
928 | #ifdef CONFIG_MEMCG | 928 | #ifdef CONFIG_MEMCG |
929 | /* | 929 | /* |
930 | * This ensures that, if available, memcg is automatically enabled | 930 | * This ensures that, if available, memcg is automatically enabled |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 7bb274487c89..a6e9c2eeab89 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -672,7 +672,7 @@ struct cgroup_subsys { | |||
672 | struct list_head cfts; | 672 | struct list_head cfts; |
673 | 673 | ||
674 | /* base cftypes, automatically registered with subsys itself */ | 674 | /* base cftypes, automatically registered with subsys itself */ |
675 | struct cftype *base_cftypes; | 675 | struct cftype *legacy_cftypes; /* used on the legacy hierarchies */ |
676 | 676 | ||
677 | /* | 677 | /* |
678 | * A subsystem may depend on other subsystems. When such subsystem | 678 | * A subsystem may depend on other subsystems. When such subsystem |
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 7e5fee5d6422..6496a83b0314 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -4890,7 +4890,7 @@ int __init cgroup_init(void) | |||
4890 | */ | 4890 | */ |
4891 | if (!ss->disabled) { | 4891 | if (!ss->disabled) { |
4892 | cgrp_dfl_root.subsys_mask |= 1 << ss->id; | 4892 | cgrp_dfl_root.subsys_mask |= 1 << ss->id; |
4893 | WARN_ON(cgroup_add_cftypes(ss, ss->base_cftypes)); | 4893 | WARN_ON(cgroup_add_cftypes(ss, ss->legacy_cftypes)); |
4894 | } | 4894 | } |
4895 | } | 4895 | } |
4896 | 4896 | ||
@@ -5480,6 +5480,6 @@ static struct cftype debug_files[] = { | |||
5480 | struct cgroup_subsys debug_cgrp_subsys = { | 5480 | struct cgroup_subsys debug_cgrp_subsys = { |
5481 | .css_alloc = debug_css_alloc, | 5481 | .css_alloc = debug_css_alloc, |
5482 | .css_free = debug_css_free, | 5482 | .css_free = debug_css_free, |
5483 | .base_cftypes = debug_files, | 5483 | .legacy_cftypes = debug_files, |
5484 | }; | 5484 | }; |
5485 | #endif /* CONFIG_CGROUP_DEBUG */ | 5485 | #endif /* CONFIG_CGROUP_DEBUG */ |
diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c index a79e40f9d700..92b98cc0ee76 100644 --- a/kernel/cgroup_freezer.c +++ b/kernel/cgroup_freezer.c | |||
@@ -480,5 +480,5 @@ struct cgroup_subsys freezer_cgrp_subsys = { | |||
480 | .css_free = freezer_css_free, | 480 | .css_free = freezer_css_free, |
481 | .attach = freezer_attach, | 481 | .attach = freezer_attach, |
482 | .fork = freezer_fork, | 482 | .fork = freezer_fork, |
483 | .base_cftypes = files, | 483 | .legacy_cftypes = files, |
484 | }; | 484 | }; |
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 53a9bbf16391..f337f42a07ac 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -2036,7 +2036,7 @@ struct cgroup_subsys cpuset_cgrp_subsys = { | |||
2036 | .cancel_attach = cpuset_cancel_attach, | 2036 | .cancel_attach = cpuset_cancel_attach, |
2037 | .attach = cpuset_attach, | 2037 | .attach = cpuset_attach, |
2038 | .bind = cpuset_bind, | 2038 | .bind = cpuset_bind, |
2039 | .base_cftypes = files, | 2039 | .legacy_cftypes = files, |
2040 | .early_init = 1, | 2040 | .early_init = 1, |
2041 | }; | 2041 | }; |
2042 | 2042 | ||
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 3bdf01b494fe..6628e8014824 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -8088,7 +8088,7 @@ struct cgroup_subsys cpu_cgrp_subsys = { | |||
8088 | .can_attach = cpu_cgroup_can_attach, | 8088 | .can_attach = cpu_cgroup_can_attach, |
8089 | .attach = cpu_cgroup_attach, | 8089 | .attach = cpu_cgroup_attach, |
8090 | .exit = cpu_cgroup_exit, | 8090 | .exit = cpu_cgroup_exit, |
8091 | .base_cftypes = cpu_files, | 8091 | .legacy_cftypes = cpu_files, |
8092 | .early_init = 1, | 8092 | .early_init = 1, |
8093 | }; | 8093 | }; |
8094 | 8094 | ||
diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c index 9cf350c94ec4..dd7cbb55bbf2 100644 --- a/kernel/sched/cpuacct.c +++ b/kernel/sched/cpuacct.c | |||
@@ -278,6 +278,6 @@ void cpuacct_account_field(struct task_struct *p, int index, u64 val) | |||
278 | struct cgroup_subsys cpuacct_cgrp_subsys = { | 278 | struct cgroup_subsys cpuacct_cgrp_subsys = { |
279 | .css_alloc = cpuacct_css_alloc, | 279 | .css_alloc = cpuacct_css_alloc, |
280 | .css_free = cpuacct_css_free, | 280 | .css_free = cpuacct_css_free, |
281 | .base_cftypes = files, | 281 | .legacy_cftypes = files, |
282 | .early_init = 1, | 282 | .early_init = 1, |
283 | }; | 283 | }; |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index a2a4bd69a7ae..8331f2739e2c 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -7048,7 +7048,7 @@ struct cgroup_subsys memory_cgrp_subsys = { | |||
7048 | .cancel_attach = mem_cgroup_cancel_attach, | 7048 | .cancel_attach = mem_cgroup_cancel_attach, |
7049 | .attach = mem_cgroup_move_task, | 7049 | .attach = mem_cgroup_move_task, |
7050 | .bind = mem_cgroup_bind, | 7050 | .bind = mem_cgroup_bind, |
7051 | .base_cftypes = mem_cgroup_files, | 7051 | .legacy_cftypes = mem_cgroup_files, |
7052 | .early_init = 0, | 7052 | .early_init = 0, |
7053 | }; | 7053 | }; |
7054 | 7054 | ||
diff --git a/net/core/netclassid_cgroup.c b/net/core/netclassid_cgroup.c index 30d903b19c62..1f2a126f4ffa 100644 --- a/net/core/netclassid_cgroup.c +++ b/net/core/netclassid_cgroup.c | |||
@@ -107,5 +107,5 @@ struct cgroup_subsys net_cls_cgrp_subsys = { | |||
107 | .css_online = cgrp_css_online, | 107 | .css_online = cgrp_css_online, |
108 | .css_free = cgrp_css_free, | 108 | .css_free = cgrp_css_free, |
109 | .attach = cgrp_attach, | 109 | .attach = cgrp_attach, |
110 | .base_cftypes = ss_files, | 110 | .legacy_cftypes = ss_files, |
111 | }; | 111 | }; |
diff --git a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c index 2f385b9bccc0..cbd0a199bf52 100644 --- a/net/core/netprio_cgroup.c +++ b/net/core/netprio_cgroup.c | |||
@@ -249,7 +249,7 @@ struct cgroup_subsys net_prio_cgrp_subsys = { | |||
249 | .css_online = cgrp_css_online, | 249 | .css_online = cgrp_css_online, |
250 | .css_free = cgrp_css_free, | 250 | .css_free = cgrp_css_free, |
251 | .attach = net_prio_attach, | 251 | .attach = net_prio_attach, |
252 | .base_cftypes = ss_files, | 252 | .legacy_cftypes = ss_files, |
253 | }; | 253 | }; |
254 | 254 | ||
255 | static int netprio_device_event(struct notifier_block *unused, | 255 | static int netprio_device_event(struct notifier_block *unused, |
diff --git a/security/device_cgroup.c b/security/device_cgroup.c index d9d69e6930ed..188c1d26393b 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c | |||
@@ -796,7 +796,7 @@ struct cgroup_subsys devices_cgrp_subsys = { | |||
796 | .css_free = devcgroup_css_free, | 796 | .css_free = devcgroup_css_free, |
797 | .css_online = devcgroup_online, | 797 | .css_online = devcgroup_online, |
798 | .css_offline = devcgroup_offline, | 798 | .css_offline = devcgroup_offline, |
799 | .base_cftypes = dev_cgroup_files, | 799 | .legacy_cftypes = dev_cgroup_files, |
800 | }; | 800 | }; |
801 | 801 | ||
802 | /** | 802 | /** |