From patchwork Tue Apr 23 11:27:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu Bo X-Patchwork-Id: 13639896 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6B98BC4345F for ; Tue, 23 Apr 2024 11:31:10 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1rzEMe-0004MP-UT; Tue, 23 Apr 2024 11:31:09 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rzEMd-0004MI-4a for linux-f2fs-devel@lists.sourceforge.net; Tue, 23 Apr 2024 11:31:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=JmCTpefieJRDInI6xnSs5CW3ict/+l2b5AU16ablbDI=; b=mxlhaFCXunFjW8XE/GNWDgSbhQ jmKSNHiF3/tZTzEMx+jkgg+TaXz49TVvu0b7Y/HhANoabxBVPn+0LoXbmaU+UaOCScx/UEyZkJ8in cvlJIjrrEmtBA+osZFMG/avaCd/qJ/tkrwpbmLEq7xmgB7v3Jxfx8qYxIU85rrt10Bos=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=JmCTpefieJRDInI6xnSs5CW3ict/+l2b5AU16ablbDI=; b=A b4TdAP6OOrpJTEmUeIwbn04Q2eTIZuYeN5wuSTVWBzNqll2CqOFTH7ta/zBCsYN4hQReH/wiDSfiM 9NWW9B57jHcGUgo9mXbQJvz3gCQ8ErSN9dcOUUieFF7HH2kkQLGf3Pv6vfjeLKOpiLhEuOQmK0gBx WUNhVYnnTWPp+q2U=; Received: from mail-southeastasiaazon11011004.outbound.protection.outlook.com ([52.101.133.4] helo=SINPR02CU002.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1rzEMY-0001ZS-FO for linux-f2fs-devel@lists.sourceforge.net; Tue, 23 Apr 2024 11:31:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XVVm5l5S2zr1+N/Lhm+6u3tvCkwJXysWi5m0cP0jNdUysAe9yaOtohok95KgzQ+LFIAQr6QKAhK2mr0tYSgm9jb9LIwTNNq3m3P90vRwdTN+LYNSVSlo45JXYY2pkX6sn4/x6qLFJhihR6RNG5VJ4wRHjygGtWygVAkBbrviDxerhn2lz7lCYf9g5W6aYY0MBl6aRrk5MYOBojpuB880CcjL8Pr72zPUp1UVqO41pM464Dv8Osi8fgsmS2N0issoSqoxqzfJimM+t93aghnSHmzi3zZYzO4AWCyusXRfyS/5FFNMR2NFM+esT4qURGB1JafvEOJTLsMFwUh286Kw4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JmCTpefieJRDInI6xnSs5CW3ict/+l2b5AU16ablbDI=; b=PZNuvbsABIS4XEZnIxtJmATF9+uUe2tl65Ny699Ex6UC0uJdhmXPe+z14ALfGH9eIk5XEwpstKWuFNdCLGX612OvT+ID64Nox2yn5bZYMVkF5zcKmV29oCme43uIJmageiXa8w6/Pv/gpTkO/GqzeasSJpXR9fkESlF1g8g7ERnFFtpaZotL0IOexN6SCbnQtfrgYJd6vY6L0C2we7C4KA4QOXl1bk2e2Nb2lGow3nldgF53B58gvn+9tqepK7EoV3KIw7rtVKz01OXao3TtH3i/WYXn8heg8Wj6/vXMk6/1o6XG636I6VWfKnk2DSwtsHAy2wEpSXnQ6exkNeKrUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JmCTpefieJRDInI6xnSs5CW3ict/+l2b5AU16ablbDI=; b=cm4aL/Cl1EKeRXHjjtgj8cA663KvpDQiiLzP2ldHk2aRLrqlD0ZD1T5KT2o1j6h0Wn8eRMxTqMP9m/aH1eOlfCbq1GjzNtjmFMfFpgAlPtS0+lUprsIG+9sLumNI4Cg3RgVj/bLQ5kbVku3DKzFPuaknFeMHp4EIbYZQcuGgYtE1jpEDgA9XP8SBUz4psI1A8yqqV+g0Ug/ZWNjPQDKl+BskDlF4nF1TBSBkzWMPNVuZUGTP4uMxTnP50lN4IbmPGWwGtg/VsZ+hWlO00V7cVel4UWHEDq4EcxFT4Vm3t0KP0c6qaDADL5h3uE8xIh88UuogIJPNxsqi36uA5TtDDw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from PSAPR06MB4486.apcprd06.prod.outlook.com (2603:1096:301:89::11) by SI2PR06MB5388.apcprd06.prod.outlook.com (2603:1096:4:1ef::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Tue, 23 Apr 2024 11:15:08 +0000 Received: from PSAPR06MB4486.apcprd06.prod.outlook.com ([fe80::43cb:1332:afef:81e5]) by PSAPR06MB4486.apcprd06.prod.outlook.com ([fe80::43cb:1332:afef:81e5%5]) with mapi id 15.20.7472.044; Tue, 23 Apr 2024 11:15:08 +0000 To: Jaegeuk Kim , Chao Yu Date: Tue, 23 Apr 2024 05:27:59 -0600 Message-Id: <20240423112759.4081008-1-bo.wu@vivo.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: SGXP274CA0001.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::13) To PSAPR06MB4486.apcprd06.prod.outlook.com (2603:1096:301:89::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PSAPR06MB4486:EE_|SI2PR06MB5388:EE_ X-MS-Office365-Filtering-Correlation-Id: 6bc88a35-c1aa-4f1a-2dfa-08dc6386a28a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +vYvIv0Z2JGOb2inXli/xRottIH2PYgC4gXpbcwltoc9qEVtyEPF/HC0N3KskY7wYhX36ZPlPv5lCVS4dNyDS0y7g3fJ9lCH4c/e79J7zL6f27Ff4w+gjK1y6ZXPyWFs+SJSpqrejHvMuFhWTkRR3FhiR6JdYAePTu8F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RD+xmy8NLpyYWTnHPj2koKsNl7M/qfsHeWcAlUYF3OwvWMMA8IspCgugoyHLaOIIwrIfrJhZvC1poFy3hGimt6KpbThfTSx855vHaQbcSS2EIjC0oa3hPQjFsYKAyMtjHfxw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PSAPR06MB4486.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(52116005)(1800799015)(366007)(38350700005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Btd750/jtY53OIUXNijD+zZ0TLEZ7GQ7r9iNLGgx9toz3Qb9aBwbSoNDVAAlk+FVCKQ5OI/Ys176Z7uBF+aS9eQK5Sd9BWSw5JymrhaqNuuI89d3PnD/U9cwNOvbDiOAq7cU2Q3P54PdGxURMZgELqWQV+HMBmJV9+OZ2Lq7JOkp0euXKKZTZ9TysgQFAPAOq+jKWgmXB6aDc3H6iDHez+sU5nPZhoyZ44c5PInf4bNBOAzS0Y9XDXkNlVDSy6e3YURZGKaba9lJkijj0F9Zu1CaENluDUJUuidt6QWbdkxWVN401Oopd1zlCcJgrbDQENvruOr9jXGYpbAZqcc0B6Nudrl8o+kVJlj4l60nYMyJgT719lGiYfQ1ueKQ9pOPGINcCQgL7GSVwrqpXpgMxcuU6L23hyqN01jB5/xoMjqa8NTjjHqGf3XadI4HEynzyqsEfFEmNnodjpWMzVGqrMcYURFle3LyGXzSpG8n7mIJeV8YFb2izSjjNJaX7iBwVruiyKKC4QdtZG/nunxGC5NHgfsG+SH2o2p33Vo30gvYHu1nKqI6tgCrw4Dg+KfgZWgXOE90tULhVBNPK0jq+gkmNSe5u/1uwUIWR+clssB3xZY2dyjv3c5jE1+GfJoXUH/3W308ZF93tr+GfGIWamw5C4Z1LTvObN3adk1DjCimVFnGoVIAQYDkzuqL+ninxQUqZj1qh+UDYPV6Vd2sGN2pg39MEFjULgbX4AYJhUQ+c0R2/r7kRGPfzcWDMMlSPpTMDESLFkOqxTVLmIRaD0njXLDritDHU01foCFU1Exw0HSC3sgJz52GuOSjZyZii9/5i2f8lkGNwYT2w8DgeG9DukJ9w9vIX1UiIXjAzVpmv2FcSoeMyadv1EMboiWG6WS3JOfS2Mxrh5PcrE7qa5wn9aMMk3mx7UqVKj5sb/qF+nA0Z/1ELwaf6PQmKSWh9JjuKhpfgWWY0uheQSpFPJBmD1qfD2qZ/4yZl3JGjlyBN8ksVdmrtPLP5wDUCy/eEYAn9S7F9gmIHR/gAghcKATpd6ACGeesqdxFlY+sL4SaaFD65VexFUYdyPTq4LCqx91ZoYw/sqkDeYGb4AWY0yiiH7d0nEu5IyYn1few4i2ZP50UYRns7AMBg+890SmFw86r0iGTeUDsq4JiVe0B18+WE1GUI1RFM7Gs5Cn2wo2Q3IwgwGLqy+1OEZVMZO2gEAorMWnzoIIKAbl4gRuw80sTg2idDo5lr24rJzrPxdEYafLRvDogSA6GcHCiYgvUmPFZMj+fuAHLiRm7utmrWYLSwMurSFRUYQX/JJsuHkDce8Q6Yaumpmsc8KL3xEwPih8OnjCx/QHN8S/chzZdp5eh5687ZwV+Kw5c4UITJvJ3Wa0RPPB6L4o4ftxNOfWeebz+k5v4PRR645eWEH2VGSXRMXBHWGfS9SK0fH3KkS3vrEpVJ2uA2uUg/FE66lxX3vua1Y/2enPtH4bKCtPs5BAT0YY5KGlkouPuOdQSf8DyjtPd0KBTCLx8TNUfgNOa6oJb7jD3EIvF0uMMbbpzcIdReqvKbNiWAMuMcke2yVaBAFviHzNWohhcCimq5jX4 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6bc88a35-c1aa-4f1a-2dfa-08dc6386a28a X-MS-Exchange-CrossTenant-AuthSource: PSAPR06MB4486.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2024 11:15:08.5640 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZNSQdxMrzB7XoXxpKVAPFo4zzD6ugAh4CXXrDRLL2WuZ8ObQC6/YOdWgFJxHU+5FvS9gfKc1KXd2BvT6b/pKqQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB5388 X-Headers-End: 1rzEMY-0001ZS-FO Subject: [f2fs-dev] [PATCH] f2fs: use helper to print zone condition X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Wu Bo via Linux-f2fs-devel From: Wu Bo Reply-To: Wu Bo Cc: Wu Bo , linux-kernel@vger.kernel.org, Wu Bo , linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net To make code clean, use blk_zone_cond_str() to print debug information. Signed-off-by: Wu Bo Reviewed-by: Chao Yu --- 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,