diff options
author | Joe Perches <joe@perches.com> | 2014-04-25 18:28:03 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-04-25 18:28:03 -0400 |
commit | ed3d261b53f51c9505822d757d1800c79fb68788 (patch) | |
tree | a60c22e940df76ee88edd9df893b613cc1f20298 /kernel/cgroup.c | |
parent | a2a1f9eaf945c46b5b2bc0e439cba68888e3d540 (diff) |
cgroup: Use more current logging style
Use pr_fmt and remove embedded prefixes.
Realign modified multi-line statements to open parenthesis.
Convert embedded function name to "%s: ", __func__
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r-- | kernel/cgroup.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index cb453e9954c1..3873267c9ee3 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -26,6 +26,8 @@ | |||
26 | * distribution for more details. | 26 | * distribution for more details. |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
30 | |||
29 | #include <linux/cgroup.h> | 31 | #include <linux/cgroup.h> |
30 | #include <linux/cred.h> | 32 | #include <linux/cred.h> |
31 | #include <linux/ctype.h> | 33 | #include <linux/ctype.h> |
@@ -1126,9 +1128,9 @@ static int rebind_subsystems(struct cgroup_root *dst_root, | |||
1126 | * Just warn about it and continue. | 1128 | * Just warn about it and continue. |
1127 | */ | 1129 | */ |
1128 | if (cgrp_dfl_root_visible) { | 1130 | if (cgrp_dfl_root_visible) { |
1129 | pr_warn("cgroup: failed to create files (%d) while rebinding 0x%lx to default root\n", | 1131 | pr_warn("failed to create files (%d) while rebinding 0x%lx to default root\n", |
1130 | ret, ss_mask); | 1132 | ret, ss_mask); |
1131 | pr_warn("cgroup: you may retry by moving them to a different hierarchy and unbinding\n"); | 1133 | pr_warn("you may retry by moving them to a different hierarchy and unbinding\n"); |
1132 | } | 1134 | } |
1133 | } | 1135 | } |
1134 | 1136 | ||
@@ -1323,12 +1325,12 @@ static int parse_cgroupfs_options(char *data, struct cgroup_sb_opts *opts) | |||
1323 | /* Consistency checks */ | 1325 | /* Consistency checks */ |
1324 | 1326 | ||
1325 | if (opts->flags & CGRP_ROOT_SANE_BEHAVIOR) { | 1327 | if (opts->flags & CGRP_ROOT_SANE_BEHAVIOR) { |
1326 | pr_warn("cgroup: sane_behavior: this is still under development and its behaviors will change, proceed at your own risk\n"); | 1328 | pr_warn("sane_behavior: this is still under development and its behaviors will change, proceed at your own risk\n"); |
1327 | 1329 | ||
1328 | if ((opts->flags & (CGRP_ROOT_NOPREFIX | CGRP_ROOT_XATTR)) || | 1330 | if ((opts->flags & (CGRP_ROOT_NOPREFIX | CGRP_ROOT_XATTR)) || |
1329 | opts->cpuset_clone_children || opts->release_agent || | 1331 | opts->cpuset_clone_children || opts->release_agent || |
1330 | opts->name) { | 1332 | opts->name) { |
1331 | pr_err("cgroup: sane_behavior: noprefix, xattr, clone_children, release_agent and name are not allowed\n"); | 1333 | pr_err("sane_behavior: noprefix, xattr, clone_children, release_agent and name are not allowed\n"); |
1332 | return -EINVAL; | 1334 | return -EINVAL; |
1333 | } | 1335 | } |
1334 | } else { | 1336 | } else { |
@@ -1374,7 +1376,7 @@ static int cgroup_remount(struct kernfs_root *kf_root, int *flags, char *data) | |||
1374 | unsigned long added_mask, removed_mask; | 1376 | unsigned long added_mask, removed_mask; |
1375 | 1377 | ||
1376 | if (root->flags & CGRP_ROOT_SANE_BEHAVIOR) { | 1378 | if (root->flags & CGRP_ROOT_SANE_BEHAVIOR) { |
1377 | pr_err("cgroup: sane_behavior: remount is not allowed\n"); | 1379 | pr_err("sane_behavior: remount is not allowed\n"); |
1378 | return -EINVAL; | 1380 | return -EINVAL; |
1379 | } | 1381 | } |
1380 | 1382 | ||
@@ -1387,7 +1389,7 @@ static int cgroup_remount(struct kernfs_root *kf_root, int *flags, char *data) | |||
1387 | goto out_unlock; | 1389 | goto out_unlock; |
1388 | 1390 | ||
1389 | if (opts.subsys_mask != root->subsys_mask || opts.release_agent) | 1391 | if (opts.subsys_mask != root->subsys_mask || opts.release_agent) |
1390 | pr_warn("cgroup: option changes via remount are deprecated (pid=%d comm=%s)\n", | 1392 | pr_warn("option changes via remount are deprecated (pid=%d comm=%s)\n", |
1391 | task_tgid_nr(current), current->comm); | 1393 | task_tgid_nr(current), current->comm); |
1392 | 1394 | ||
1393 | added_mask = opts.subsys_mask & ~root->subsys_mask; | 1395 | added_mask = opts.subsys_mask & ~root->subsys_mask; |
@@ -1396,7 +1398,7 @@ static int cgroup_remount(struct kernfs_root *kf_root, int *flags, char *data) | |||
1396 | /* Don't allow flags or name to change at remount */ | 1398 | /* Don't allow flags or name to change at remount */ |
1397 | if (((opts.flags ^ root->flags) & CGRP_ROOT_OPTION_MASK) || | 1399 | if (((opts.flags ^ root->flags) & CGRP_ROOT_OPTION_MASK) || |
1398 | (opts.name && strcmp(opts.name, root->name))) { | 1400 | (opts.name && strcmp(opts.name, root->name))) { |
1399 | pr_err("cgroup: option or name mismatch, new: 0x%lx \"%s\", old: 0x%lx \"%s\"\n", | 1401 | pr_err("option or name mismatch, new: 0x%lx \"%s\", old: 0x%lx \"%s\"\n", |
1400 | opts.flags & CGRP_ROOT_OPTION_MASK, opts.name ?: "", | 1402 | opts.flags & CGRP_ROOT_OPTION_MASK, opts.name ?: "", |
1401 | root->flags & CGRP_ROOT_OPTION_MASK, root->name); | 1403 | root->flags & CGRP_ROOT_OPTION_MASK, root->name); |
1402 | ret = -EINVAL; | 1404 | ret = -EINVAL; |
@@ -1665,11 +1667,11 @@ retry: | |||
1665 | 1667 | ||
1666 | if ((root->flags ^ opts.flags) & CGRP_ROOT_OPTION_MASK) { | 1668 | if ((root->flags ^ opts.flags) & CGRP_ROOT_OPTION_MASK) { |
1667 | if ((root->flags | opts.flags) & CGRP_ROOT_SANE_BEHAVIOR) { | 1669 | if ((root->flags | opts.flags) & CGRP_ROOT_SANE_BEHAVIOR) { |
1668 | pr_err("cgroup: sane_behavior: new mount options should match the existing superblock\n"); | 1670 | pr_err("sane_behavior: new mount options should match the existing superblock\n"); |
1669 | ret = -EINVAL; | 1671 | ret = -EINVAL; |
1670 | goto out_unlock; | 1672 | goto out_unlock; |
1671 | } else { | 1673 | } else { |
1672 | pr_warn("cgroup: new mount options do not match the existing superblock, will be ignored\n"); | 1674 | pr_warn("new mount options do not match the existing superblock, will be ignored\n"); |
1673 | } | 1675 | } |
1674 | } | 1676 | } |
1675 | 1677 | ||
@@ -2889,8 +2891,8 @@ static int cgroup_addrm_files(struct cgroup *cgrp, struct cftype cfts[], | |||
2889 | if (is_add) { | 2891 | if (is_add) { |
2890 | ret = cgroup_add_file(cgrp, cft); | 2892 | ret = cgroup_add_file(cgrp, cft); |
2891 | if (ret) { | 2893 | if (ret) { |
2892 | pr_warn("cgroup_addrm_files: failed to add %s, err=%d\n", | 2894 | pr_warn("%s: failed to add %s, err=%d\n", |
2893 | cft->name, ret); | 2895 | __func__, cft->name, ret); |
2894 | return ret; | 2896 | return ret; |
2895 | } | 2897 | } |
2896 | } else { | 2898 | } else { |
@@ -4168,10 +4170,10 @@ static int create_css(struct cgroup *cgrp, struct cgroup_subsys *ss) | |||
4168 | 4170 | ||
4169 | if (ss->broken_hierarchy && !ss->warned_broken_hierarchy && | 4171 | if (ss->broken_hierarchy && !ss->warned_broken_hierarchy && |
4170 | parent->parent) { | 4172 | parent->parent) { |
4171 | pr_warn("cgroup: %s (%d) created nested cgroup for controller \"%s\" which has incomplete hierarchy support. Nested cgroups may change behavior in the future.\n", | 4173 | pr_warn("%s (%d) created nested cgroup for controller \"%s\" which has incomplete hierarchy support. Nested cgroups may change behavior in the future.\n", |
4172 | current->comm, current->pid, ss->name); | 4174 | current->comm, current->pid, ss->name); |
4173 | if (!strcmp(ss->name, "memory")) | 4175 | if (!strcmp(ss->name, "memory")) |
4174 | pr_warn("cgroup: \"memory\" requires setting use_hierarchy to 1 on the root.\n"); | 4176 | pr_warn("\"memory\" requires setting use_hierarchy to 1 on the root\n"); |
4175 | ss->warned_broken_hierarchy = true; | 4177 | ss->warned_broken_hierarchy = true; |
4176 | } | 4178 | } |
4177 | 4179 | ||