Commit 6d4008dc authored by Yi Sun's avatar Yi Sun Committed by Jaegeuk Kim
Browse files

f2fs: Clean up the loop outside of f2fs_invalidate_blocks()



Now f2fs_invalidate_blocks() supports a continuous range of addresses,
so the for loop can be omitted.

Signed-off-by: default avatarYi Sun <yi.sun@unisoc.com>
Signed-off-by: default avatarZhiguo Niu <zhiguo.niu@unisoc.com>
Reviewed-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent f6370a36
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -768,10 +768,8 @@ int f2fs_do_truncate_blocks(struct inode *inode, u64 from, bool lock)
	if (IS_DEVICE_ALIASING(inode)) {
		struct extent_tree *et = F2FS_I(inode)->extent_tree[EX_READ];
		struct extent_info ei = et->largest;
		unsigned int i;

		for (i = 0; i < ei.len; i++)
			f2fs_invalidate_blocks(sbi, ei.blk + i, 1);
		f2fs_invalidate_blocks(sbi, ei.blk, ei.len);

		dec_valid_block_count(sbi, inode, ei.len);
		f2fs_update_time(sbi, REQ_TIME);