diff options
author | Chao Yu <yuchao0@huawei.com> | 2018-01-10 18:18:52 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-01-22 14:56:46 -0800 |
commit | f3d98e74fcddb23dba00a88145272fc8223baaee (patch) | |
tree | 24589242c5fd6510883f0a090ea9f253ddce9f7c /fs/f2fs/data.c | |
parent | c4020b2da4c9e84d63e30ce5a85dc287507f0e60 (diff) | |
download | lwn-f3d98e74fcddb23dba00a88145272fc8223baaee.tar.gz lwn-f3d98e74fcddb23dba00a88145272fc8223baaee.zip |
f2fs: speed up defragment on sparse file
We have supported to get next page offset with valid mapping crossing
hole in f2fs_map_blocks, utilizing it to speed up defragment on sparse
file.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r-- | fs/f2fs/data.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 28a3328f1617..81fd4823a071 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1017,8 +1017,12 @@ next_block: *map->m_next_pgofs = pgofs + 1; goto sync_out; } - if (flag != F2FS_GET_BLOCK_FIEMAP) + if (flag != F2FS_GET_BLOCK_FIEMAP) { + /* for defragment case */ + if (map->m_next_pgofs) + *map->m_next_pgofs = pgofs + 1; goto sync_out; + } } } |