[PATCH 1/3] fs/ntfs3: use wrapper i_blocksize() in ntfs_zero_range()
From: Yangtao Li
Date: Thu Mar 09 2023 - 22:08:49 EST
Convert to use i_blocksize() for readability.
Signed-off-by: Yangtao Li <frank.li@xxxxxxxx>
---
fs/ntfs3/file.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c
index e9bdc1ff08c9..9d6ff29de441 100644
--- a/fs/ntfs3/file.c
+++ b/fs/ntfs3/file.c
@@ -178,7 +178,7 @@ static int ntfs_zero_range(struct inode *inode, u64 vbo, u64 vbo_to)
{
int err = 0;
struct address_space *mapping = inode->i_mapping;
- u32 blocksize = 1 << inode->i_blkbits;
+ u32 blocksize = i_blocksize(inode);
pgoff_t idx = vbo >> PAGE_SHIFT;
u32 from = vbo & (PAGE_SIZE - 1);
pgoff_t idx_end = (vbo_to + PAGE_SIZE - 1) >> PAGE_SHIFT;
@@ -192,7 +192,7 @@ static int ntfs_zero_range(struct inode *inode, u64 vbo, u64 vbo_to)
page_off = (loff_t)idx << PAGE_SHIFT;
to = (page_off + PAGE_SIZE) > vbo_to ? (vbo_to - page_off)
: PAGE_SIZE;
- iblock = page_off >> inode->i_blkbits;
+ iblock = page_off / i_blocksize(inode);
page = find_or_create_page(mapping, idx,
mapping_gfp_constraint(mapping,
--
2.25.1