Skip to content

Commit 6d4008d

Browse files
Yi SunJaegeuk Kim
authored andcommitted
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: Yi Sun <[email protected]> Signed-off-by: Zhiguo Niu <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent f6370a3 commit 6d4008d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fs/f2fs/file.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -768,10 +768,8 @@ int f2fs_do_truncate_blocks(struct inode *inode, u64 from, bool lock)
768768
if (IS_DEVICE_ALIASING(inode)) {
769769
struct extent_tree *et = F2FS_I(inode)->extent_tree[EX_READ];
770770
struct extent_info ei = et->largest;
771-
unsigned int i;
772771

773-
for (i = 0; i < ei.len; i++)
774-
f2fs_invalidate_blocks(sbi, ei.blk + i, 1);
772+
f2fs_invalidate_blocks(sbi, ei.blk, ei.len);
775773

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

0 commit comments

Comments
 (0)