Re: [PATCH 1/3] fs/ntfs3: use wrapper i_blocksize() in ntfs_zero_range()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10.03.2023 07:08, Yangtao Li wrote:
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,
Thank you for the patch. We have partially accepted it due to performance concerns.




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux