summaryrefslogtreecommitdiff
path: root/kernel/cgroup.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-08-26 18:40:56 -0400
committerTejun Heo <tj@kernel.org>2013-08-26 18:40:56 -0400
commit9fa4db334c7d9570aec7a5121e84fae99aae1d04 (patch)
treee9db3a75ec77038f68c1961e947346a33fabafcf /kernel/cgroup.c
parentca8bdcaff0d77990fb69e0f946018c96a70851cc (diff)
cgroup: implement CFTYPE_NO_PREFIX
When cgroup files are created, cgroup core automatically prepends the name of the subsystem as prefix. This patch adds CFTYPE_NO_ which disables the automatic prefix. This is to work around historical baggages and shouldn't be used for new files. This will be used to move "cgroup.event_control" from cgroup core to memcg. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com> Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Glauber Costa <glommer@gmail.com>
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r--kernel/cgroup.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 7516668d8325..a41dc87cd07e 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2756,7 +2756,8 @@ static int cgroup_add_file(struct cgroup *cgrp, struct cftype *cft)
umode_t mode;
char name[MAX_CGROUP_TYPE_NAMELEN + MAX_CFTYPE_NAME + 2] = { 0 };
- if (cft->ss && !(cgrp->root->flags & CGRP_ROOT_NOPREFIX)) {
+ if (cft->ss && !(cft->flags & CFTYPE_NO_PREFIX) &&
+ !(cgrp->root->flags & CGRP_ROOT_NOPREFIX)) {
strcpy(name, cft->ss->name);
strcat(name, ".");
}