summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorWeichao Guo <guoweichao@huawei.com>2017-10-14 08:13:32 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2017-10-26 10:44:16 +0200
commit48ab25f486a3f730db825758b9728fffdf237574 (patch)
tree37f39f117b9e1e5a3e745ebfa211ec14f948d24a /fs
parent5b4267d195dd887c4412e34b5a7365baa741b679 (diff)
f2fs: skip searching non-exist range in truncate_hole
Let's skip entire non-exist area to speed up truncate_hole by using get_next_page_offset. Signed-off-by: Weichao Guo <guoweichao@huawei.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 8fe95f8b16b1..56232a72d2a3 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -857,7 +857,7 @@ int truncate_hole(struct inode *inode, pgoff_t pg_start, pgoff_t pg_end)
err = get_dnode_of_data(&dn, pg_start, LOOKUP_NODE);
if (err) {
if (err == -ENOENT) {
- pg_start++;
+ pg_start = get_next_page_offset(&dn, pg_start);
continue;
}
return err;