diff options
| -rw-r--r-- | include/linux/cgroup.h | 1 | ||||
| -rw-r--r-- | kernel/cgroup.c | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 7e9fa505b7bb..43d1ed30bae3 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
| @@ -384,6 +384,7 @@ enum { | |||
| 384 | CFTYPE_NOT_ON_ROOT = (1 << 1), /* don't create on root cgrp */ | 384 | CFTYPE_NOT_ON_ROOT = (1 << 1), /* don't create on root cgrp */ |
| 385 | CFTYPE_INSANE = (1 << 2), /* don't create if sane_behavior */ | 385 | CFTYPE_INSANE = (1 << 2), /* don't create if sane_behavior */ |
| 386 | CFTYPE_NO_PREFIX = (1 << 3), /* (DON'T USE FOR NEW FILES) no subsys prefix */ | 386 | CFTYPE_NO_PREFIX = (1 << 3), /* (DON'T USE FOR NEW FILES) no subsys prefix */ |
| 387 | CFTYPE_ONLY_ON_DFL = (1 << 4), /* only on default hierarchy */ | ||
| 387 | }; | 388 | }; |
| 388 | 389 | ||
| 389 | #define MAX_CFTYPE_NAME 64 | 390 | #define MAX_CFTYPE_NAME 64 |
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 69b4939e9f6d..37b6d534b0ca 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
| @@ -2356,6 +2356,8 @@ static int cgroup_addrm_files(struct cgroup *cgrp, struct cftype cfts[], | |||
| 2356 | 2356 | ||
| 2357 | for (cft = cfts; cft->name[0] != '\0'; cft++) { | 2357 | for (cft = cfts; cft->name[0] != '\0'; cft++) { |
| 2358 | /* does cft->flags tell us to skip this file on @cgrp? */ | 2358 | /* does cft->flags tell us to skip this file on @cgrp? */ |
| 2359 | if ((cft->flags & CFTYPE_ONLY_ON_DFL) && !cgroup_on_dfl(cgrp)) | ||
| 2360 | continue; | ||
| 2359 | if ((cft->flags & CFTYPE_INSANE) && cgroup_sane_behavior(cgrp)) | 2361 | if ((cft->flags & CFTYPE_INSANE) && cgroup_sane_behavior(cgrp)) |
| 2360 | continue; | 2362 | continue; |
| 2361 | if ((cft->flags & CFTYPE_NOT_ON_ROOT) && !cgrp->parent) | 2363 | if ((cft->flags & CFTYPE_NOT_ON_ROOT) && !cgrp->parent) |
