[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251025032221.2905818-21-libaokun@huaweicloud.com>
Date: Sat, 25 Oct 2025 11:22:16 +0800
From: libaokun@...weicloud.com
To: linux-ext4@...r.kernel.org
Cc: tytso@....edu,
adilger.kernel@...ger.ca,
jack@...e.cz,
linux-kernel@...r.kernel.org,
kernel@...kajraghav.com,
mcgrof@...nel.org,
linux-fsdevel@...r.kernel.org,
linux-mm@...ck.org,
yi.zhang@...wei.com,
yangerkun@...wei.com,
chengzhihao1@...wei.com,
libaokun1@...wei.com,
libaokun@...weicloud.com
Subject: [PATCH 20/25] ext4: support large block size in __ext4_block_zero_page_range()
From: Zhihao Cheng <chengzhihao1@...wei.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@...wei.com>
Signed-off-by: Baokun Li <libaokun1@...wei.com>
Reviewed-by: Zhang Yi <yi.zhang@...wei.com>
---
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
Powered by blists - more mailing lists