diff options
author | Joe Perches <joe@perches.com> | 2019-06-18 17:48:42 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2019-07-02 15:40:40 -0700 |
commit | dcbb4c10e6d9693cc9d6fa493b4d130b66a60c7d (patch) | |
tree | b725d2166c9325de23807cc204abc7c153813aa4 /fs/f2fs/gc.c | |
parent | 8740edc3e5cca78e20ac3ba0127f61ab7cdb4d2f (diff) |
f2fs: introduce f2fs_<level> macros to wrap f2fs_printk()
- Add and use f2fs_<level> macros
- Convert f2fs_msg to f2fs_printk
- Remove level from f2fs_printk and embed the level in the format
- Coalesce formats and align multi-line arguments
- Remove unnecessary duplicate extern f2fs_msg f2fs.h
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/gc.c')
-rw-r--r-- | fs/f2fs/gc.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index e19b49b02d1b..c65f87f11de0 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -618,9 +618,8 @@ static bool is_alive(struct f2fs_sb_info *sbi, struct f2fs_summary *sum, } if (sum->version != dni->version) { - f2fs_msg(sbi->sb, KERN_WARNING, - "%s: valid data with mismatched node version.", - __func__); + f2fs_warn(sbi, "%s: valid data with mismatched node version.", + __func__); set_sbi_flag(sbi, SBI_NEED_FSCK); } @@ -1183,9 +1182,8 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi, sum = page_address(sum_page); if (type != GET_SUM_TYPE((&sum->footer))) { - f2fs_msg(sbi->sb, KERN_ERR, "Inconsistent segment (%u) " - "type [%d, %d] in SSA and SIT", - segno, type, GET_SUM_TYPE((&sum->footer))); + f2fs_err(sbi, "Inconsistent segment (%u) type [%d, %d] in SSA and SIT", + segno, type, GET_SUM_TYPE((&sum->footer))); set_sbi_flag(sbi, SBI_NEED_FSCK); f2fs_stop_checkpoint(sbi, false); goto skip; @@ -1397,8 +1395,8 @@ static int free_segment_range(struct f2fs_sb_info *sbi, unsigned int start, next_inuse = find_next_inuse(FREE_I(sbi), end + 1, start); if (next_inuse <= end) { - f2fs_msg(sbi->sb, KERN_ERR, - "segno %u should be free but still inuse!", next_inuse); + f2fs_err(sbi, "segno %u should be free but still inuse!", + next_inuse); f2fs_bug_on(sbi, 1); } return err; @@ -1455,14 +1453,12 @@ int f2fs_resize_fs(struct f2fs_sb_info *sbi, __u64 block_count) return 0; if (is_sbi_flag_set(sbi, SBI_NEED_FSCK)) { - f2fs_msg(sbi->sb, KERN_ERR, - "Should run fsck to repair first."); + f2fs_err(sbi, "Should run fsck to repair first."); return -EINVAL; } if (test_opt(sbi, DISABLE_CHECKPOINT)) { - f2fs_msg(sbi->sb, KERN_ERR, - "Checkpoint should be enabled."); + f2fs_err(sbi, "Checkpoint should be enabled."); return -EINVAL; } @@ -1526,8 +1522,7 @@ int f2fs_resize_fs(struct f2fs_sb_info *sbi, __u64 block_count) out: if (err) { set_sbi_flag(sbi, SBI_NEED_FSCK); - f2fs_msg(sbi->sb, KERN_ERR, - "resize_fs failed, should run fsck to repair!"); + f2fs_err(sbi, "resize_fs failed, should run fsck to repair!"); MAIN_SECS(sbi) += secs; spin_lock(&sbi->stat_lock); |