From patchwork Sat Dec 17 05:24:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 13075780 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 6E0D2C4332F for ; Sat, 17 Dec 2022 05:25:22 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1p6PhH-0006zo-SE; Sat, 17 Dec 2022 05:25:19 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1p6PhG-0006zh-P3 for linux-f2fs-devel@lists.sourceforge.net; Sat, 17 Dec 2022 05:25:18 +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=oQ9FUlfJqKUzL4l6233CxlevyZaBJZZfa8QSv9Ld8lE=; b=aJDvPQLgaRgsQWLfpKeXcHvaCG axz1BP4gF8qV5BD7urJmYlNZKmX5SY6ffDKThAWE278Dq5/n6XCtAJCt7Lpy9rHjKillJ1SaV7JGi +AhQ5Muo/g/eM/F9wLHGgMYQVHxal5ezbq3cTTvS/v/bQPp2pXaoBZ5JPMRBip5vIB/A=; 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=oQ9FUlfJqKUzL4l6233CxlevyZaBJZZfa8QSv9Ld8lE=; b=C 4LOdV+N3/MLIki5rg9Ow6iTyfDaoRaHY3z/hjNUIoGdQfbx/MFhezP8KeJV6HXSR14xFqE/BOm0ai LFYi/hNDSoz9nHbtdoKuj0q9WnU8PvVqIMAFAet0eDKY3rX4SIfDXnEXTFpF9xnBqNGDbZOKl2PS5 WN3VgabbftdIXXws=; Received: from mail-psaapc01on2100.outbound.protection.outlook.com ([40.107.255.100] helo=APC01-PSA-obe.outbound.protection.outlook.com) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1p6Ph9-0026RO-2i for linux-f2fs-devel@lists.sourceforge.net; Sat, 17 Dec 2022 05:25:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fZEZLChhrd/gdmRyD2qHG41rDxx0V2qFibNRCy/UDSnMaFczw72gBhokl27O9ONbm1shO/8ztufy9sJIgHzpofuJG2bJCUU5Dbu59QeFrWpLgVZIxKLlDXaw/QTyqUtQj7eT4cDzXj9PSCnONEVYDauIwJ+PjjRp/XVh+q83JQj7TcVX7TwqJh/MX6LXxjdTjnZEz6kgeYh5duGHVBFNvE/VN5CNHAWqfIP4hGoCXR1UDR/hWRsUv+ocbArp8CFt9HNevVhdjDtxBgQ37XaDRsYReC9OidTYhYw/1/EE95TiBbEQBpQurC4nW0QElo1e/TQ+3TjPMXE8JASaOgN6Bg== 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=oQ9FUlfJqKUzL4l6233CxlevyZaBJZZfa8QSv9Ld8lE=; b=EUYvuF38MNYVdor98jSfl10GbvX9nKtUuYrZlpixXJHmCeAlEKm4E9eZZVQcEQSVrDLBOQ/Ak5ZhRVVXei2XCo3Mg4aDYGoug/cgYuKFm9hTjh2iVDYg4+x7o+po1FNLn6rCtULanGC+vTYJTfK8cBAAQbhbjuwKXCgumPcIG/EdYRBIFdLi4IJybBS3QgQvmhqktR/CCGGIzfVbXbPOPFBw3O0HE5r2w4bkIsY8uBfMi2QSB9ssr9acUMBfNvix4XHc+JY6O+9qb9y3Luk7QVEJM1oeE1tGkuqlEIB/TXGnQROmzZVUmqAuDxC5TRfBEDstysVrL5PCDqnkcnPm7g== 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=oQ9FUlfJqKUzL4l6233CxlevyZaBJZZfa8QSv9Ld8lE=; b=JXwsNQsCf/YgFED3vFSK/SG9wbf4UXAlcAnHajA8uvt7CPmW2Yf9o9jn+6thXE1LOXZ5ATsDS79Ty9UZjecz7JdIuxSyl8haIcRHB1IGBqrD+ss7Ips9O5yzAaO+Ti95DrxyljCjMU5wQzPjVf61NMKQlOdcKnBvnRc2lsssGkvMgmKaZTEDmAdNRv0rxoxvIDf+T6Cnio6mTPFMvrDe3whe+J3Ovu5z8ZsHaiLEHQbsrA4LIKdJKe3kpQE9fb5ndNprml4AKqclugmI+pav/MvKrCnQUqbvCTeDxGKTO04MqKb5sj/4sXc+znTDo7GJT5uPSlEea84TWgTn7hkVCw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by TYUPR06MB6195.apcprd06.prod.outlook.com (2603:1096:400:352::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Sat, 17 Dec 2022 05:24:59 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::ef03:cbfb:f8ef:d88b]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::ef03:cbfb:f8ef:d88b%9]) with mapi id 15.20.5924.016; Sat, 17 Dec 2022 05:24:59 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Sat, 17 Dec 2022 13:24:48 +0800 Message-Id: <20221217052448.60656-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: SI2PR01CA0029.apcprd01.prod.exchangelabs.com (2603:1096:4:192::8) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TYUPR06MB6195:EE_ X-MS-Office365-Filtering-Correlation-Id: c78f4f27-c803-42f5-08fb-08dadfef0a5b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qha+tbxLYQ7UyKmJuY47nPY8wfjLP9F2OzBUTa9xIvuSbtu0LxsRxxx3SDorb5YeiU97TjkgfCrzoiSlgW22pn4olYcdIb7Op4i2feXg6ctP/TxhxyK1c6nqxo8JuUa16nV7q6y8N9r6zn2Oy/RjAGhuPLI2UMn6hP9X4Y1pVP2IiTXNagl4REw+wwdcajiSPr1vhE1oGSrOM8wrQ9ExUcIivL/gmO7KolA1JSSmFKMIK1OM7Lb/wsmWEXhnnHR6S1M2BfNHc4fZ1xKIlqOHDBccdm78GegFpG+HmlXiGRwrCXX7Pl6eKeCb61J6jf5lH+ec2zS2iov8NIr82YZdHfxYwQclm1/I0+wUdxJ2xYsYW+n0jvp2+EqW6dOgr8ImdDeyg8Tdvs3nybm1Lwhc6T24shuutJw9Vkt3lle3DGU2Y24GK5nQV4rld2trEPsfikvj6bcme+5/YEE7DykG/FJUQK5BYQYSNOXywynpzzsId+FVIs0i2jcazGOTZfzGiSxpbITYcalC11BQMaRDLj77a68X/Kk5pAex6RsEeWiU59V7m8nGEbteAGs7C9BMnfKH5EHY26WJf6h4EXEcP6rj4FtaOusqFbSKrcDai9xSvTGLqKUfkOHArXsi78Pl/m1WbAPPBt2c9mbYh29q+03mILmwGudaCVYofggZNQ2aX268VQFlwGaA/7Ngcv5NZNNXlCLoYZ7MFuZvOcbSIQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEZPR06MB5269.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(346002)(376002)(366004)(396003)(136003)(39860400002)(451199015)(26005)(6506007)(86362001)(6666004)(52116002)(6512007)(6486002)(186003)(478600001)(36756003)(107886003)(38100700002)(38350700002)(2616005)(1076003)(83380400001)(5660300002)(8936002)(2906002)(8676002)(4326008)(66946007)(66556008)(66476007)(41300700001)(316002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +Y/zkNWB78PROaO2MGMqzXrVdQy/fqZVJZkbeVZcVfhPFcr5wINm9Rl002+wYxyk0H+yOTsioeSp3smp07g/NVcNuLSEKfFlHTMsDyNSu0rpOYRyW1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dEA3zs3PsS1WThQDDTWn5ZBFnuqd1Dw71SQ0pqWmOVoZTGKo1AQlfMarc4vbbiTAMoBZzLuXtPM/OvQXfzfgnxui2LD5x2WjhMlGxbHdh7fqqD5MRk9HmT88b7zNDaQtKJ+8Ae+OM5ASZOQiYFbgUdVCs3/C5PvrjuGobwGg80K9STMYuTvdgW5gBtcrT4Kj3gwShnixN+CyG1wY/KQNeJwm8gFc/N5sSeQXURe/NhteR8jmGcVcUC3nF3YLtaRBhm/0+0vcESo2Sqg3j+lC87u3gdEgAEzHrMKAEPuqO7k4we57Yvr4s+q+tfp06slY+Msh7zaeNSv9uhAjiIbnu5LPXObbC7pefPXPwDfNHOAL/3j7XAUueW2/EGCNTMAenldR9qoMi/zIZfwj X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: c78f4f27-c803-42f5-08fb-08dadfef0a5b X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Dec 2022 05:24:59.1356 (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: NpFgpb+DuNC1uVBmPKKBspQ9Ul6CUWgpQ7E249UcqOoacTl4QD1hcwhZgumcOxrUpUDMKHTlbkBwVR+agpOYpA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYUPR06MB6195 X-Headers-End: 1p6Ph9-0026RO-2i Subject: [f2fs-dev] [PATCH] f2fs: convert to use MIN_DISCARD_GRANULARITY macro 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: Yangtao Li via Linux-f2fs-devel From: Yangtao Li Reply-To: Yangtao Li Cc: Yangtao Li , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Commit 1cd2e6d54435 ("f2fs: define MIN_DISCARD_GRANULARITY macro") introduce it, let's convert to use MIN_DISCARD_GRANULARITY macro. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu --- fs/f2fs/segment.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 25ddea478fc1..c95a9683f950 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1610,9 +1610,9 @@ static unsigned int __wait_all_discard_cmd(struct f2fs_sb_info *sbi, return __wait_discard_cmd_range(sbi, dpolicy, 0, UINT_MAX); /* wait all */ - __init_discard_policy(sbi, &dp, DPOLICY_FSTRIM, 1); + __init_discard_policy(sbi, &dp, DPOLICY_FSTRIM, MIN_DISCARD_GRANULARITY); discard_blks = __wait_discard_cmd_range(sbi, &dp, 0, UINT_MAX); - __init_discard_policy(sbi, &dp, DPOLICY_UMOUNT, 1); + __init_discard_policy(sbi, &dp, DPOLICY_UMOUNT, MIN_DISCARD_GRANULARITY); discard_blks += __wait_discard_cmd_range(sbi, &dp, 0, UINT_MAX); return discard_blks; @@ -1695,7 +1695,8 @@ static int issue_discard_thread(void *data) if (sbi->gc_mode == GC_URGENT_HIGH || !f2fs_available_free_memory(sbi, DISCARD_CACHE)) - __init_discard_policy(sbi, &dpolicy, DPOLICY_FORCE, 1); + __init_discard_policy(sbi, &dpolicy, DPOLICY_FORCE, + MIN_DISCARD_GRANULARITY); else __init_discard_policy(sbi, &dpolicy, DPOLICY_BG, dcc->discard_granularity);