summaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/sysfs.c
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2016-08-02 17:05:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-08-02 19:35:17 -0400
commitfeee880fa58254fcc1c78bc8b6446a435cc1baf0 (patch)
treec09328c3d4924f88778ac3d890b038a9fb8c0720 /fs/nilfs2/sysfs.c
parent6625689e159fa1d43572ee113713ab23bec03131 (diff)
nilfs2: reduce bare use of printk() with nilfs_msg()
Replace most use of printk() in nilfs2 implementation with nilfs_msg(), and reduce the following checkpatch.pl warning: "WARNING: Prefer [subsystem eg: netdev]_crit([subsystem]dev, ... then dev_crit(dev, ... then pr_crit(... to printk(KERN_CRIT ..." This patch also fixes a minor checkpatch warning "WARNING: quoted string split across lines" that often accompanies the prior warning, and amends message format as needed. Link: http://lkml.kernel.org/r/1464875891-5443-5-git-send-email-konishi.ryusuke@lab.ntt.co.jp Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nilfs2/sysfs.c')
-rw-r--r--fs/nilfs2/sysfs.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/fs/nilfs2/sysfs.c b/fs/nilfs2/sysfs.c
index 8ffa42b704d8..8e57bb91fe16 100644
--- a/fs/nilfs2/sysfs.c
+++ b/fs/nilfs2/sysfs.c
@@ -272,8 +272,8 @@ nilfs_checkpoints_checkpoints_number_show(struct nilfs_checkpoints_attr *attr,
272 err = nilfs_cpfile_get_stat(nilfs->ns_cpfile, &cpstat); 272 err = nilfs_cpfile_get_stat(nilfs->ns_cpfile, &cpstat);
273 up_read(&nilfs->ns_segctor_sem); 273 up_read(&nilfs->ns_segctor_sem);
274 if (err < 0) { 274 if (err < 0) {
275 printk(KERN_ERR "NILFS: unable to get checkpoint stat: err=%d\n", 275 nilfs_msg(nilfs->ns_sb, KERN_ERR,
276 err); 276 "unable to get checkpoint stat: err=%d", err);
277 return err; 277 return err;
278 } 278 }
279 279
@@ -295,8 +295,8 @@ nilfs_checkpoints_snapshots_number_show(struct nilfs_checkpoints_attr *attr,
295 err = nilfs_cpfile_get_stat(nilfs->ns_cpfile, &cpstat); 295 err = nilfs_cpfile_get_stat(nilfs->ns_cpfile, &cpstat);
296 up_read(&nilfs->ns_segctor_sem); 296 up_read(&nilfs->ns_segctor_sem);
297 if (err < 0) { 297 if (err < 0) {
298 printk(KERN_ERR "NILFS: unable to get checkpoint stat: err=%d\n", 298 nilfs_msg(nilfs->ns_sb, KERN_ERR,
299 err); 299 "unable to get checkpoint stat: err=%d", err);
300 return err; 300 return err;
301 } 301 }
302 302
@@ -414,8 +414,8 @@ nilfs_segments_dirty_segments_show(struct nilfs_segments_attr *attr,
414 err = nilfs_sufile_get_stat(nilfs->ns_sufile, &sustat); 414 err = nilfs_sufile_get_stat(nilfs->ns_sufile, &sustat);
415 up_read(&nilfs->ns_segctor_sem); 415 up_read(&nilfs->ns_segctor_sem);
416 if (err < 0) { 416 if (err < 0) {
417 printk(KERN_ERR "NILFS: unable to get segment stat: err=%d\n", 417 nilfs_msg(nilfs->ns_sb, KERN_ERR,
418 err); 418 "unable to get segment stat: err=%d", err);
419 return err; 419 return err;
420 } 420 }
421 421
@@ -789,14 +789,15 @@ nilfs_superblock_sb_update_frequency_store(struct nilfs_superblock_attr *attr,
789 789
790 err = kstrtouint(skip_spaces(buf), 0, &val); 790 err = kstrtouint(skip_spaces(buf), 0, &val);
791 if (err) { 791 if (err) {
792 printk(KERN_ERR "NILFS: unable to convert string: err=%d\n", 792 nilfs_msg(nilfs->ns_sb, KERN_ERR,
793 err); 793 "unable to convert string: err=%d", err);
794 return err; 794 return err;
795 } 795 }
796 796
797 if (val < NILFS_SB_FREQ) { 797 if (val < NILFS_SB_FREQ) {
798 val = NILFS_SB_FREQ; 798 val = NILFS_SB_FREQ;
799 printk(KERN_WARNING "NILFS: superblock update frequency cannot be lesser than 10 seconds\n"); 799 nilfs_msg(nilfs->ns_sb, KERN_WARNING,
800 "superblock update frequency cannot be lesser than 10 seconds");
800 } 801 }
801 802
802 down_write(&nilfs->ns_sem); 803 down_write(&nilfs->ns_sem);
@@ -999,7 +1000,8 @@ int nilfs_sysfs_create_device_group(struct super_block *sb)
999 nilfs->ns_dev_subgroups = kzalloc(devgrp_size, GFP_KERNEL); 1000 nilfs->ns_dev_subgroups = kzalloc(devgrp_size, GFP_KERNEL);
1000 if (unlikely(!nilfs->ns_dev_subgroups)) { 1001 if (unlikely(!nilfs->ns_dev_subgroups)) {
1001 err = -ENOMEM; 1002 err = -ENOMEM;
1002 printk(KERN_ERR "NILFS: unable to allocate memory for device group\n"); 1003 nilfs_msg(sb, KERN_ERR,
1004 "unable to allocate memory for device group");
1003 goto failed_create_device_group; 1005 goto failed_create_device_group;
1004 } 1006 }
1005 1007
@@ -1109,15 +1111,15 @@ int __init nilfs_sysfs_init(void)
1109 nilfs_kset = kset_create_and_add(NILFS_ROOT_GROUP_NAME, NULL, fs_kobj); 1111 nilfs_kset = kset_create_and_add(NILFS_ROOT_GROUP_NAME, NULL, fs_kobj);
1110 if (!nilfs_kset) { 1112 if (!nilfs_kset) {
1111 err = -ENOMEM; 1113 err = -ENOMEM;
1112 printk(KERN_ERR "NILFS: unable to create sysfs entry: err %d\n", 1114 nilfs_msg(NULL, KERN_ERR,
1113 err); 1115 "unable to create sysfs entry: err=%d", err);
1114 goto failed_sysfs_init; 1116 goto failed_sysfs_init;
1115 } 1117 }
1116 1118
1117 err = sysfs_create_group(&nilfs_kset->kobj, &nilfs_feature_attr_group); 1119 err = sysfs_create_group(&nilfs_kset->kobj, &nilfs_feature_attr_group);
1118 if (unlikely(err)) { 1120 if (unlikely(err)) {
1119 printk(KERN_ERR "NILFS: unable to create feature group: err %d\n", 1121 nilfs_msg(NULL, KERN_ERR,
1120 err); 1122 "unable to create feature group: err=%d", err);
1121 goto cleanup_sysfs_init; 1123 goto cleanup_sysfs_init;
1122 } 1124 }
1123 1125