public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] fs/ntfs3: use wrapper i_blocksize() in ntfs_zero_range()
@ 2023-03-10  3:08 Yangtao Li
  2023-03-10  3:08 ` [PATCH 2/3] udf: use wrapper i_blocksize() in udf_discard_prealloc() Yangtao Li
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Yangtao Li @ 2023-03-10  3:08 UTC (permalink / raw)
  To: almaz.alexandrovich, jack, dushistov, brauner, ntfs3
  Cc: linux-kernel, Yangtao Li

Convert to use i_blocksize() for readability.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-05-08 12:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-10  3:08 [PATCH 1/3] fs/ntfs3: use wrapper i_blocksize() in ntfs_zero_range() Yangtao Li
2023-03-10  3:08 ` [PATCH 2/3] udf: use wrapper i_blocksize() in udf_discard_prealloc() Yangtao Li
2023-03-13 10:17   ` Jan Kara
2023-03-10  3:08 ` [PATCH 3/3] ufs: use wrapper i_blocksize() in ufs_get_locked_page() Yangtao Li
2023-03-10 13:18 ` [PATCH 1/3] fs/ntfs3: use wrapper i_blocksize() in ntfs_zero_range() kernel test robot
2023-03-10 14:30 ` kernel test robot
2023-05-08 12:52 ` Konstantin Komarov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox