Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0c33cb26 authored by Weichao Guo's avatar Weichao Guo Committed by Jaegeuk Kim
Browse files

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: default avatarWeichao Guo <guoweichao@huawei.com>
Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 1aead705
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -839,7 +839,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;