From patchwork Wed Nov 16 17:10:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 21196 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp262887wru; Wed, 16 Nov 2022 09:25:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf58x7LNoCo+/8i3wHYgepfF689w+QNyX5KLVR01NZoveVZ4Z3/QwUgWy+UGxRQfefi3gR/x X-Received: by 2002:a63:144c:0:b0:476:cac7:16ad with SMTP id 12-20020a63144c000000b00476cac716admr6545021pgu.128.1668619550249; Wed, 16 Nov 2022 09:25:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668619550; cv=pass; d=google.com; s=arc-20160816; b=TddhhBOsDQGzlQbXJ9stTGwlgnB4M5HG+sRYwDGUYWvlQl/jCZSP5lgy7xdMv0YsUK yhscog3cs596hchnDdqDwlHTw2zH2jhB6rrTq55XP7//CCS017amKTOtbvdGiftR7oWq yb+qm3P0UgIu8py724AzYiYGywcBmhnL64PtkZJQ3dE42SXZ1L7Qvs89u9lGJ1O5y+cm AHdUQ5lexAyEIzVshA8f338PrV5tYFBydCFwneal3Gegw4m7etETepYrNi7t8fSGLAyg ohLKBBf74yicn4d8n+/NDVgg4LL/HS4qRWnTN5U/2flzYnAj5t8IduMz9s8bK9qEp/0/ rgfA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=rEekV2IMUnHLGt28XYGpXnCuMMx28Cx287rx2Ab1uOw=; b=YClFlLtWBl36acUHNCNEjJUeYLxklutNDxojBAGWEGsD0XtUx/mUilKR221p6DnMXR GlfcKlWAhVpE9wjeYVhfARBnl7HWkZ9jlv3o2lfrf1ZeU2bO7TyShbaw1yp9xiHGtic6 vvD70ZR88yAVqmT7JOe8SnnQMB0J2k4Bp+Ggy9NCWb8IdDKRSmuQe4XF8qAsCoZRGnoE kC9c+BJZe/zAnWg+oAw/6q6rvnegRXEc8kOMRUHrLHIeIJMO0L4dsXj3ezoCovVSbJOA JZTQY1X9PINb/a1JlwOfQTVo3e7DH/5D0/cTgOvMo9sTHe2jG2Yqlui5Dw/0zg528eLe S8TA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=J4PKEVXM; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f184-20020a636ac1000000b0042b85da3a53si15648510pgc.473.2022.11.16.09.25.36; Wed, 16 Nov 2022 09:25:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=J4PKEVXM; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233982AbiKPRMN (ORCPT + 99 others); Wed, 16 Nov 2022 12:12:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234358AbiKPRLo (ORCPT ); Wed, 16 Nov 2022 12:11:44 -0500 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2126.outbound.protection.outlook.com [40.107.255.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 600525B86D for ; Wed, 16 Nov 2022 09:11:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IWXB87QHsELR9vtYEKilinMQOi9DVURbWRPatzoCUZ0S4vBBsnZozttaKXZ8R+1db8T4GiePuk43bWZ/yAZsrfo7nz3XDDF0wAgR0eFsMSUMgN7hKTER4yTeh4M8LTisKx3hMiXAY9tsddUAmbT9KkNUqx8T3ccYmfB9rR+BjZLzrkfU01i1FbwowHU/gR34AsTjvz1J6NlLR8BC9LZaxrOQzIT86c+CLI2U4cfutbYNKmfwSqRfTtAIqaTVEWJcTizFh5srhGh91ekxuLp57HD3Qe0yJmcc+/xJvMwf8hWUFR+dQrt238xWeSZOsdxpnetJMLS9yjNQRd5MiddmZA== 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=rEekV2IMUnHLGt28XYGpXnCuMMx28Cx287rx2Ab1uOw=; b=nycHTtGOIAL1mHNTJsGLLSa6jtjXpEq9QjlB4qzItoPfc/PFFWr81OEkH+N9pUTMu0K5HLkVTR50E2OvGkvJPgzB7HT9ilwg81ni4WWx95m8Oo+ypPgDyKvR+I91rozCh2DKcjzbU3IVqBjNI7r9Q/zS3mM98tpeGY33JlzQIxsl/xNSqY+O8b/UMVlS/b4iQ9XGHjiHJHcpzfgtal0xofpF6ysmZgTkNZvNDjO4gMLOjlWjXIyaw+uYcnZSXx/buyDXP+C1Cbmub0h++opa2UzwqB03HHUx5n6k9u6MZkxTxgOzPxUxma+FhZahWCdjlCpRvqsWd3Mnz16IW/YtRQ== 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=rEekV2IMUnHLGt28XYGpXnCuMMx28Cx287rx2Ab1uOw=; b=J4PKEVXMq16CiEJRBoLlgRlza4AiUY69pXC5EK3zqd/ndbCQx5EBpnuuVYIrs+0rBZIcTcc3PBSThPtuDMDAzfZ7j7sMnbLSK0y3MHiH2j+BAbJcm4gldMUNYYeTn/7PI5MF/UKG/NqJzzRncvK1svGXcF8lVxISWfWJE9FhvvaCYOhvqsVcBjCp3eq134rz+Ub9IOPrlx3Yug5B19+oTCc+xVbOdpWSQxHioJNpxW7dbViDRHXBlhXPGFuYQNd2mohwdvWCN7I/sNukMyBmn2urFdrI3ZX8Mp4GoLmCIU9J/uxFc4rdanl1PmQXIPaouugbPbUxmSc1+sPittLRyQ== 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 SEYPR06MB5867.apcprd06.prod.outlook.com (2603:1096:101:d0::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.18; Wed, 16 Nov 2022 17:11:37 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::1230:5f04:fe98:d139]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::1230:5f04:fe98:d139%9]) with mapi id 15.20.5813.019; Wed, 16 Nov 2022 17:11:37 +0000 From: Yangtao Li To: jaegeuk@kernel.org, chao@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Yangtao Li Subject: [PATCH] f2fs: make __queue_discard_cmd() return void Date: Thu, 17 Nov 2022 01:10:45 +0800 Message-Id: <20221116171045.13407-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: SGXP274CA0020.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::32) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEYPR06MB5867:EE_ X-MS-Office365-Filtering-Correlation-Id: 6edbda3d-be9b-419f-3d16-08dac7f59e79 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tvdrW/LgvCDDilXlnHT7ZL/gUo4f916TVP3dT80/qOSgfu9YR4Of4RORccdYn0EOyp0OVGP60sa57leQQLetrLMOU007eDjHvd20moeEtBzI4VlTlHlez4RNiwLiq09yCiKw+o9tYo2GaLZY5OHLZUeaOGYQcK+0nB5BVhV8mQwYIGLVhM8DFdaGCQ5WP++3D7DC/6mNlU3Zd2Aao6Uc1tJA9/PwPBJOIGiPKP2HUA8NJ5VhnxxLgcp6ieUw91hlNz1dkd6wKyX2U0c9obbPR7jn0BZpIeqADtjhOJxFQboGR1hHBi8YGaBNxFGXRbqGI5cH9mcx9iFJioPyE4F1EYISmwvh6ONT8f/e/6R90w/ItinqgattpUJV7NyOpE73eimsw+g74fQgtYqA//h0MxZQ2wvVHHu123nKG2bZ6xX30UgW5puio5Y9AaVy/2eNbuT/Q0NCFUjFrzWiJY6HUGIoTeYF7CAkUUtjyJT5QmMDuYW5dgrX/4PKhsMjedjv9B+d6VDPpGzJ5iZHrIxLfVCG1CS5KtPjUwPYiGSggbbpOOCyH0rKWohRoQrnHvZwPnGuqqBGQTEemtBHNdHlm+yVAzo0jNNgBGq8aQMogqLc2Nsii0nsrBuhIIi4AwMWIKtS7R5Yf6aGNfAXBnLAcQvZCp/vIlTpaJoNIAbkXEsYJYnnW/dnocixnjKGhFkdC7xGDUFwrsxMGh2DpLIHw+V/5Mphj/PYaakaFnCexPkFxdOXp76yxX6xwnhp9ngU 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)(136003)(396003)(39860400002)(451199015)(6506007)(6512007)(186003)(26005)(2616005)(38100700002)(52116002)(38350700002)(83380400001)(1076003)(2906002)(5660300002)(66476007)(6486002)(4326008)(316002)(478600001)(41300700001)(6666004)(8936002)(8676002)(66556008)(66946007)(107886003)(36756003)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: bfT9vgy08V16FHVcm47xyxc/3LLjQAXgpmgOr/6L2bz/UUO5oHypeYnT/ud+HClY7D4WyPIYbKLQs51UxArDokSeb5TeVLMXqaP3ugB7Qfl1yCaVKOWknKmjLGauJ86GkWinYhipdiYVvhFXxz/Yxpgh4Sov1hcimJzzNTd5xF9vsIHUt0oj3ZL+spzPJzzfg2PY98rsNRDIjpJnqPlw20t7MsIdeABDoQ/6Z0gEuyY4uEXrdQq4hpcgn6+o0DYLX9AhpNCUXeAFZinlOGQtDfW+RRT0/lb07XGJapG1cYn5JOg4Bx5x8IUn+AdHzki+eRN09oUT0X5SMTOGf4p6zA+JoaLq7o97Co70HXPDqynprBJrvyokf84K0w2jResGgJYIBDANbnRsmdCX700PjizxzcOv2bEAUJSFbXXP2j0/8QVSxIPGo22rAL2QsxXI5967MxfU3ItRguuiwcO/LaJ28SC15SZMmJ3LiWn3KQq6XfoEwDcpkB070spxPLeXxAcw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P2HwIf9qkce X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6edbda3d-be9b-419f-3d16-08dac7f59e79 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Nov 2022 17:11:36.8037 (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: GFDyq+W47AzbzO3lBfwbQAuwdrclBAn2eG6EjMMx6RqcPY1OdwOXivLKsanLmvsuHRQ7o/7LCs08FTKDPxncQA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5867 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749674413773914602?= X-GMAIL-MSGID: =?utf-8?q?1749674413773914602?= Since __queue_discard_cmd() never returns an error, let's make it return void. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu --- fs/f2fs/segment.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 8b0b76550578..14ece4bf7c7e 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1358,13 +1358,13 @@ static void __update_discard_tree_range(struct f2fs_sb_info *sbi, } } -static int __queue_discard_cmd(struct f2fs_sb_info *sbi, +static void __queue_discard_cmd(struct f2fs_sb_info *sbi, struct block_device *bdev, block_t blkstart, block_t blklen) { block_t lblkstart = blkstart; if (!f2fs_bdev_support_discard(bdev)) - return 0; + return; trace_f2fs_queue_discard(bdev, blkstart, blklen); @@ -1376,7 +1376,6 @@ static int __queue_discard_cmd(struct f2fs_sb_info *sbi, mutex_lock(&SM_I(sbi)->dcc_info->cmd_lock); __update_discard_tree_range(sbi, bdev, lblkstart, blkstart, blklen); mutex_unlock(&SM_I(sbi)->dcc_info->cmd_lock); - return 0; } static unsigned int __issue_discard_cmd_orderly(struct f2fs_sb_info *sbi, @@ -1776,7 +1775,8 @@ static int __f2fs_issue_discard_zone(struct f2fs_sb_info *sbi, } /* For conventional zones, use regular discard if supported */ - return __queue_discard_cmd(sbi, bdev, lblkstart, blklen); + __queue_discard_cmd(sbi, bdev, lblkstart, blklen); + return 0; } #endif @@ -1787,7 +1787,8 @@ static int __issue_discard_async(struct f2fs_sb_info *sbi, if (f2fs_sb_has_blkzoned(sbi) && bdev_is_zoned(bdev)) return __f2fs_issue_discard_zone(sbi, bdev, blkstart, blklen); #endif - return __queue_discard_cmd(sbi, bdev, blkstart, blklen); + __queue_discard_cmd(sbi, bdev, blkstart, blklen); + return 0; } static int f2fs_issue_discard(struct f2fs_sb_info *sbi,