diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/cgroup.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index eb7ca55f72ef..c3a9f1eb4097 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/fs.h> | 17 | #include <linux/fs.h> |
18 | #include <linux/seq_file.h> | 18 | #include <linux/seq_file.h> |
19 | #include <linux/kernfs.h> | 19 | #include <linux/kernfs.h> |
20 | #include <linux/jump_label.h> | ||
20 | 21 | ||
21 | #include <linux/cgroup-defs.h> | 22 | #include <linux/cgroup-defs.h> |
22 | 23 | ||
@@ -50,6 +51,26 @@ extern struct css_set init_css_set; | |||
50 | #include <linux/cgroup_subsys.h> | 51 | #include <linux/cgroup_subsys.h> |
51 | #undef SUBSYS | 52 | #undef SUBSYS |
52 | 53 | ||
54 | #define SUBSYS(_x) \ | ||
55 | extern struct static_key_true _x ## _cgrp_subsys_enabled_key; \ | ||
56 | extern struct static_key_true _x ## _cgrp_subsys_on_dfl_key; | ||
57 | #include <linux/cgroup_subsys.h> | ||
58 | #undef SUBSYS | ||
59 | |||
60 | /** | ||
61 | * cgroup_subsys_enabled - fast test on whether a subsys is enabled | ||
62 | * @ss: subsystem in question | ||
63 | */ | ||
64 | #define cgroup_subsys_enabled(ss) \ | ||
65 | static_branch_likely(&ss ## _enabled_key) | ||
66 | |||
67 | /** | ||
68 | * cgroup_subsys_on_dfl - fast test on whether a subsys is on default hierarchy | ||
69 | * @ss: subsystem in question | ||
70 | */ | ||
71 | #define cgroup_subsys_on_dfl(ss) \ | ||
72 | static_branch_likely(&ss ## _on_dfl_key) | ||
73 | |||
53 | bool css_has_online_children(struct cgroup_subsys_state *css); | 74 | bool css_has_online_children(struct cgroup_subsys_state *css); |
54 | struct cgroup_subsys_state *css_from_id(int id, struct cgroup_subsys *ss); | 75 | struct cgroup_subsys_state *css_from_id(int id, struct cgroup_subsys *ss); |
55 | struct cgroup_subsys_state *cgroup_get_e_css(struct cgroup *cgroup, | 76 | struct cgroup_subsys_state *cgroup_get_e_css(struct cgroup *cgroup, |