diff options
author | Tejun Heo <tj@kernel.org> | 2012-11-19 11:13:37 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2012-11-19 11:13:37 -0500 |
commit | a31f2d3ff7fe20cbe2a143515a7d7c408b29dd0d (patch) | |
tree | fd9e909ad92609eb189d406c4812325788d25bbc /include/linux/cgroup.h | |
parent | 42809dd4225b2f3127a4804314a1b33608620d96 (diff) |
cgroup: introduce CSS_ONLINE flag and on/offline_css() helpers
New helpers on/offline_css() respectively wrap ->post_create() and
->pre_destroy() invocations. online_css() sets CSS_ONLINE after
->post_create() is complete and offline_css() invokes ->pre_destroy()
iff CSS_ONLINE is set and clears it while also handling the temporary
dropping of cgroup_mutex.
This patch doesn't introduce any behavior change at the moment but
will be used to improve cgroup_create() failure path and allow
->post_create() to fail.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r-- | include/linux/cgroup.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index a0fc64167129..f4a9c9836906 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -82,6 +82,7 @@ struct cgroup_subsys_state { | |||
82 | /* bits in struct cgroup_subsys_state flags field */ | 82 | /* bits in struct cgroup_subsys_state flags field */ |
83 | enum { | 83 | enum { |
84 | CSS_ROOT = (1 << 0), /* this CSS is the root of the subsystem */ | 84 | CSS_ROOT = (1 << 0), /* this CSS is the root of the subsystem */ |
85 | CSS_ONLINE = (1 << 1), /* between ->post_create() and ->pre_destroy() */ | ||
85 | }; | 86 | }; |
86 | 87 | ||
87 | /* Caller must verify that the css is not for root cgroup */ | 88 | /* Caller must verify that the css is not for root cgroup */ |