Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

f2fs: clean up with F2FS_BLK_ALIGN

Clean up F2FS_BYTES_TO_BLK(x + F2FS_BLKSIZE - 1) with F2FS_BLK_ALIGN(x).

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

authored by

Chao Yu and committed by
Jaegeuk Kim
df033caf 0833721e

+2 -4
+1 -2
fs/f2fs/file.c
··· 573 573 int truncate_blocks(struct inode *inode, u64 from, bool lock) 574 574 { 575 575 struct f2fs_sb_info *sbi = F2FS_I_SB(inode); 576 - unsigned int blocksize = inode->i_sb->s_blocksize; 577 576 struct dnode_of_data dn; 578 577 pgoff_t free_from; 579 578 int count = 0, err = 0; ··· 581 582 582 583 trace_f2fs_truncate_blocks_enter(inode, from); 583 584 584 - free_from = (pgoff_t)F2FS_BYTES_TO_BLK(from + blocksize - 1); 585 + free_from = (pgoff_t)F2FS_BLK_ALIGN(from); 585 586 586 587 if (free_from >= sbi->max_file_blocks) 587 588 goto free_partial;
+1 -2
fs/f2fs/node.c
··· 2581 2581 if (!enabled_nat_bits(sbi, NULL)) 2582 2582 return 0; 2583 2583 2584 - nm_i->nat_bits_blocks = F2FS_BYTES_TO_BLK((nat_bits_bytes << 1) + 8 + 2585 - F2FS_BLKSIZE - 1); 2584 + nm_i->nat_bits_blocks = F2FS_BLK_ALIGN((nat_bits_bytes << 1) + 8); 2586 2585 nm_i->nat_bits = f2fs_kzalloc(sbi, 2587 2586 nm_i->nat_bits_blocks << F2FS_BLKSIZE_BITS, GFP_KERNEL); 2588 2587 if (!nm_i->nat_bits)