diff options
author | Tejun Heo <tj@kernel.org> | 2013-04-14 23:15:25 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-04-14 23:15:25 -0400 |
commit | 25a7e6848db76e22677aff202d9c4ef3503be15b (patch) | |
tree | e3f944266f4a6ded61ce5d88a5c2c9c33794c366 /kernel/cgroup.c | |
parent | 9343862945fdd3dd5cb7648bb24cabe40faa9ad9 (diff) |
move cgroupfs_root to include/linux/cgroup.h
While controllers shouldn't be accessing cgroupfs_root directly, it
being hidden inside kern/cgroup.c makes somethings pretty silly. This
makes routing hierarchy-wide settings which need to be visible to
controllers cumbersome.
We're gonna add another hierarchy-wide setting which needs to be
accessed from controllers. Move cgroupfs_root and its flags to the
header file so that we can access root settings with inline helpers.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Li Zefan <lizefan@huawei.com>
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r-- | kernel/cgroup.c | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 67428d84e38b..8b8eb7c168ff 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -30,7 +30,6 @@ | |||
30 | #include <linux/cred.h> | 30 | #include <linux/cred.h> |
31 | #include <linux/ctype.h> | 31 | #include <linux/ctype.h> |
32 | #include <linux/errno.h> | 32 | #include <linux/errno.h> |
33 | #include <linux/fs.h> | ||
34 | #include <linux/init_task.h> | 33 | #include <linux/init_task.h> |
35 | #include <linux/kernel.h> | 34 | #include <linux/kernel.h> |
36 | #include <linux/list.h> | 35 | #include <linux/list.h> |
@@ -104,56 +103,6 @@ static struct cgroup_subsys *subsys[CGROUP_SUBSYS_COUNT] = { | |||
104 | #include <linux/cgroup_subsys.h> | 103 | #include <linux/cgroup_subsys.h> |
105 | }; | 104 | }; |
106 | 105 | ||
107 | #define MAX_CGROUP_ROOT_NAMELEN 64 | ||
108 | |||
109 | /* | ||
110 | * A cgroupfs_root represents the root of a cgroup hierarchy, | ||
111 | * and may be associated with a superblock to form an active | ||
112 | * hierarchy | ||
113 | */ | ||
114 | struct cgroupfs_root { | ||
115 | struct super_block *sb; | ||
116 | |||
117 | /* | ||
118 | * The bitmask of subsystems intended to be attached to this | ||
119 | * hierarchy | ||
120 | */ | ||
121 | unsigned long subsys_mask; | ||
122 | |||
123 | /* Unique id for this hierarchy. */ | ||
124 | int hierarchy_id; | ||
125 | |||
126 | /* The bitmask of subsystems currently attached to this hierarchy */ | ||
127 | unsigned long actual_subsys_mask; | ||
128 | |||
129 | /* A list running through the attached subsystems */ | ||
130 | struct list_head subsys_list; | ||
131 | |||
132 | /* The root cgroup for this hierarchy */ | ||
133 | struct cgroup top_cgroup; | ||
134 | |||
135 | /* Tracks how many cgroups are currently defined in hierarchy.*/ | ||
136 | int number_of_cgroups; | ||
137 | |||
138 | /* A list running through the active hierarchies */ | ||
139 | struct list_head root_list; | ||
140 | |||
141 | /* All cgroups on this root, cgroup_mutex protected */ | ||
142 | struct list_head allcg_list; | ||
143 | |||
144 | /* Hierarchy-specific flags */ | ||
145 | unsigned long flags; | ||
146 | |||
147 | /* IDs for cgroups in this hierarchy */ | ||
148 | struct ida cgroup_ida; | ||
149 | |||
150 | /* The path to use for release notifications. */ | ||
151 | char release_agent_path[PATH_MAX]; | ||
152 | |||
153 | /* The name for this hierarchy - may be empty */ | ||
154 | char name[MAX_CGROUP_ROOT_NAMELEN]; | ||
155 | }; | ||
156 | |||
157 | /* | 106 | /* |
158 | * The "rootnode" hierarchy is the "dummy hierarchy", reserved for the | 107 | * The "rootnode" hierarchy is the "dummy hierarchy", reserved for the |
159 | * subsystems that are otherwise unattached - it never has more than a | 108 | * subsystems that are otherwise unattached - it never has more than a |
@@ -296,12 +245,6 @@ bool cgroup_is_descendant(struct cgroup *cgrp, struct cgroup *ancestor) | |||
296 | } | 245 | } |
297 | EXPORT_SYMBOL_GPL(cgroup_is_descendant); | 246 | EXPORT_SYMBOL_GPL(cgroup_is_descendant); |
298 | 247 | ||
299 | /* cgroupfs_root->flags */ | ||
300 | enum { | ||
301 | CGRP_ROOT_NOPREFIX = (1 << 1), /* mounted subsystems have no named prefix */ | ||
302 | CGRP_ROOT_XATTR = (1 << 2), /* supports extended attributes */ | ||
303 | }; | ||
304 | |||
305 | static int cgroup_is_releasable(const struct cgroup *cgrp) | 248 | static int cgroup_is_releasable(const struct cgroup *cgrp) |
306 | { | 249 | { |
307 | const int bits = | 250 | const int bits = |