From: Weichao Guo Date: Sat, 14 Oct 2017 00:13:32 +0000 (+0800) Subject: f2fs: skip searching non-exist range in truncate_hole X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=76e8f60644aa7ea4f08d53f90f27ec4bbc5efdb0;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index e436f88eaff5..2a414561eb4a 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;