diff options
author | Tejun Heo <tj@kernel.org> | 2014-07-15 11:05:10 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-07-15 11:05:10 -0400 |
commit | 05ebb6e60f044a9cef2549b6204559276500f363 (patch) | |
tree | d4649d18bdec5b0497794422d8d29981eaf5d37b /kernel/cgroup.c | |
parent | a8ddc8215e1a4cd9dc5d6210811cfc381a489ec2 (diff) |
cgroup: make CFTYPE_ONLY_ON_DFL and CFTYPE_NO_ internal to cgroup core
cgroup now distinguishes cftypes for the default and legacy
hierarchies more explicitly by using separate arrays and
CFTYPE_ONLY_ON_DFL and CFTYPE_INSANE should be and are used only
inside cgroup core proper. Let's make it clear that the flags are
internal by prefixing them with double underscores.
CFTYPE_INSANE is renamed to __CFTYPE_NOT_ON_DFL for consistency. The
two flags are also collected and assigned bits >= 16 so that they
aren't mixed with the published flags.
v2: Convert the extra ones in cgroup_exit_cftypes() which are added by
revision to the previous patch.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r-- | kernel/cgroup.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 374ebdf74f35..f41d164a3d54 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -3031,9 +3031,9 @@ static int cgroup_addrm_files(struct cgroup *cgrp, struct cftype cfts[], | |||
3031 | 3031 | ||
3032 | for (cft = cfts; cft->name[0] != '\0'; cft++) { | 3032 | for (cft = cfts; cft->name[0] != '\0'; cft++) { |
3033 | /* does cft->flags tell us to skip this file on @cgrp? */ | 3033 | /* does cft->flags tell us to skip this file on @cgrp? */ |
3034 | if ((cft->flags & CFTYPE_ONLY_ON_DFL) && !cgroup_on_dfl(cgrp)) | 3034 | if ((cft->flags & __CFTYPE_ONLY_ON_DFL) && !cgroup_on_dfl(cgrp)) |
3035 | continue; | 3035 | continue; |
3036 | if ((cft->flags & CFTYPE_INSANE) && cgroup_on_dfl(cgrp)) | 3036 | if ((cft->flags & __CFTYPE_NOT_ON_DFL) && cgroup_on_dfl(cgrp)) |
3037 | continue; | 3037 | continue; |
3038 | if ((cft->flags & CFTYPE_NOT_ON_ROOT) && !cgroup_parent(cgrp)) | 3038 | if ((cft->flags & CFTYPE_NOT_ON_ROOT) && !cgroup_parent(cgrp)) |
3039 | continue; | 3039 | continue; |
@@ -3093,7 +3093,7 @@ static void cgroup_exit_cftypes(struct cftype *cfts) | |||
3093 | cft->ss = NULL; | 3093 | cft->ss = NULL; |
3094 | 3094 | ||
3095 | /* revert flags set by cgroup core while adding @cfts */ | 3095 | /* revert flags set by cgroup core while adding @cfts */ |
3096 | cft->flags &= ~(CFTYPE_ONLY_ON_DFL | CFTYPE_INSANE); | 3096 | cft->flags &= ~(__CFTYPE_ONLY_ON_DFL | __CFTYPE_NOT_ON_DFL); |
3097 | } | 3097 | } |
3098 | } | 3098 | } |
3099 | 3099 | ||
@@ -3217,7 +3217,7 @@ int cgroup_add_dfl_cftypes(struct cgroup_subsys *ss, struct cftype *cfts) | |||
3217 | struct cftype *cft; | 3217 | struct cftype *cft; |
3218 | 3218 | ||
3219 | for (cft = cfts; cft && cft->name[0] != '\0'; cft++) | 3219 | for (cft = cfts; cft && cft->name[0] != '\0'; cft++) |
3220 | cft->flags |= CFTYPE_ONLY_ON_DFL; | 3220 | cft->flags |= __CFTYPE_ONLY_ON_DFL; |
3221 | return cgroup_add_cftypes(ss, cfts); | 3221 | return cgroup_add_cftypes(ss, cfts); |
3222 | } | 3222 | } |
3223 | 3223 | ||
@@ -3234,7 +3234,7 @@ int cgroup_add_legacy_cftypes(struct cgroup_subsys *ss, struct cftype *cfts) | |||
3234 | struct cftype *cft; | 3234 | struct cftype *cft; |
3235 | 3235 | ||
3236 | for (cft = cfts; cft && cft->name[0] != '\0'; cft++) | 3236 | for (cft = cfts; cft && cft->name[0] != '\0'; cft++) |
3237 | cft->flags |= CFTYPE_INSANE; | 3237 | cft->flags |= __CFTYPE_NOT_ON_DFL; |
3238 | return cgroup_add_cftypes(ss, cfts); | 3238 | return cgroup_add_cftypes(ss, cfts); |
3239 | } | 3239 | } |
3240 | 3240 | ||