aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-11-19 11:13:38 -0500
committerTejun Heo <tj@kernel.org>2012-11-19 11:13:38 -0500
commit2260e7fc1f18ad815324605c1ce7d5c6fd9b19a2 (patch)
treeeffa76704caa7a6ce40b19de3fa2c3367ac5b431 /kernel
parent92fb97487a7e41b222c1417cabd1d1ab7cc3a48c (diff)
cgroup: s/CGRP_CLONE_CHILDREN/CGRP_CPUSET_CLONE_CHILDREN/
clone_children is only meaningful for cpuset and will stay that way. Rename the flag to reflect that and update documentation. Also, drop clone_children() wrapper in cgroup.c. The thin wrapper is used only a few times and one of them will go away soon. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com> Acked-by: Li Zefan <lizefan@huawei.com> Cc: Glauber Costa <glommer@parallels.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cgroup.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index d35463bab487..2895880e6800 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -296,11 +296,6 @@ static int notify_on_release(const struct cgroup *cgrp)
296 return test_bit(CGRP_NOTIFY_ON_RELEASE, &cgrp->flags); 296 return test_bit(CGRP_NOTIFY_ON_RELEASE, &cgrp->flags);
297} 297}
298 298
299static int clone_children(const struct cgroup *cgrp)
300{
301 return test_bit(CGRP_CLONE_CHILDREN, &cgrp->flags);
302}
303
304/* 299/*
305 * for_each_subsys() allows you to iterate on each subsystem attached to 300 * for_each_subsys() allows you to iterate on each subsystem attached to
306 * an active hierarchy 301 * an active hierarchy
@@ -1101,7 +1096,7 @@ static int cgroup_show_options(struct seq_file *seq, struct dentry *dentry)
1101 seq_puts(seq, ",xattr"); 1096 seq_puts(seq, ",xattr");
1102 if (strlen(root->release_agent_path)) 1097 if (strlen(root->release_agent_path))
1103 seq_printf(seq, ",release_agent=%s", root->release_agent_path); 1098 seq_printf(seq, ",release_agent=%s", root->release_agent_path);
1104 if (clone_children(&root->top_cgroup)) 1099 if (test_bit(CGRP_CPUSET_CLONE_CHILDREN, &root->top_cgroup.flags))
1105 seq_puts(seq, ",clone_children"); 1100 seq_puts(seq, ",clone_children");
1106 if (strlen(root->name)) 1101 if (strlen(root->name))
1107 seq_printf(seq, ",name=%s", root->name); 1102 seq_printf(seq, ",name=%s", root->name);
@@ -1113,7 +1108,7 @@ struct cgroup_sb_opts {
1113 unsigned long subsys_mask; 1108 unsigned long subsys_mask;
1114 unsigned long flags; 1109 unsigned long flags;
1115 char *release_agent; 1110 char *release_agent;
1116 bool clone_children; 1111 bool cpuset_clone_children;
1117 char *name; 1112 char *name;
1118 /* User explicitly requested empty subsystem */ 1113 /* User explicitly requested empty subsystem */
1119 bool none; 1114 bool none;
@@ -1164,7 +1159,7 @@ static int parse_cgroupfs_options(char *data, struct cgroup_sb_opts *opts)
1164 continue; 1159 continue;
1165 } 1160 }
1166 if (!strcmp(token, "clone_children")) { 1161 if (!strcmp(token, "clone_children")) {
1167 opts->clone_children = true; 1162 opts->cpuset_clone_children = true;
1168 continue; 1163 continue;
1169 } 1164 }
1170 if (!strcmp(token, "xattr")) { 1165 if (!strcmp(token, "xattr")) {
@@ -1474,8 +1469,8 @@ static struct cgroupfs_root *cgroup_root_from_opts(struct cgroup_sb_opts *opts)
1474 strcpy(root->release_agent_path, opts->release_agent); 1469 strcpy(root->release_agent_path, opts->release_agent);
1475 if (opts->name) 1470 if (opts->name)
1476 strcpy(root->name, opts->name); 1471 strcpy(root->name, opts->name);
1477 if (opts->clone_children) 1472 if (opts->cpuset_clone_children)
1478 set_bit(CGRP_CLONE_CHILDREN, &root->top_cgroup.flags); 1473 set_bit(CGRP_CPUSET_CLONE_CHILDREN, &root->top_cgroup.flags);
1479 return root; 1474 return root;
1480} 1475}
1481 1476
@@ -3905,7 +3900,7 @@ fail:
3905static u64 cgroup_clone_children_read(struct cgroup *cgrp, 3900static u64 cgroup_clone_children_read(struct cgroup *cgrp,
3906 struct cftype *cft) 3901 struct cftype *cft)
3907{ 3902{
3908 return clone_children(cgrp); 3903 return test_bit(CGRP_CPUSET_CLONE_CHILDREN, &cgrp->flags);
3909} 3904}
3910 3905
3911static int cgroup_clone_children_write(struct cgroup *cgrp, 3906static int cgroup_clone_children_write(struct cgroup *cgrp,
@@ -3913,9 +3908,9 @@ static int cgroup_clone_children_write(struct cgroup *cgrp,
3913 u64 val) 3908 u64 val)
3914{ 3909{
3915 if (val) 3910 if (val)
3916 set_bit(CGRP_CLONE_CHILDREN, &cgrp->flags); 3911 set_bit(CGRP_CPUSET_CLONE_CHILDREN, &cgrp->flags);
3917 else 3912 else
3918 clear_bit(CGRP_CLONE_CHILDREN, &cgrp->flags); 3913 clear_bit(CGRP_CPUSET_CLONE_CHILDREN, &cgrp->flags);
3919 return 0; 3914 return 0;
3920} 3915}
3921 3916
@@ -4130,8 +4125,8 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry,
4130 if (notify_on_release(parent)) 4125 if (notify_on_release(parent))
4131 set_bit(CGRP_NOTIFY_ON_RELEASE, &cgrp->flags); 4126 set_bit(CGRP_NOTIFY_ON_RELEASE, &cgrp->flags);
4132 4127
4133 if (clone_children(parent)) 4128 if (test_bit(CGRP_CPUSET_CLONE_CHILDREN, &parent->flags))
4134 set_bit(CGRP_CLONE_CHILDREN, &cgrp->flags); 4129 set_bit(CGRP_CPUSET_CLONE_CHILDREN, &cgrp->flags);
4135 4130
4136 for_each_subsys(root, ss) { 4131 for_each_subsys(root, ss) {
4137 struct cgroup_subsys_state *css; 4132 struct cgroup_subsys_state *css;
@@ -4148,7 +4143,8 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry,
4148 goto err_free_all; 4143 goto err_free_all;
4149 } 4144 }
4150 /* At error, ->css_free() callback has to free assigned ID. */ 4145 /* At error, ->css_free() callback has to free assigned ID. */
4151 if (clone_children(parent) && ss->post_clone) 4146 if (test_bit(CGRP_CPUSET_CLONE_CHILDREN, &parent->flags) &&
4147 ss->post_clone)
4152 ss->post_clone(cgrp); 4148 ss->post_clone(cgrp);
4153 4149
4154 if (ss->broken_hierarchy && !ss->warned_broken_hierarchy && 4150 if (ss->broken_hierarchy && !ss->warned_broken_hierarchy &&