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 /include | |
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 'include')
-rw-r--r-- | include/linux/cgroup.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 45aee0fc6b98..b21881e1ea08 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/idr.h> | 19 | #include <linux/idr.h> |
20 | #include <linux/workqueue.h> | 20 | #include <linux/workqueue.h> |
21 | #include <linux/xattr.h> | 21 | #include <linux/xattr.h> |
22 | #include <linux/fs.h> | ||
22 | 23 | ||
23 | #ifdef CONFIG_CGROUPS | 24 | #ifdef CONFIG_CGROUPS |
24 | 25 | ||
@@ -238,6 +239,62 @@ struct cgroup { | |||
238 | struct simple_xattrs xattrs; | 239 | struct simple_xattrs xattrs; |
239 | }; | 240 | }; |
240 | 241 | ||
242 | #define MAX_CGROUP_ROOT_NAMELEN 64 | ||
243 | |||
244 | /* cgroupfs_root->flags */ | ||
245 | enum { | ||
246 | CGRP_ROOT_NOPREFIX = (1 << 1), /* mounted subsystems have no named prefix */ | ||
247 | CGRP_ROOT_XATTR = (1 << 2), /* supports extended attributes */ | ||
248 | }; | ||
249 | |||
250 | /* | ||
251 | * A cgroupfs_root represents the root of a cgroup hierarchy, and may be | ||
252 | * associated with a superblock to form an active hierarchy. This is | ||
253 | * internal to cgroup core. Don't access directly from controllers. | ||
254 | */ | ||
255 | struct cgroupfs_root { | ||
256 | struct super_block *sb; | ||
257 | |||
258 | /* | ||
259 | * The bitmask of subsystems intended to be attached to this | ||
260 | * hierarchy | ||
261 | */ | ||
262 | unsigned long subsys_mask; | ||
263 | |||
264 | /* Unique id for this hierarchy. */ | ||
265 | int hierarchy_id; | ||
266 | |||
267 | /* The bitmask of subsystems currently attached to this hierarchy */ | ||
268 | unsigned long actual_subsys_mask; | ||
269 | |||
270 | /* A list running through the attached subsystems */ | ||
271 | struct list_head subsys_list; | ||
272 | |||
273 | /* The root cgroup for this hierarchy */ | ||
274 | struct cgroup top_cgroup; | ||
275 | |||
276 | /* Tracks how many cgroups are currently defined in hierarchy.*/ | ||
277 | int number_of_cgroups; | ||
278 | |||
279 | /* A list running through the active hierarchies */ | ||
280 | struct list_head root_list; | ||
281 | |||
282 | /* All cgroups on this root, cgroup_mutex protected */ | ||
283 | struct list_head allcg_list; | ||
284 | |||
285 | /* Hierarchy-specific flags */ | ||
286 | unsigned long flags; | ||
287 | |||
288 | /* IDs for cgroups in this hierarchy */ | ||
289 | struct ida cgroup_ida; | ||
290 | |||
291 | /* The path to use for release notifications. */ | ||
292 | char release_agent_path[PATH_MAX]; | ||
293 | |||
294 | /* The name for this hierarchy - may be empty */ | ||
295 | char name[MAX_CGROUP_ROOT_NAMELEN]; | ||
296 | }; | ||
297 | |||
241 | /* | 298 | /* |
242 | * A css_set is a structure holding pointers to a set of | 299 | * A css_set is a structure holding pointers to a set of |
243 | * cgroup_subsys_state objects. This saves space in the task struct | 300 | * cgroup_subsys_state objects. This saves space in the task struct |