Message ID | 20230725185106.2147273-5-shikemeng@huaweicloud.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp2384011vqg; Tue, 25 Jul 2023 03:57:00 -0700 (PDT) X-Google-Smtp-Source: APBJJlFEiSFHOtrkCFAFSdr2akCxCPC8l1+/mj2K6mLU4wyK+wdPz/IX8KykmMuLl3j7RYn8D6As X-Received: by 2002:a17:902:bf02:b0:1b8:5bcc:2ffc with SMTP id bi2-20020a170902bf0200b001b85bcc2ffcmr8702234plb.45.1690282619802; Tue, 25 Jul 2023 03:56:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690282619; cv=none; d=google.com; s=arc-20160816; b=LrqNOiBLXR98K5IDk7cIvHXcWtIHl4kYomyPTKcG5nWdlkEqRvt90gyT4RTgKDV9D9 MRpFevZOi9VCO4twW4SRQtgQX4IF757xc5eN70tMe6LbhCsFf44TsbYqQ9jWAwKELQnm WqiJlLOzt2KbYD3Fcz/pOkjTSn93DREMXW3lPOC3dhfKyRRodX2OWkrab37UNq4z9ei4 0nNmaSH2x2VguL9qOVIx0/uMMQOJ/PjgPwwRYcjSyzcgOjeRygE5xUot85CpPH65X4a7 iQKHlXShFhBfPBzvO0mGfGAlAc1YRWSxx28cHCoBbBDzdGNfvwEVGkM5O4NgXfXc4Pg7 DTLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Zb9pgs02/Hm6BtTjnxI9jKsqvGAHUjZLJZqrdH4dbBY=; fh=MlGqaUnvBjpXmiP990bdf+mzv9VjPrVaE5OVdv29XYE=; b=FSr+P+umSE+895U1ZNijU8sQcxY3iudhTBIJAbVQLv999G7EkqgBn5Bt8wBigK2Qn+ +k/OALUCCUdB4o0TKgGnx9+N5DyPyRAbjqqxZFzK0xFq7ujSmi7hwV0RHs3R7oB3xZtt v6LIJeeyEVZDzGh+EBJ0yobfmVEsjyOQo3uYo7V2j4KR1cntu7PnBJ+Us/0818JTnAY6 AWWGP7wSeuon0fvTXbxvvrZ8TwBGdDzOotMSPnM/L4tUzkO054MYdMDxM7URe6wgS2Ac Tvq15sYZu9OqUkVcjEZgyX7Hai+FYU6N4h0cQcKROLlRhFXjPxR4+mMAIiNlGGS0N9e5 OUFQ== ARC-Authentication-Results: i=1; mx.google.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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id li11-20020a170903294b00b001bb35920640si10723634plb.351.2023.07.25.03.56.43; Tue, 25 Jul 2023 03:56:59 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232137AbjGYKwB (ORCPT <rfc822;kloczko.tomasz@gmail.com> + 99 others); Tue, 25 Jul 2023 06:52:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233793AbjGYKvM (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 25 Jul 2023 06:51:12 -0400 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 360AC2724; Tue, 25 Jul 2023 03:50:45 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4R9DMh6Z7Rz4f4VkW; Tue, 25 Jul 2023 18:50:40 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP2 (Coremail) with SMTP id Syh0CgC3quj+qL9kl7XQOg--.17520S6; Tue, 25 Jul 2023 18:50:41 +0800 (CST) From: Kemeng Shi <shikemeng@huaweicloud.com> To: tytso@mit.edu, adilger.kernel@dilger.ca, ritesh.list@gmail.com, ojaswin@linux.ibm.com, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Cc: shikemeng@huaweicloud.com Subject: [PATCH v2 04/10] ext4: use is_power_of_2 helper in ext4_mb_regular_allocator Date: Wed, 26 Jul 2023 02:51:00 +0800 Message-Id: <20230725185106.2147273-5-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230725185106.2147273-1-shikemeng@huaweicloud.com> References: <20230725185106.2147273-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: Syh0CgC3quj+qL9kl7XQOg--.17520S6 X-Coremail-Antispam: 1UD129KBjvdXoW7GF1rJr1UurW8GF4xAw1kXwb_yoWfXFX_Ga 4jkr48JFWfJr1xC3ZYyayrKr9YqFn5AF45XFs3JrsxXF1UZa97Kw1qyrs3Zr48Gr47ArZx WasxGFy0ya9a9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbDkFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M28IrcIa0xkI8V A2jI8067AKxVWUAVCq3wA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJ M28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWDJVCq3wA2z4x0Y4vE2I x0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK 6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4 xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8 JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20V AGYxC7MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAF wI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc4 0Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AK xVW8JVWxJwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr 1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7sRiVbyDUU UUU== X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, KHOP_HELO_FCRDNS,MAY_BE_FORGED,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772389788217117304 X-GMAIL-MSGID: 1772389788217117304 |
Series |
A few fixes and cleanups to mballoc
|
|
Commit Message
Kemeng Shi
July 25, 2023, 6:51 p.m. UTC
Use intuitive is_power_of_2 helper in ext4_mb_regular_allocator. Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> --- fs/ext4/mballoc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index bf309c4d686e..35c6224d453c 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -2794,10 +2794,7 @@ ext4_mb_regular_allocator(struct ext4_allocation_context *ac) * requests upto maximum buddy size we have constructed. */ if (i >= sbi->s_mb_order2_reqs && i <= MB_NUM_ORDERS(sb)) { - /* - * This should tell if fe_len is exactly power of 2 - */ - if ((ac->ac_g_ex.fe_len & (~(1 << (i - 1)))) == 0) + if (is_power_of_2(ac->ac_g_ex.fe_len)) ac->ac_2order = array_index_nospec(i - 1, MB_NUM_ORDERS(sb)); }