Skip to content

Commit 833dcd3

Browse files
JoePerchesJaegeuk Kim
authored andcommitted
f2fs: logging neatening
Update the logging uses that have unnecessary newlines as the f2fs_printk function and so its f2fs_<level> macro callers already adds one. This allows searching single line logging entries with an easier grep and also avoids unnecessary blank lines in the logging. Miscellanea: o Coalesce formats o Align to open parenthesis Signed-off-by: Joe Perches <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent c614041 commit 833dcd3

File tree

5 files changed

+17
-21
lines changed

5 files changed

+17
-21
lines changed

fs/f2fs/data.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3833,7 +3833,7 @@ static int f2fs_is_file_aligned(struct inode *inode)
38333833

38343834
/* hole */
38353835
if (!(map.m_flags & F2FS_MAP_FLAGS)) {
3836-
f2fs_err(sbi, "Swapfile has holes\n");
3836+
f2fs_err(sbi, "Swapfile has holes");
38373837
ret = -ENOENT;
38383838
goto out;
38393839
}
@@ -3854,9 +3854,8 @@ static int f2fs_is_file_aligned(struct inode *inode)
38543854
cur_lblock += nr_pblocks;
38553855
}
38563856
if (not_aligned)
3857-
f2fs_warn(sbi, "Swapfile (%u) is not align to section: \n"
3858-
"\t1) creat(), 2) ioctl(F2FS_IOC_SET_PIN_FILE), 3) fallocate()",
3859-
not_aligned);
3857+
f2fs_warn(sbi, "Swapfile (%u) is not align to section: 1) creat(), 2) ioctl(F2FS_IOC_SET_PIN_FILE), 3) fallocate()",
3858+
not_aligned);
38603859
out:
38613860
return ret;
38623861
}
@@ -3904,7 +3903,7 @@ static int check_swap_activate_fast(struct swap_info_struct *sis,
39043903

39053904
/* hole */
39063905
if (!(map.m_flags & F2FS_MAP_FLAGS)) {
3907-
f2fs_err(sbi, "Swapfile has holes\n");
3906+
f2fs_err(sbi, "Swapfile has holes");
39083907
ret = -EINVAL;
39093908
goto out;
39103909
}
@@ -3950,9 +3949,8 @@ static int check_swap_activate_fast(struct swap_info_struct *sis,
39503949
sis->highest_bit = cur_lblock - 1;
39513950

39523951
if (not_aligned)
3953-
f2fs_warn(sbi, "Swapfile (%u) is not align to section: \n"
3954-
"\t1) creat(), 2) ioctl(F2FS_IOC_SET_PIN_FILE), 3) fallocate()",
3955-
not_aligned);
3952+
f2fs_warn(sbi, "Swapfile (%u) is not align to section: 1) creat(), 2) ioctl(F2FS_IOC_SET_PIN_FILE), 3) fallocate()",
3953+
not_aligned);
39563954
out:
39573955
return ret;
39583956
}
@@ -4060,7 +4058,7 @@ static int check_swap_activate(struct swap_info_struct *sis,
40604058
out:
40614059
return ret;
40624060
bad_bmap:
4063-
f2fs_err(sbi, "Swapfile has holes\n");
4061+
f2fs_err(sbi, "Swapfile has holes");
40644062
return -EINVAL;
40654063
}
40664064

fs/f2fs/file.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3235,7 +3235,7 @@ static int f2fs_ioc_enable_verity(struct file *filp, unsigned long arg)
32353235

32363236
if (!f2fs_sb_has_verity(F2FS_I_SB(inode))) {
32373237
f2fs_warn(F2FS_I_SB(inode),
3238-
"Can't enable fs-verity on inode %lu: the verity feature is not enabled on this filesystem.\n",
3238+
"Can't enable fs-verity on inode %lu: the verity feature is not enabled on this filesystem",
32393239
inode->i_ino);
32403240
return -EOPNOTSUPP;
32413241
}
@@ -4019,9 +4019,8 @@ static int f2fs_ioc_decompress_file(struct file *filp, unsigned long arg)
40194019
LLONG_MAX);
40204020

40214021
if (ret)
4022-
f2fs_warn(sbi, "%s: The file might be partially decompressed "
4023-
"(errno=%d). Please delete the file.\n",
4024-
__func__, ret);
4022+
f2fs_warn(sbi, "%s: The file might be partially decompressed (errno=%d). Please delete the file.",
4023+
__func__, ret);
40254024
out:
40264025
inode_unlock(inode);
40274026
file_end_write(filp);
@@ -4093,9 +4092,8 @@ static int f2fs_ioc_compress_file(struct file *filp, unsigned long arg)
40934092
clear_inode_flag(inode, FI_ENABLE_COMPRESS);
40944093

40954094
if (ret)
4096-
f2fs_warn(sbi, "%s: The file might be partially compressed "
4097-
"(errno=%d). Please delete the file.\n",
4098-
__func__, ret);
4095+
f2fs_warn(sbi, "%s: The file might be partially compressed (errno=%d). Please delete the file.",
4096+
__func__, ret);
40994097
out:
41004098
inode_unlock(inode);
41014099
file_end_write(filp);

fs/f2fs/gc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,8 +1031,8 @@ static bool is_alive(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
10311031

10321032
if (unlikely(check_valid_map(sbi, segno, offset))) {
10331033
if (!test_and_set_bit(segno, SIT_I(sbi)->invalid_segmap)) {
1034-
f2fs_err(sbi, "mismatched blkaddr %u (source_blkaddr %u) in seg %u\n",
1035-
blkaddr, source_blkaddr, segno);
1034+
f2fs_err(sbi, "mismatched blkaddr %u (source_blkaddr %u) in seg %u",
1035+
blkaddr, source_blkaddr, segno);
10361036
f2fs_bug_on(sbi, 1);
10371037
}
10381038
}

fs/f2fs/segment.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3920,7 +3920,7 @@ static int restore_curseg_summaries(struct f2fs_sb_info *sbi)
39203920
/* sanity check for summary blocks */
39213921
if (nats_in_cursum(nat_j) > NAT_JOURNAL_ENTRIES ||
39223922
sits_in_cursum(sit_j) > SIT_JOURNAL_ENTRIES) {
3923-
f2fs_err(sbi, "invalid journal entries nats %u sits %u\n",
3923+
f2fs_err(sbi, "invalid journal entries nats %u sits %u",
39243924
nats_in_cursum(nat_j), sits_in_cursum(sit_j));
39253925
return -EINVAL;
39263926
}

fs/f2fs/super.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
11531153
}
11541154

11551155
if (test_opt(sbi, DISABLE_CHECKPOINT) && f2fs_lfs_mode(sbi)) {
1156-
f2fs_err(sbi, "LFS not compatible with checkpoint=disable\n");
1156+
f2fs_err(sbi, "LFS not compatible with checkpoint=disable");
11571157
return -EINVAL;
11581158
}
11591159

@@ -3555,7 +3555,7 @@ static int f2fs_scan_devices(struct f2fs_sb_info *sbi)
35553555
#ifdef CONFIG_BLK_DEV_ZONED
35563556
if (bdev_zoned_model(FDEV(i).bdev) == BLK_ZONED_HM &&
35573557
!f2fs_sb_has_blkzoned(sbi)) {
3558-
f2fs_err(sbi, "Zoned block device feature not enabled\n");
3558+
f2fs_err(sbi, "Zoned block device feature not enabled");
35593559
return -EINVAL;
35603560
}
35613561
if (bdev_zoned_model(FDEV(i).bdev) != BLK_ZONED_NONE) {

0 commit comments

Comments
 (0)