f2fs: skip searching non-exist range in truncate_hole
PATCH 1/1 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 <[email protected]>
--- fs/f2fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/file.c +1 -1
@@ -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;
Signature · 6 lines
2.10.1 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Quoted 4 lines · Weichao Guo
Let's skip entire non-exist area to speed up
truncate_holeby usingget_next_page_offset.Signed-off-by Weichao Guo <[email protected]>
Reviewed-by Chao Yu <[email protected]>
Thanks,
Quoted 10 lines
--- fs/f2fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/f2fs/file.c +0
-0
fs/f2fs/file.c int truncate_hole(struct inode *inode, pgoff_t pg_start, pgoff_t pg_end) · line 850
Quoted 8 lines
fs/f2fs/file.c +1
-1@@ -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