| Message ID | 20251025032221.2905818-21-libaokun@huaweicloud.com |
|---|---|
| State | Superseded |
| Headers | show
Return-Path: <SRS0=Ql3p=5C=vger.kernel.org=linux-ext4+bounces-11069-patchwork-incoming=ozlabs.org@ozlabs.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org (client-ip=2404:9400:2221:ea00::3; helo=mail.ozlabs.org; envelope-from=srs0=ql3p=5c=vger.kernel.org=linux-ext4+bounces-11069-patchwork-incoming=ozlabs.org@ozlabs.org; receiver=patchwork.ozlabs.org) Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4ctlj946P0z1yJP for <incoming@patchwork.ozlabs.org>; Sat, 25 Oct 2025 14:33:17 +1100 (AEDT) Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4ctlj93gFXz4wC9 for <incoming@patchwork.ozlabs.org>; Sat, 25 Oct 2025 14:33:17 +1100 (AEDT) Received: by gandalf.ozlabs.org (Postfix) id 4ctlj93cltz4wM1; Sat, 25 Oct 2025 14:33:17 +1100 (AEDT) Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: gandalf.ozlabs.org; arc=pass smtp.remote-ip=142.0.200.124 arc.chain=subspace.kernel.org ARC-Seal: i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1761363197; cv=pass; b=FvlwdmqjiwzXwsh7Y7vD1clea7ocTgJTCwMBO65aRlIUeK0+0jMx6EQg5uEVqqp0mvtDkEQxRjG7eIA00ZlVD+ihTlfKOvX5w2uUxXngZdrBnFMTv53OvuQq0iN1Hab3B1hbe96x4HN1vq9IaIKoYOh3W2NiUcigtyPaMvhf0+0quEAbszqOUEz3rDWdex+FMPtBSEBpgT5I4RYOF3HkgJ7+hSaCqsLEt9rCSBIGmMsD9nL6uUfGUi1YTbJiOOHgxOIfNbfnY4Rc6d5JKTZ4BN4L4cz4xYG6kUwm9NA3SV1jTsq2mLVq1xxzt2nROBSF6vVB1yTdTSCzRGMSixYZnA== ARC-Message-Signature: i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1761363197; c=relaxed/relaxed; bh=klaEamwkpXOWnnwIXtexma71LN4lErYciZH9udsA21k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cFoXLYtxPuPcE4gguYTMnT7SbxoTb0VO/Y2fUtzigYsgKnYs68Hyr+kt+8rXlYwWmO/hccKehealJO37iUdzf4jf68mh+/WgZ34SOecRscUCn32GfJ7/9BeWQvJe2qr29PrL5k84g/irnTMskKe6YTF/AW7Hp/xnTZUEEkGItws1V/4dix2BbZI6WfN1+nvfd+hL6o8tqSzWJ0WXx3K9RE46e2tfLwNR20doB16qQpHjUCQo5NjpB8qDFmjwSTfQIMs/qyISgoIhHxA/Kf29y+OmgQqqhAqebksKw3sgI+29U8yMOjSCTbhzQcPVuRyFBIfv/Qch1Zc0YHWpGd9obA== ARC-Authentication-Results: i=2; gandalf.ozlabs.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass (client-ip=142.0.200.124; helo=dfw.mirrors.kernel.org; envelope-from=linux-ext4+bounces-11069-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org Authentication-Results: gandalf.ozlabs.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: gandalf.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=142.0.200.124; helo=dfw.mirrors.kernel.org; envelope-from=linux-ext4+bounces-11069-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) Received: from dfw.mirrors.kernel.org (dfw.mirrors.kernel.org [142.0.200.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by gandalf.ozlabs.org (Postfix) with ESMTPS id 4ctlj60Zz4z4wC9 for <patchwork-incoming@ozlabs.org>; Sat, 25 Oct 2025 14:33:14 +1100 (AEDT) Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.mirrors.kernel.org (Postfix) with ESMTPS id 32C7E4E44A1 for <patchwork-incoming@ozlabs.org>; Sat, 25 Oct 2025 03:33:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E46EA2D94AC; Sat, 25 Oct 2025 03:30:14 +0000 (UTC) X-Original-To: linux-ext4@vger.kernel.org Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7561525B1DC; Sat, 25 Oct 2025 03:30:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761363013; cv=none; b=B5rVdHaRVmbzs6V8eu5RBgFAQwjZt1yhnWbyZa1JvKmv5+7U9lxYXkJ7qCEKXan8t1ytNRbuclLKgC4RbeM06jGopeiJUQNH+EMjioHJRuARths7rAoX7p7BEVKHAg6HIQmuwzwKXigot/7h7XjJ+NkRPmAAJ1NMGJzW3Xato4k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761363013; c=relaxed/simple; bh=jbnnx0yRBWSRQpu331QjQj5/2MkS7HOnnvLDzALKl9k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=EdyUiupDnvydf/X8sMDgVQLC32VZ6QSsMmiRq4oVv7HxWpr8jYPZ0bPmHhmVzL7Xl+oC3I557TrsS1fBPuuYBVt8gnoIVOwPAUJVrD/Zu8m/3cYa1RiKJLmtO4HRaXXoOQVTqcubhfdRJTATS6QTtVSZ+hx/LD/F4j6gIvpJjaA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.216]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTPS id 4ctlcL1mBNzYQtpV; Sat, 25 Oct 2025 11:29:06 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.75]) by mail.maildlp.com (Postfix) with ESMTP id DD1631A19E5; Sat, 25 Oct 2025 11:30:04 +0800 (CST) Received: from huaweicloud.com (unknown [10.50.87.129]) by APP2 (Coremail) with SMTP id Syh0CgBHnEQ6RPxox1YbBg--.45388S24; Sat, 25 Oct 2025 11:30:04 +0800 (CST) From: libaokun@huaweicloud.com To: linux-ext4@vger.kernel.org Cc: tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.cz, linux-kernel@vger.kernel.org, kernel@pankajraghav.com, mcgrof@kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, yi.zhang@huawei.com, yangerkun@huawei.com, chengzhihao1@huawei.com, libaokun1@huawei.com, libaokun@huaweicloud.com Subject: [PATCH 20/25] ext4: support large block size in __ext4_block_zero_page_range() Date: Sat, 25 Oct 2025 11:22:16 +0800 Message-Id: <20251025032221.2905818-21-libaokun@huaweicloud.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20251025032221.2905818-1-libaokun@huaweicloud.com> References: <20251025032221.2905818-1-libaokun@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: <linux-ext4.vger.kernel.org> List-Subscribe: <mailto:linux-ext4+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-ext4+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: Syh0CgBHnEQ6RPxox1YbBg--.45388S24 X-Coremail-Antispam: 1UD129KBjvdXoW7XFWxtrW7Gw47Cw4fKF1kAFb_yoWfWFgEkF W8Xr4rJanaqFnaya95Aan0q3Z2k3WrCr13ury3Jry5uFyDXFZ5Gw1DtrWYkr4qgF47WrW5 ArWkXFWYyF12gjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbmkFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI8067AKxVWUAVCq3wA2048vs2 IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28E F7xvwVC0I7IYx2IY67AKxVWDJVCq3wA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr 1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0D M2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjx v20xvE14v26r1Y6r17McIj6I8E87Iv67AKxVW8Jr0_Cr1UMcvjeVCFs4IE7xkEbVWUJVW8 JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lFIxGxcIEc7CjxVA2Y2 ka0xkIwI1lw4CEc2x0rVAKj4xxMxkF7I0En4kS14v26r1q6r43MxAIw28IcxkI7VAKI48J MxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwV AFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv2 0xvE14v26ryj6F1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UMIIF0xvE42xK8V AvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E 14v26r4UJVWxJrUvcSsGvfC2KfnxnUUI43ZEXa7VUbG-e7UUUUU== X-CM-SenderInfo: 5olet0hnxqqx5xdzvxpfor3voofrz/1tbiAQAMBWj7UbRJIAABsW X-Spam-Status: No, score=-1.0 required=5.0 tests=ARC_SIGNED,ARC_VALID, DMARC_MISSING,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=disabled version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org |
| Series |
ext4: enable block size larger than page size
|
expand
|
On Sat 25-10-25 11:22:16, libaokun@huaweicloud.com wrote: > From: Zhihao Cheng <chengzhihao1@huawei.com> > > Use the EXT4_P_TO_LBLK() macro to convert folio indexes to blocks to avoid > negative left shifts after supporting blocksize greater than PAGE_SIZE. > > Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com> > Signed-off-by: Baokun Li <libaokun1@huawei.com> > Reviewed-by: Zhang Yi <yi.zhang@huawei.com> Looks good. Feel free to add: Reviewed-by: Jan Kara <jack@suse.cz> Honza > --- > fs/ext4/inode.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c > index ce48cc6780a3..b3fa29923a1d 100644 > --- a/fs/ext4/inode.c > +++ b/fs/ext4/inode.c > @@ -4066,7 +4066,7 @@ static int __ext4_block_zero_page_range(handle_t *handle, > > blocksize = inode->i_sb->s_blocksize; > > - iblock = folio->index << (PAGE_SHIFT - inode->i_sb->s_blocksize_bits); > + iblock = EXT4_P_TO_LBLK(inode, folio->index); > > bh = folio_buffers(folio); > if (!bh) > -- > 2.46.1 >
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index ce48cc6780a3..b3fa29923a1d 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4066,7 +4066,7 @@ static int __ext4_block_zero_page_range(handle_t *handle, blocksize = inode->i_sb->s_blocksize; - iblock = folio->index << (PAGE_SHIFT - inode->i_sb->s_blocksize_bits); + iblock = EXT4_P_TO_LBLK(inode, folio->index); bh = folio_buffers(folio); if (!bh)