* [f2fs-dev] [PATCH] f2fs: use helper to print zone condition
@ 2024-04-23 11:27 Wu Bo via Linux-f2fs-devel
2024-04-25 13:30 ` Chao Yu
2024-04-25 15:40 ` patchwork-bot+f2fs
0 siblings, 2 replies; 3+ messages in thread
From: Wu Bo via Linux-f2fs-devel @ 2024-04-23 11:27 UTC (permalink / raw)
To: Jaegeuk Kim, Chao Yu; +Cc: Wu Bo, linux-kernel, Wu Bo, linux-f2fs-devel
To make code clean, use blk_zone_cond_str() to print debug information.
Signed-off-by: Wu Bo <bo.wu@vivo.com>
---
fs/f2fs/segment.c | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index f0da516ba8dc..22d56b99f930 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -4961,17 +4961,6 @@ static int sanity_check_curseg(struct f2fs_sb_info *sbi)
}
#ifdef CONFIG_BLK_DEV_ZONED
-static const char *f2fs_zone_status[BLK_ZONE_COND_OFFLINE + 1] = {
- [BLK_ZONE_COND_NOT_WP] = "NOT_WP",
- [BLK_ZONE_COND_EMPTY] = "EMPTY",
- [BLK_ZONE_COND_IMP_OPEN] = "IMPLICIT_OPEN",
- [BLK_ZONE_COND_EXP_OPEN] = "EXPLICIT_OPEN",
- [BLK_ZONE_COND_CLOSED] = "CLOSED",
- [BLK_ZONE_COND_READONLY] = "READONLY",
- [BLK_ZONE_COND_FULL] = "FULL",
- [BLK_ZONE_COND_OFFLINE] = "OFFLINE",
-};
-
static int check_zone_write_pointer(struct f2fs_sb_info *sbi,
struct f2fs_dev_info *fdev,
struct blk_zone *zone)
@@ -5002,7 +4991,7 @@ static int check_zone_write_pointer(struct f2fs_sb_info *sbi,
if (IS_CURSEC(sbi, GET_SEC_FROM_SEG(sbi, zone_segno))) {
f2fs_notice(sbi, "Open zones: valid block[0x%x,0x%x] cond[%s]",
zone_segno, valid_block_cnt,
- f2fs_zone_status[zone->cond]);
+ blk_zone_cond_str(zone->cond));
return 0;
}
@@ -5013,7 +5002,7 @@ static int check_zone_write_pointer(struct f2fs_sb_info *sbi,
if (!valid_block_cnt) {
f2fs_notice(sbi, "Zone without valid block has non-zero write "
"pointer. Reset the write pointer: cond[%s]",
- f2fs_zone_status[zone->cond]);
+ blk_zone_cond_str(zone->cond));
ret = __f2fs_issue_discard_zone(sbi, fdev->bdev, zone_block,
zone->len >> log_sectors_per_block);
if (ret)
@@ -5031,7 +5020,7 @@ static int check_zone_write_pointer(struct f2fs_sb_info *sbi,
*/
f2fs_notice(sbi, "Valid blocks are not aligned with write "
"pointer: valid block[0x%x,0x%x] cond[%s]",
- zone_segno, valid_block_cnt, f2fs_zone_status[zone->cond]);
+ zone_segno, valid_block_cnt, blk_zone_cond_str(zone->cond));
nofs_flags = memalloc_nofs_save();
ret = blkdev_zone_mgmt(fdev->bdev, REQ_OP_ZONE_FINISH,
--
2.35.3
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: use helper to print zone condition
2024-04-23 11:27 [f2fs-dev] [PATCH] f2fs: use helper to print zone condition Wu Bo via Linux-f2fs-devel
@ 2024-04-25 13:30 ` Chao Yu
2024-04-25 15:40 ` patchwork-bot+f2fs
1 sibling, 0 replies; 3+ messages in thread
From: Chao Yu @ 2024-04-25 13:30 UTC (permalink / raw)
To: Wu Bo, Jaegeuk Kim; +Cc: Wu Bo, linux-kernel, linux-f2fs-devel
On 2024/4/23 19:27, Wu Bo wrote:
> 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>
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: use helper to print zone condition
2024-04-23 11:27 [f2fs-dev] [PATCH] f2fs: use helper to print zone condition Wu Bo via Linux-f2fs-devel
2024-04-25 13:30 ` Chao Yu
@ 2024-04-25 15:40 ` patchwork-bot+f2fs
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+f2fs @ 2024-04-25 15:40 UTC (permalink / raw)
To: Wu Bo; +Cc: wubo.oduw, jaegeuk, linux-kernel, linux-f2fs-devel
Hello:
This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@kernel.org>:
On Tue, 23 Apr 2024 05:27:59 -0600 you wrote:
> To make code clean, use blk_zone_cond_str() to print debug information.
>
> Signed-off-by: Wu Bo <bo.wu@vivo.com>
> ---
> fs/f2fs/segment.c | 17 +++--------------
> 1 file changed, 3 insertions(+), 14 deletions(-)
Here is the summary with links:
- [f2fs-dev] f2fs: use helper to print zone condition
https://git.kernel.org/jaegeuk/f2fs/c/3763f9effcdc
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-04-25 15:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-23 11:27 [f2fs-dev] [PATCH] f2fs: use helper to print zone condition Wu Bo via Linux-f2fs-devel
2024-04-25 13:30 ` Chao Yu
2024-04-25 15:40 ` patchwork-bot+f2fs
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).