Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp953962rda; Sun, 22 Oct 2023 18:36:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE1xBxV3tWPxuxaxdIJXQcU+RrP8tD8u1rjwObnfCbTnHCfSTzySTXXX/3/FJf4U4JAedGk X-Received: by 2002:a05:6358:ee45:b0:168:d346:9ee3 with SMTP id ik5-20020a056358ee4500b00168d3469ee3mr4589901rwb.24.1698024972003; Sun, 22 Oct 2023 18:36:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698024971; cv=none; d=google.com; s=arc-20160816; b=kwXAtLy0or5czchuHa+KcsjcH/TofR51ZlrkIcvTJXRnGo54dxX/FqxPRy+fxtdryi nvO9DpQBskglpBAxt+RzbKvzqSY5G4qMuKqelrPL0EUMqA6/23BPmBZByoPKP9XSZMq3 oK4GSzJgpjztCvbCUDrHS2WM234YKvFgx/xVk1+CelK6Y9evXWw+LfuB60RvmkU797rP gJJm0tW0i7xWIldE7xK5RW1y8pKqBVITBmLiSxPg4ZRAW3Yyn1svtYXRG92vXe2RPlQ3 IAsmsRQYAoltE60xYsFLF94E5MTATZR7z12uxukAeqpnvJfYJkwQmag2fUk3+WOhKaYt eqJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=9FIrsk0WK2AZC3gbfHS5xXzhKK8hqixfeGRZlp6t7ek=; fh=PVlPIDvRkKyupKEabKxUhelk/jHgf04HJKctIsQHo4g=; b=lDicjlX184rB/sYkvfQBBO0hrvJtaDEezPqgzCeNHBgaIIapyN4wLmKdWYLHmEtHDs qKoGUlxqrf89LwbfLJqQPB8wg7P2QkVQm/gjnbHnnF7FxFF8Z6OHWMXkJGDbICzAMSMp kVUNjjFmkB72ue6C1mb2RK7O8w88swt1GBuTHcRcqNnpzmMVJrFVVj3FuoRfrTI6CUvd rnDVK/K0DhriU2dlQ41TeTNwcg1VHhALCyp8W9iVgoMDLbX4nrPCYlBI5K2A6Ev6nD7T Uhf3i+lwguk6tXmBoLHEUumaH2wC1FYBADGtsHv2/aDNUH1mJ/naP2Az9ODovi0cCKw0 262w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id h66-20020a636c45000000b00578e98dec9dsi5441585pgc.160.2023.10.22.18.36.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 18:36:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 7C1AF808A370; Sun, 22 Oct 2023 18:36:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233027AbjJWBgH (ORCPT + 99 others); Sun, 22 Oct 2023 21:36:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232989AbjJWBgG (ORCPT ); Sun, 22 Oct 2023 21:36:06 -0400 Received: from smtpbg151.qq.com (smtpbg151.qq.com [18.169.211.239]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47880F1; Sun, 22 Oct 2023 18:36:01 -0700 (PDT) X-QQ-mid: bizesmtp83t1698024860tdnh26oy Received: from localhost.localdomain ( [125.76.217.162]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 23 Oct 2023 09:34:19 +0800 (CST) X-QQ-SSF: 01400000000000D0H000000A0000000 X-QQ-FEAT: 96k0+YG2NiUyz1G0D/IM+BKNUxvNFZDTYAB4ZDvOBD+DXNXWXPuQtJWLIipjA AqxLFpw5Chk8czVf7bbrJ353Dx55otbHAEY2cKNF9LqaUDFs6Efs0k/nmnf9FVPEFjHPDrU NadIZFzEqm03ijmBlbxR4fS+9WUTxSoKRppW4vwgTRc7kmwnzmYKfnY3zUXTGEPLNAn7KN6 GynZ9sKI+CLu4z05rjSp9Muzyy4JG6Q9+GR0vjElLCB++f7v/ug65JefVE1sGu3LYze+7f6 izjEbJoZkqSCo8JQDPfzC3ilcvhCoO4RKal37dJ9y5iYjfNq5gqsXv/2SP9LWixumq/HfBc /ZkNY32XmtFWZnseebVbk58xI1WTDXUZwrUEwwTc6ldstQmbOK1qwRIKwbLAvfim+goXgn3 va21GN1LiZI= X-QQ-GoodBg: 1 X-BIZMAIL-ID: 7138792497209401315 From: Gou Hao To: tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.cz, linux-ext4@vger.kernel.org Cc: linux-kernel@vger.kernel.org, gouhaojake@163.com Subject: [PATCH] ext4: delete redundant calculations in ext4_mb_get_buddy_page_lock() Date: Mon, 23 Oct 2023 09:34:16 +0800 Message-Id: <20231023013416.17246-1-gouhao@uniontech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybglogicsvrgz:qybglogicsvrgz7a-0 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sun, 22 Oct 2023 18:36:08 -0700 (PDT) 'blocks_per_page' is always 1 after 'if (blocks_per_page >= 2)', 'pnum' and 'block' is equal in this case. Signed-off-by: Gou Hao Signed-off-by: Gou Hao --- fs/ext4/mballoc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 454d5612641e..8442f5474b25 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -1456,9 +1456,7 @@ static int ext4_mb_get_buddy_page_lock(struct super_block *sb, return 0; } - block++; - pnum = block / blocks_per_page; - page = find_or_create_page(inode->i_mapping, pnum, gfp); + page = find_or_create_page(inode->i_mapping, ++block, gfp); if (!page) return -ENOMEM; BUG_ON(page->mapping != inode->i_mapping); -- 2.34.1