On 2017/10/14 8:13, Weichao Guo wrote:
> Let's skip entire non-exist area to speed up truncate_hole by
> using get_next_page_offset.
> 
> Signed-off-by: Weichao Guo <[email protected]>

Reviewed-by: Chao Yu <[email protected]>

Thanks,

> ---
>  fs/f2fs/file.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index 517e112..819c29a 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -844,7 +844,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;
> 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to