aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cgroup.h
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2012-09-12 10:12:05 -0400
committerTejun Heo <tj@kernel.org>2012-09-14 12:57:37 -0400
commit5fc0b02544b3b9bd3db5a8156b5f3e7350f8e797 (patch)
tree9382ec0de547289cbda8f4bdb90eb65a029398eb /include/linux/cgroup.h
parentbe45c900fdc2c66baad5a7703fb8136991d88aeb (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.h')
-rw-r--r--include/linux/cgroup.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 1916cdb071dc..a5ab5651441b 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -46,10 +46,12 @@ extern const struct file_operations proc_cgroup_operations;
46 46
47/* Define the enumeration of all builtin cgroup subsystems */ 47/* Define the enumeration of all builtin cgroup subsystems */
48#define SUBSYS(_x) _x ## _subsys_id, 48#define SUBSYS(_x) _x ## _subsys_id,
49#define IS_SUBSYS_ENABLED(option) IS_BUILTIN(option)
49enum cgroup_subsys_id { 50enum cgroup_subsys_id {
50#include <linux/cgroup_subsys.h> 51#include <linux/cgroup_subsys.h>
51 __CGROUP_TEMPORARY_PLACEHOLDER 52 __CGROUP_TEMPORARY_PLACEHOLDER
52}; 53};
54#undef IS_SUBSYS_ENABLED
53#undef SUBSYS 55#undef SUBSYS
54/* 56/*
55 * This define indicates the maximum number of subsystems that can be loaded 57 * This define indicates the maximum number of subsystems that can be loaded
@@ -528,7 +530,9 @@ struct cgroup_subsys {
528}; 530};
529 531
530#define SUBSYS(_x) extern struct cgroup_subsys _x ## _subsys; 532#define SUBSYS(_x) extern struct cgroup_subsys _x ## _subsys;
533#define IS_SUBSYS_ENABLED(option) IS_BUILTIN(option)
531#include <linux/cgroup_subsys.h> 534#include <linux/cgroup_subsys.h>
535#undef IS_SUBSYS_ENABLED
532#undef SUBSYS 536#undef SUBSYS
533 537
534static inline struct cgroup_subsys_state *cgroup_subsys_state( 538static inline struct cgroup_subsys_state *cgroup_subsys_state(