diff options
Diffstat (limited to 'include/linux/cgroup.h')
| -rw-r--r-- | include/linux/cgroup.h | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index c90eaa803440..f8a030ced0c7 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/rwsem.h> | 17 | #include <linux/rwsem.h> |
| 18 | #include <linux/idr.h> | 18 | #include <linux/idr.h> |
| 19 | #include <linux/workqueue.h> | 19 | #include <linux/workqueue.h> |
| 20 | #include <linux/xattr.h> | ||
| 20 | 21 | ||
| 21 | #ifdef CONFIG_CGROUPS | 22 | #ifdef CONFIG_CGROUPS |
| 22 | 23 | ||
| @@ -45,17 +46,13 @@ extern const struct file_operations proc_cgroup_operations; | |||
| 45 | 46 | ||
| 46 | /* Define the enumeration of all builtin cgroup subsystems */ | 47 | /* Define the enumeration of all builtin cgroup subsystems */ |
| 47 | #define SUBSYS(_x) _x ## _subsys_id, | 48 | #define SUBSYS(_x) _x ## _subsys_id, |
| 49 | #define IS_SUBSYS_ENABLED(option) IS_ENABLED(option) | ||
| 48 | enum cgroup_subsys_id { | 50 | enum cgroup_subsys_id { |
| 49 | #include <linux/cgroup_subsys.h> | 51 | #include <linux/cgroup_subsys.h> |
| 50 | CGROUP_BUILTIN_SUBSYS_COUNT | 52 | CGROUP_SUBSYS_COUNT, |
| 51 | }; | 53 | }; |
| 54 | #undef IS_SUBSYS_ENABLED | ||
| 52 | #undef SUBSYS | 55 | #undef SUBSYS |
| 53 | /* | ||
| 54 | * This define indicates the maximum number of subsystems that can be loaded | ||
| 55 | * at once. We limit to this many since cgroupfs_root has subsys_bits to keep | ||
| 56 | * track of all of them. | ||
| 57 | */ | ||
| 58 | #define CGROUP_SUBSYS_COUNT (BITS_PER_BYTE*sizeof(unsigned long)) | ||
| 59 | 56 | ||
| 60 | /* Per-subsystem/per-cgroup state maintained by the system. */ | 57 | /* Per-subsystem/per-cgroup state maintained by the system. */ |
| 61 | struct cgroup_subsys_state { | 58 | struct cgroup_subsys_state { |
| @@ -216,6 +213,9 @@ struct cgroup { | |||
| 216 | /* List of events which userspace want to receive */ | 213 | /* List of events which userspace want to receive */ |
| 217 | struct list_head event_list; | 214 | struct list_head event_list; |
| 218 | spinlock_t event_list_lock; | 215 | spinlock_t event_list_lock; |
| 216 | |||
| 217 | /* directory xattrs */ | ||
| 218 | struct simple_xattrs xattrs; | ||
| 219 | }; | 219 | }; |
| 220 | 220 | ||
| 221 | /* | 221 | /* |
| @@ -309,6 +309,9 @@ struct cftype { | |||
| 309 | /* CFTYPE_* flags */ | 309 | /* CFTYPE_* flags */ |
| 310 | unsigned int flags; | 310 | unsigned int flags; |
| 311 | 311 | ||
| 312 | /* file xattrs */ | ||
| 313 | struct simple_xattrs xattrs; | ||
| 314 | |||
| 312 | int (*open)(struct inode *inode, struct file *file); | 315 | int (*open)(struct inode *inode, struct file *file); |
| 313 | ssize_t (*read)(struct cgroup *cgrp, struct cftype *cft, | 316 | ssize_t (*read)(struct cgroup *cgrp, struct cftype *cft, |
| 314 | struct file *file, | 317 | struct file *file, |
| @@ -394,7 +397,7 @@ struct cftype { | |||
| 394 | */ | 397 | */ |
| 395 | struct cftype_set { | 398 | struct cftype_set { |
| 396 | struct list_head node; /* chained at subsys->cftsets */ | 399 | struct list_head node; /* chained at subsys->cftsets */ |
| 397 | const struct cftype *cfts; | 400 | struct cftype *cfts; |
| 398 | }; | 401 | }; |
| 399 | 402 | ||
| 400 | struct cgroup_scanner { | 403 | struct cgroup_scanner { |
| @@ -406,8 +409,8 @@ struct cgroup_scanner { | |||
| 406 | void *data; | 409 | void *data; |
| 407 | }; | 410 | }; |
| 408 | 411 | ||
| 409 | int cgroup_add_cftypes(struct cgroup_subsys *ss, const struct cftype *cfts); | 412 | int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); |
| 410 | int cgroup_rm_cftypes(struct cgroup_subsys *ss, const struct cftype *cfts); | 413 | int cgroup_rm_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); |
| 411 | 414 | ||
| 412 | int cgroup_is_removed(const struct cgroup *cgrp); | 415 | int cgroup_is_removed(const struct cgroup *cgrp); |
| 413 | 416 | ||
| @@ -496,6 +499,21 @@ struct cgroup_subsys { | |||
| 496 | */ | 499 | */ |
| 497 | bool __DEPRECATED_clear_css_refs; | 500 | bool __DEPRECATED_clear_css_refs; |
| 498 | 501 | ||
| 502 | /* | ||
| 503 | * If %false, this subsystem is properly hierarchical - | ||
| 504 | * configuration, resource accounting and restriction on a parent | ||
| 505 | * cgroup cover those of its children. If %true, hierarchy support | ||
| 506 | * is broken in some ways - some subsystems ignore hierarchy | ||
| 507 | * completely while others are only implemented half-way. | ||
| 508 | * | ||
| 509 | * It's now disallowed to create nested cgroups if the subsystem is | ||
| 510 | * broken and cgroup core will emit a warning message on such | ||
| 511 | * cases. Eventually, all subsystems will be made properly | ||
| 512 | * hierarchical and this will go away. | ||
| 513 | */ | ||
| 514 | bool broken_hierarchy; | ||
| 515 | bool warned_broken_hierarchy; | ||
| 516 | |||
| 499 | #define MAX_CGROUP_TYPE_NAMELEN 32 | 517 | #define MAX_CGROUP_TYPE_NAMELEN 32 |
| 500 | const char *name; | 518 | const char *name; |
| 501 | 519 | ||
| @@ -521,7 +539,9 @@ struct cgroup_subsys { | |||
| 521 | }; | 539 | }; |
| 522 | 540 | ||
| 523 | #define SUBSYS(_x) extern struct cgroup_subsys _x ## _subsys; | 541 | #define SUBSYS(_x) extern struct cgroup_subsys _x ## _subsys; |
| 542 | #define IS_SUBSYS_ENABLED(option) IS_BUILTIN(option) | ||
| 524 | #include <linux/cgroup_subsys.h> | 543 | #include <linux/cgroup_subsys.h> |
| 544 | #undef IS_SUBSYS_ENABLED | ||
| 525 | #undef SUBSYS | 545 | #undef SUBSYS |
| 526 | 546 | ||
| 527 | static inline struct cgroup_subsys_state *cgroup_subsys_state( | 547 | static inline struct cgroup_subsys_state *cgroup_subsys_state( |
