From patchwork Fri Mar 10 06:07:34 2023 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: 67229 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp711688wrd; Thu, 9 Mar 2023 22:21:21 -0800 (PST) X-Google-Smtp-Source: AK7set+1GmtGzOASwYLQSw0989/6keI5nFfhJb/0vsF3GsjYRTw0mKZzq4CnfxO4UfsCA1v+fKPi X-Received: by 2002:a05:6a20:244d:b0:cc:e39e:3f64 with SMTP id t13-20020a056a20244d00b000cce39e3f64mr23562868pzc.24.1678429281307; Thu, 09 Mar 2023 22:21:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678429281; cv=pass; d=google.com; s=arc-20160816; b=x+nd2demDBhAEdILertdpr2FMSLel1sjjqqp7UvARd60HJXwFp8CjRNOse3FdmKGLG +YqxloM0j41mPFLBXIIeU+mFW7IfwdYX1NAaQVYilJ/hgtoCjHJVkV91eskTtrvQwetH m6I/A7kbHWX07Aq2LPdaO2Sj8MerYGg03dS9CsYS/PzhKqUhaRedKjZC0ysce10iBT8c UgxL/JCKgsLawTl3/QlAAyNUufBFKPurMhVAq/WAAFppdYLR1JEMIrd7VAPDVCT/DACz vrMa+kanxhiMk2u50qvt09Z5LJ2PM4f7pSZfMe6PtczBQ9q07z0hMPJrBjDWbjjm78j/ sjbA== 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=9eGLPo+gwK3BhKaizmVCd0S9rUlfgoSwrRoS3Fp+T4I=; b=x6WoYSxKdfH/TQTunT4do8kmjGb2ErC9fqxxRV6oT2ylD06zoFBOheiIcnNMADG2JQ E7r+WDGL+7xmpaZdc7/16eGvbhY3uhoQ5kALQaj4lSdDzZmSxJjrFhHc0RYeGJgXV6qs /4bu3iVJNarhKiLWeIEglTqr14wIu7p2u7iqB7tzr89gZiFnLLpvDQku2nzjB8EmW0jC e1AFTRogHyohxZeodNRlQpmpKLdzf9kJjWtxjZ8fRFoz7HJh7tbkmKS63xbOVi9azIBS 7O7xA2hybV5NIGXQc2K0cxrsmXxKsKfzBXTQ6aGnBfoZUquI8KLjZXjkFLALe4Pce9gM IUSA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=m5ISxwia; 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 m13-20020a63580d000000b00503a3e606besi1225384pgb.253.2023.03.09.22.21.05; Thu, 09 Mar 2023 22:21:21 -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=m5ISxwia; 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 S229541AbjCJGH6 (ORCPT + 99 others); Fri, 10 Mar 2023 01:07:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbjCJGH4 (ORCPT ); Fri, 10 Mar 2023 01:07:56 -0500 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2107.outbound.protection.outlook.com [40.107.117.107]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23868E9833; Thu, 9 Mar 2023 22:07:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eDAXoraXxwmBKkFGjZ2r2+vG0ke36bg9/bs2aYqiw76a+3MKox7SkUx23q9xWMjMelOtgCIBqKl91hNPluRhuhOY7fyTqIOdzKbYLxcurRiWpF1+si8pSgqzZkXiT0VCV+B3Qnt9Z448Zi3Z3mY5oT+D/Vi3pjCgKNj8URs7argT5TOFnTid/oo9FASXv4/VFAdeoXlxPbAHT+lSbTx/3qqR1h79AVyOmsombtBIet4+1v5FgdS8MhdQgGleLdNrjFuBp//zvvOR/E9C6vT2q8PZLV9NiYnKMhP3BVQPtLzY0DTHsqqMAdPuB2nV7c33hzCZu35fvDfbQ++LQ5RxFA== 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=9eGLPo+gwK3BhKaizmVCd0S9rUlfgoSwrRoS3Fp+T4I=; b=gPx7p0jZc2buJUsB/CLwCV1g83OCjcW8KNjZBV63MkrmIVf1Xu4y6n3ih2ubqbnIGNiZMqga1VCxiVcTqz8IAT96z0BjwBeUqiL1HaNIn/mlv3W+0pXDr0PYgd+AMerl5dAwPYVCo/qj8nDi52MqpQte6kIjo5G3gqFQ+VTqxerdrCpvkFccpvaj27HDjLk6gS4ZUOolml8dprT/EIR+uspRfCrn2bix7ro3UqLo6WQXIR1tZE5mgDVanszi36WQqHhcSbwHeUGaAGWsJ9PJLHXvxEeGApCUBSes096x5/EuHeW3D4igvPokqpp4MehdHk0EKvxkw42up2ML4QTOlQ== 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=9eGLPo+gwK3BhKaizmVCd0S9rUlfgoSwrRoS3Fp+T4I=; b=m5ISxwiaV5sbgUZkoB6UlxSNDV+RMApA1rjW5ZXRjDtse7IejRoXJd3agkEtxw9tKUJc3fQYLBj4swLxKdcZMNXzSKuM7hM0BJwqIubB0qwOwVCOY7dix1UUEnlLqm2EnsD5rwKJwtYXD6kRcWmVV2Z7l2mmYhhoZfBTvQbkccTteiX7VX3nSounH16arU5bi3RWm6yBW+F5RqOJBk8jSIlVfo8MG/8GfdVYitp14w+/98AJAY4QewdfNWibLRfmtum85V1EgqPULVL4xHg5ovy4Awpb+pjx5+4GPzmlu0kIsiqYoVdVPIiFK+woRgbGJn6cFPvfR7gFQCloVZXPaw== 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 TY0PR06MB5626.apcprd06.prod.outlook.com (2603:1096:400:31f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Fri, 10 Mar 2023 06:07:51 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869%9]) with mapi id 15.20.6178.019; Fri, 10 Mar 2023 06:07:51 +0000 From: Yangtao Li To: tytso@mit.edu, adilger.kernel@dilger.ca Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk, Yangtao Li Subject: [PATCH] ext4: convert to DIV_ROUND_UP() in mpage_process_page_bufs() Date: Fri, 10 Mar 2023 14:07:34 +0800 Message-Id: <20230310060734.8780-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: SI1PR02CA0036.apcprd02.prod.outlook.com (2603:1096:4:1f6::20) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TY0PR06MB5626:EE_ X-MS-Office365-Filtering-Correlation-Id: 464afa8c-926a-4758-2ac8-08db212dc77a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7XiKwmYCuqzcQ0Oq28gGfyJmAbYvdZJNZaysfFJcMOoI2/I9Dv/i7UFO1HRSE2iBeNyWFzfHC+12p7ocDazumpcsW9MVxhTTpFl5TrQAv8ag+lIHAmmToxxlsbfKUESuEe6MZaC6XtHkctCbS0EAj3h2BDFor/bQHIvhgTwUrmPEC47NX0hEftuCWjO5hHMdmURvj4Vpxg7/ix3nemCF6vJ8UXrBQTgfGcaa2NVCzm6I9KJb4eRvvkEMkKRKQlsHZJ9bxdkz33Y0mA/wYLZB9PTbjfC/kcdvjUiXyoxeq1V3kXUjGWfd+gAb3dm/VXxu2ZmS87gQFFpL0OYL/MfNIIcKfry/zZnO/6iLVgMmQdBqs0DhdF3bSJ9TawCkIM8wM35H1+mEJmbN0rjTjO5sMTQgPLJ86ijOx6kQ6JRN1QJVVqgj8J2ue4djrNyErIKn5mVmoDE/Lx3qoWDi4MOguuy7iJoxwRiGqobPZh6my9SwLds8xfz6L0AMXCrBkB361rHtqKAcFgDu6LASrLk4jz037AMRtAEr7pwo2SPJyEiPv9Dgt01Bk1aWnZjEgdf/cjb7nKtr9AXSpjziwCwMxlIELiD+sCo9ytgqqCaD7oz2DasxnvX5ZQlHe9Avg+vlCZZ/I4C8WFLqQlvPajEIsukbUzSJkQIU+io6x9wBtD+YihZU/sO5mFBendZFeY4UxdwVVaZPCWHJH1P5fvtKGQ== 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:(13230025)(4636009)(376002)(39860400002)(346002)(366004)(136003)(396003)(451199018)(36756003)(83380400001)(38100700002)(38350700002)(316002)(478600001)(6486002)(2616005)(107886003)(6506007)(186003)(6512007)(1076003)(26005)(6666004)(5660300002)(4744005)(66556008)(52116002)(66476007)(8936002)(41300700001)(66946007)(4326008)(2906002)(86362001)(8676002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: c7eFvsk47V0yB1J+8pu77pTm/7FlPLrT5jlv7tDNeOSmKLUfjiXjgNcSPeXtuq2aDJQIIJ2Q90McgJeAMG3VUIcxczNYhg6KUndekADm3hj5Vz1b9XS37lVs7TJ2/KEM5YfyxN9MiRlHxLfJqPxjI3dKMFpQ5pKd/W73B3J+opDJsE6CajAGXzBLEGBdlSuBSuDqkvY0BtCr97ZSpYM9gA2HttnX+qX48NYMW8QhyZcJtdUPI/HshSkZyIK5gp+AukeQP2smnBxqLat7ZX6e3ikwRIE0ltnGekytk+doHdiQH09X/aOCCbB/bQrRD5nwb3Nka9EvA7Y5c33WxnZgZjZ8Qvzw5mSpeQQJAhJJ+E3gpAJ30XYEabMvyxI7z+S/R5LDwkufuseDazdQu6ANLgAJvD2mK/5GVqpYuXV8Z3dYosGwXGUCfBiQpY/hl15p7t6ROPV0QNU58WlFz/+xY/K2DP8FZ1Ve7v8iu16YvX4cwx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FBZ2EraapQqAx5bppmDlTLhrRMMQ0Or4aoQqiiEET X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 464afa8c-926a-4758-2ac8-08db212dc77a X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2023 06:07:50.9161 (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: 6Ezy5yvX3+Nws4iu/brKLoI1lHV2K1yRe9Sq53Jnrb/d5gmd+dlYrlpt3LFycGd8NcI8M7hXag1RiW7H9u4u4w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR06MB5626 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,URIBL_BLOCKED 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?1759960662191570471?= X-GMAIL-MSGID: =?utf-8?q?1759960662191570471?= Just for better readability, no code logic change. Signed-off-by: Yangtao Li --- fs/ext4/inode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index d251d705c276..d121cde74522 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2218,8 +2218,7 @@ static int mpage_process_page_bufs(struct mpage_da_data *mpd, { struct inode *inode = mpd->inode; int err; - ext4_lblk_t blocks = (i_size_read(inode) + i_blocksize(inode) - 1) - >> inode->i_blkbits; + ext4_lblk_t blocks = DIV_ROUND_UP(i_size_read(inode), i_blocksize(inode)); if (ext4_verity_in_progress(inode)) blocks = EXT_MAX_BLOCKS;