diff options
author | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2012-09-12 10:12:05 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2012-09-14 12:57:37 -0400 |
commit | 5fc0b02544b3b9bd3db5a8156b5f3e7350f8e797 (patch) | |
tree | 9382ec0de547289cbda8f4bdb90eb65a029398eb /include/linux/cgroup_subsys.h | |
parent | be45c900fdc2c66baad5a7703fb8136991d88aeb (diff) |
cgroup: Wrap subsystem selection macro
Before we are able to define all subsystem ids at compile time we need
a more fine grained control what gets defined when we include
cgroup_subsys.h. For example we define the enums for the subsystems or
to declare for struct cgroup_subsys (builtin subsystem) by including
cgroup_subsys.h and defining SUBSYS accordingly.
Currently, the decision if a subsys is used is defined inside the
header by testing if CONFIG_*=y is true. By moving this test outside
of cgroup_subsys.h we are able to control it on the include level.
This is done by introducing IS_SUBSYS_ENABLED which then is defined
according the task, e.g. is CONFIG_*=y or CONFIG_*=m.
Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Cc: Gao feng <gaofeng@cn.fujitsu.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: John Fastabend <john.r.fastabend@intel.com>
Cc: netdev@vger.kernel.org
Cc: cgroups@vger.kernel.org
Diffstat (limited to 'include/linux/cgroup_subsys.h')
-rw-r--r-- | include/linux/cgroup_subsys.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h index dfae957398c3..f204a7a9cf38 100644 --- a/include/linux/cgroup_subsys.h +++ b/include/linux/cgroup_subsys.h | |||
@@ -7,73 +7,73 @@ | |||
7 | 7 | ||
8 | /* */ | 8 | /* */ |
9 | 9 | ||
10 | #ifdef CONFIG_CPUSETS | 10 | #if IS_SUBSYS_ENABLED(CONFIG_CPUSETS) |
11 | SUBSYS(cpuset) | 11 | SUBSYS(cpuset) |
12 | #endif | 12 | #endif |
13 | 13 | ||
14 | /* */ | 14 | /* */ |
15 | 15 | ||
16 | #ifdef CONFIG_CGROUP_DEBUG | 16 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_DEBUG) |
17 | SUBSYS(debug) | 17 | SUBSYS(debug) |
18 | #endif | 18 | #endif |
19 | 19 | ||
20 | /* */ | 20 | /* */ |
21 | 21 | ||
22 | #ifdef CONFIG_CGROUP_SCHED | 22 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_SCHED) |
23 | SUBSYS(cpu_cgroup) | 23 | SUBSYS(cpu_cgroup) |
24 | #endif | 24 | #endif |
25 | 25 | ||
26 | /* */ | 26 | /* */ |
27 | 27 | ||
28 | #ifdef CONFIG_CGROUP_CPUACCT | 28 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_CPUACCT) |
29 | SUBSYS(cpuacct) | 29 | SUBSYS(cpuacct) |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | /* */ | 32 | /* */ |
33 | 33 | ||
34 | #ifdef CONFIG_MEMCG | 34 | #if IS_SUBSYS_ENABLED(CONFIG_MEMCG) |
35 | SUBSYS(mem_cgroup) | 35 | SUBSYS(mem_cgroup) |
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | /* */ | 38 | /* */ |
39 | 39 | ||
40 | #ifdef CONFIG_CGROUP_DEVICE | 40 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_DEVICE) |
41 | SUBSYS(devices) | 41 | SUBSYS(devices) |
42 | #endif | 42 | #endif |
43 | 43 | ||
44 | /* */ | 44 | /* */ |
45 | 45 | ||
46 | #ifdef CONFIG_CGROUP_FREEZER | 46 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_FREEZER) |
47 | SUBSYS(freezer) | 47 | SUBSYS(freezer) |
48 | #endif | 48 | #endif |
49 | 49 | ||
50 | /* */ | 50 | /* */ |
51 | 51 | ||
52 | #ifdef CONFIG_NET_CLS_CGROUP | 52 | #if IS_SUBSYS_ENABLED(CONFIG_NET_CLS_CGROUP) |
53 | SUBSYS(net_cls) | 53 | SUBSYS(net_cls) |
54 | #endif | 54 | #endif |
55 | 55 | ||
56 | /* */ | 56 | /* */ |
57 | 57 | ||
58 | #ifdef CONFIG_BLK_CGROUP | 58 | #if IS_SUBSYS_ENABLED(CONFIG_BLK_CGROUP) |
59 | SUBSYS(blkio) | 59 | SUBSYS(blkio) |
60 | #endif | 60 | #endif |
61 | 61 | ||
62 | /* */ | 62 | /* */ |
63 | 63 | ||
64 | #ifdef CONFIG_CGROUP_PERF | 64 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_PERF) |
65 | SUBSYS(perf) | 65 | SUBSYS(perf) |
66 | #endif | 66 | #endif |
67 | 67 | ||
68 | /* */ | 68 | /* */ |
69 | 69 | ||
70 | #ifdef CONFIG_NETPRIO_CGROUP | 70 | #if IS_SUBSYS_ENABLED(CONFIG_NETPRIO_CGROUP) |
71 | SUBSYS(net_prio) | 71 | SUBSYS(net_prio) |
72 | #endif | 72 | #endif |
73 | 73 | ||
74 | /* */ | 74 | /* */ |
75 | 75 | ||
76 | #ifdef CONFIG_CGROUP_HUGETLB | 76 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_HUGETLB) |
77 | SUBSYS(hugetlb) | 77 | SUBSYS(hugetlb) |
78 | #endif | 78 | #endif |
79 | 79 | ||