Skip to content

Commit

Permalink
f2fs: remove useless truncate in f2fs_collapse_range()
Browse files Browse the repository at this point in the history
Since offset < new_size, no need to do truncate_pagecache() again
with new_size.

Signed-off-by: Wei Fang <fangwei1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
  • Loading branch information
Wei Fang authored and Jaegeuk Kim committed Jun 18, 2020
1 parent 742532d commit 6f64892
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions fs/f2fs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1373,8 +1373,6 @@ static int f2fs_collapse_range(struct inode *inode, loff_t offset, loff_t len)
truncate_pagecache(inode, offset);

new_size = i_size_read(inode) - len;
truncate_pagecache(inode, new_size);

ret = f2fs_truncate_blocks(inode, new_size, true);
up_write(&F2FS_I(inode)->i_mmap_sem);
if (!ret)
Expand Down

0 comments on commit 6f64892

Please sign in to comment.