aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorAleksa Sarai <cyphar@cyphar.com>2015-05-18 10:51:00 -0400
committerTejun Heo <tj@kernel.org>2015-05-18 17:57:52 -0400
commit8ab456ac3697dbd1d3eae5d5817dba941faf89ee (patch)
treef618583038c3d99bee90621c10d31439366da717 /kernel
parentc326aa2bb2209e10df4a381801bb34ca0f923038 (diff)
cgroup: switch to unsigned long for bitmasks
Switch the type of all internal cgroup masks to (unsigned long), which is the correct type for bitmasks. This is in preparation for the for_each_subsys_which patch. Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cgroup.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index cfa27f968e6f..b91177f93416 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -156,7 +156,7 @@ static bool cgrp_dfl_root_visible;
156static bool cgroup_legacy_files_on_dfl; 156static bool cgroup_legacy_files_on_dfl;
157 157
158/* some controllers are not supported in the default hierarchy */ 158/* some controllers are not supported in the default hierarchy */
159static unsigned int cgrp_dfl_root_inhibit_ss_mask; 159static unsigned long cgrp_dfl_root_inhibit_ss_mask;
160 160
161/* The list of hierarchy roots */ 161/* The list of hierarchy roots */
162 162
@@ -186,7 +186,7 @@ static struct cftype cgroup_dfl_base_files[];
186static struct cftype cgroup_legacy_base_files[]; 186static struct cftype cgroup_legacy_base_files[];
187 187
188static int rebind_subsystems(struct cgroup_root *dst_root, 188static int rebind_subsystems(struct cgroup_root *dst_root,
189 unsigned int ss_mask); 189 unsigned long ss_mask);
190static int cgroup_destroy_locked(struct cgroup *cgrp); 190static int cgroup_destroy_locked(struct cgroup *cgrp);
191static int create_css(struct cgroup *cgrp, struct cgroup_subsys *ss, 191static int create_css(struct cgroup *cgrp, struct cgroup_subsys *ss,
192 bool visible); 192 bool visible);
@@ -998,7 +998,7 @@ static struct cgroup *task_cgroup_from_root(struct task_struct *task,
998 * update of a tasks cgroup pointer by cgroup_attach_task() 998 * update of a tasks cgroup pointer by cgroup_attach_task()
999 */ 999 */
1000 1000
1001static int cgroup_populate_dir(struct cgroup *cgrp, unsigned int subsys_mask); 1001static int cgroup_populate_dir(struct cgroup *cgrp, unsigned long subsys_mask);
1002static struct kernfs_syscall_ops cgroup_kf_syscall_ops; 1002static struct kernfs_syscall_ops cgroup_kf_syscall_ops;
1003static const struct file_operations proc_cgroupstats_operations; 1003static const struct file_operations proc_cgroupstats_operations;
1004 1004
@@ -1068,11 +1068,11 @@ static void cgroup_put(struct cgroup *cgrp)
1068 * @subtree_control is to be applied to @cgrp. The returned mask is always 1068 * @subtree_control is to be applied to @cgrp. The returned mask is always
1069 * a superset of @subtree_control and follows the usual hierarchy rules. 1069 * a superset of @subtree_control and follows the usual hierarchy rules.
1070 */ 1070 */
1071static unsigned int cgroup_calc_child_subsys_mask(struct cgroup *cgrp, 1071static unsigned long cgroup_calc_child_subsys_mask(struct cgroup *cgrp,
1072 unsigned int subtree_control) 1072 unsigned long subtree_control)
1073{ 1073{
1074 struct cgroup *parent = cgroup_parent(cgrp); 1074 struct cgroup *parent = cgroup_parent(cgrp);
1075 unsigned int cur_ss_mask = subtree_control; 1075 unsigned long cur_ss_mask = subtree_control;
1076 struct cgroup_subsys *ss; 1076 struct cgroup_subsys *ss;
1077 int ssid; 1077 int ssid;
1078 1078
@@ -1082,7 +1082,7 @@ static unsigned int cgroup_calc_child_subsys_mask(struct cgroup *cgrp,
1082 return cur_ss_mask; 1082 return cur_ss_mask;
1083 1083
1084 while (true) { 1084 while (true) {
1085 unsigned int new_ss_mask = cur_ss_mask; 1085 unsigned long new_ss_mask = cur_ss_mask;
1086 1086
1087 for_each_subsys(ss, ssid) 1087 for_each_subsys(ss, ssid)
1088 if (cur_ss_mask & (1 << ssid)) 1088 if (cur_ss_mask & (1 << ssid))
@@ -1200,7 +1200,7 @@ static void cgroup_rm_file(struct cgroup *cgrp, const struct cftype *cft)
1200 * @cgrp: target cgroup 1200 * @cgrp: target cgroup
1201 * @subsys_mask: mask of the subsystem ids whose files should be removed 1201 * @subsys_mask: mask of the subsystem ids whose files should be removed
1202 */ 1202 */
1203static void cgroup_clear_dir(struct cgroup *cgrp, unsigned int subsys_mask) 1203static void cgroup_clear_dir(struct cgroup *cgrp, unsigned long subsys_mask)
1204{ 1204{
1205 struct cgroup_subsys *ss; 1205 struct cgroup_subsys *ss;
1206 int i; 1206 int i;
@@ -1215,10 +1215,11 @@ static void cgroup_clear_dir(struct cgroup *cgrp, unsigned int subsys_mask)
1215 } 1215 }
1216} 1216}
1217 1217
1218static int rebind_subsystems(struct cgroup_root *dst_root, unsigned int ss_mask) 1218static int rebind_subsystems(struct cgroup_root *dst_root,
1219 unsigned long ss_mask)
1219{ 1220{
1220 struct cgroup_subsys *ss; 1221 struct cgroup_subsys *ss;
1221 unsigned int tmp_ss_mask; 1222 unsigned long tmp_ss_mask;
1222 int ssid, i, ret; 1223 int ssid, i, ret;
1223 1224
1224 lockdep_assert_held(&cgroup_mutex); 1225 lockdep_assert_held(&cgroup_mutex);
@@ -1253,7 +1254,7 @@ static int rebind_subsystems(struct cgroup_root *dst_root, unsigned int ss_mask)
1253 * Just warn about it and continue. 1254 * Just warn about it and continue.
1254 */ 1255 */
1255 if (cgrp_dfl_root_visible) { 1256 if (cgrp_dfl_root_visible) {
1256 pr_warn("failed to create files (%d) while rebinding 0x%x to default root\n", 1257 pr_warn("failed to create files (%d) while rebinding 0x%lx to default root\n",
1257 ret, ss_mask); 1258 ret, ss_mask);
1258 pr_warn("you may retry by moving them to a different hierarchy and unbinding\n"); 1259 pr_warn("you may retry by moving them to a different hierarchy and unbinding\n");
1259 } 1260 }
@@ -1338,7 +1339,7 @@ static int cgroup_show_options(struct seq_file *seq,
1338} 1339}
1339 1340
1340struct cgroup_sb_opts { 1341struct cgroup_sb_opts {
1341 unsigned int subsys_mask; 1342 unsigned long subsys_mask;
1342 unsigned int flags; 1343 unsigned int flags;
1343 char *release_agent; 1344 char *release_agent;
1344 bool cpuset_clone_children; 1345 bool cpuset_clone_children;
@@ -1351,7 +1352,7 @@ static int parse_cgroupfs_options(char *data, struct cgroup_sb_opts *opts)
1351{ 1352{
1352 char *token, *o = data; 1353 char *token, *o = data;
1353 bool all_ss = false, one_ss = false; 1354 bool all_ss = false, one_ss = false;
1354 unsigned int mask = -1U; 1355 unsigned long mask = -1UL;
1355 struct cgroup_subsys *ss; 1356 struct cgroup_subsys *ss;
1356 int nr_opts = 0; 1357 int nr_opts = 0;
1357 int i; 1358 int i;
@@ -1495,7 +1496,7 @@ static int cgroup_remount(struct kernfs_root *kf_root, int *flags, char *data)
1495 int ret = 0; 1496 int ret = 0;
1496 struct cgroup_root *root = cgroup_root_from_kf(kf_root); 1497 struct cgroup_root *root = cgroup_root_from_kf(kf_root);
1497 struct cgroup_sb_opts opts; 1498 struct cgroup_sb_opts opts;
1498 unsigned int added_mask, removed_mask; 1499 unsigned long added_mask, removed_mask;
1499 1500
1500 if (root == &cgrp_dfl_root) { 1501 if (root == &cgrp_dfl_root) {
1501 pr_err("remount is not allowed\n"); 1502 pr_err("remount is not allowed\n");
@@ -1641,7 +1642,7 @@ static void init_cgroup_root(struct cgroup_root *root,
1641 set_bit(CGRP_CPUSET_CLONE_CHILDREN, &root->cgrp.flags); 1642 set_bit(CGRP_CPUSET_CLONE_CHILDREN, &root->cgrp.flags);
1642} 1643}
1643 1644
1644static int cgroup_setup_root(struct cgroup_root *root, unsigned int ss_mask) 1645static int cgroup_setup_root(struct cgroup_root *root, unsigned long ss_mask)
1645{ 1646{
1646 LIST_HEAD(tmp_links); 1647 LIST_HEAD(tmp_links);
1647 struct cgroup *root_cgrp = &root->cgrp; 1648 struct cgroup *root_cgrp = &root->cgrp;
@@ -2542,7 +2543,7 @@ static int cgroup_sane_behavior_show(struct seq_file *seq, void *v)
2542 return 0; 2543 return 0;
2543} 2544}
2544 2545
2545static void cgroup_print_ss_mask(struct seq_file *seq, unsigned int ss_mask) 2546static void cgroup_print_ss_mask(struct seq_file *seq, unsigned long ss_mask)
2546{ 2547{
2547 struct cgroup_subsys *ss; 2548 struct cgroup_subsys *ss;
2548 bool printed = false; 2549 bool printed = false;
@@ -2689,8 +2690,8 @@ static ssize_t cgroup_subtree_control_write(struct kernfs_open_file *of,
2689 char *buf, size_t nbytes, 2690 char *buf, size_t nbytes,
2690 loff_t off) 2691 loff_t off)
2691{ 2692{
2692 unsigned int enable = 0, disable = 0; 2693 unsigned long enable = 0, disable = 0;
2693 unsigned int css_enable, css_disable, old_sc, new_sc, old_ss, new_ss; 2694 unsigned long css_enable, css_disable, old_sc, new_sc, old_ss, new_ss;
2694 struct cgroup *cgrp, *child; 2695 struct cgroup *cgrp, *child;
2695 struct cgroup_subsys *ss; 2696 struct cgroup_subsys *ss;
2696 char *tok; 2697 char *tok;
@@ -4322,7 +4323,7 @@ static struct cftype cgroup_legacy_base_files[] = {
4322 * 4323 *
4323 * On failure, no file is added. 4324 * On failure, no file is added.
4324 */ 4325 */
4325static int cgroup_populate_dir(struct cgroup *cgrp, unsigned int subsys_mask) 4326static int cgroup_populate_dir(struct cgroup *cgrp, unsigned long subsys_mask)
4326{ 4327{
4327 struct cgroup_subsys *ss; 4328 struct cgroup_subsys *ss;
4328 int i, ret = 0; 4329 int i, ret = 0;