Skip to content

Commit 3763f9e

Browse files
Wu BoJaegeuk Kim
authored andcommitted
f2fs: use helper to print zone condition
To make code clean, use blk_zone_cond_str() to print debug information. Signed-off-by: Wu Bo <bo.wu@vivo.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent b864ddb commit 3763f9e

1 file changed

Lines changed: 3 additions & 14 deletions

File tree

fs/f2fs/segment.c

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5025,17 +5025,6 @@ static int sanity_check_curseg(struct f2fs_sb_info *sbi)
50255025
}
50265026

50275027
#ifdef CONFIG_BLK_DEV_ZONED
5028-
static const char *f2fs_zone_status[BLK_ZONE_COND_OFFLINE + 1] = {
5029-
[BLK_ZONE_COND_NOT_WP] = "NOT_WP",
5030-
[BLK_ZONE_COND_EMPTY] = "EMPTY",
5031-
[BLK_ZONE_COND_IMP_OPEN] = "IMPLICIT_OPEN",
5032-
[BLK_ZONE_COND_EXP_OPEN] = "EXPLICIT_OPEN",
5033-
[BLK_ZONE_COND_CLOSED] = "CLOSED",
5034-
[BLK_ZONE_COND_READONLY] = "READONLY",
5035-
[BLK_ZONE_COND_FULL] = "FULL",
5036-
[BLK_ZONE_COND_OFFLINE] = "OFFLINE",
5037-
};
5038-
50395028
static int check_zone_write_pointer(struct f2fs_sb_info *sbi,
50405029
struct f2fs_dev_info *fdev,
50415030
struct blk_zone *zone)
@@ -5066,7 +5055,7 @@ static int check_zone_write_pointer(struct f2fs_sb_info *sbi,
50665055
if (IS_CURSEC(sbi, GET_SEC_FROM_SEG(sbi, zone_segno))) {
50675056
f2fs_notice(sbi, "Open zones: valid block[0x%x,0x%x] cond[%s]",
50685057
zone_segno, valid_block_cnt,
5069-
f2fs_zone_status[zone->cond]);
5058+
blk_zone_cond_str(zone->cond));
50705059
return 0;
50715060
}
50725061

@@ -5077,7 +5066,7 @@ static int check_zone_write_pointer(struct f2fs_sb_info *sbi,
50775066
if (!valid_block_cnt) {
50785067
f2fs_notice(sbi, "Zone without valid block has non-zero write "
50795068
"pointer. Reset the write pointer: cond[%s]",
5080-
f2fs_zone_status[zone->cond]);
5069+
blk_zone_cond_str(zone->cond));
50815070
ret = __f2fs_issue_discard_zone(sbi, fdev->bdev, zone_block,
50825071
zone->len >> log_sectors_per_block);
50835072
if (ret)
@@ -5095,7 +5084,7 @@ static int check_zone_write_pointer(struct f2fs_sb_info *sbi,
50955084
*/
50965085
f2fs_notice(sbi, "Valid blocks are not aligned with write "
50975086
"pointer: valid block[0x%x,0x%x] cond[%s]",
5098-
zone_segno, valid_block_cnt, f2fs_zone_status[zone->cond]);
5087+
zone_segno, valid_block_cnt, blk_zone_cond_str(zone->cond));
50995088

51005089
nofs_flags = memalloc_nofs_save();
51015090
ret = blkdev_zone_mgmt(fdev->bdev, REQ_OP_ZONE_FINISH,

0 commit comments

Comments
 (0)