diff options
author | Chao Yu <chao2.yu@samsung.com> | 2016-01-26 15:40:44 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-02-22 16:07:23 -0800 |
commit | 3cf4574705b4e1a1a0aeaae0332e8c2c8b56cc8f (patch) | |
tree | 1080b5e5735ded164cf46b4d1e73d44b26528de2 /fs/f2fs/file.c | |
parent | 81ca7350ce5ed438547ea769b0c33cb0abbd74ba (diff) | |
download | linux-3cf4574705b4e1a1a0aeaae0332e8c2c8b56cc8f.tar.bz2 |
f2fs: introduce get_next_page_offset to speed up SEEK_DATA
When seeking data in ->llseek, if we encounter a big hole which covers
several dnode pages, we will try to seek data from index of page which
is the first page of next dnode page, at most we could skip searching
(ADDRS_PER_BLOCK - 1) pages.
However it's still not efficient, because if our indirect/double-indirect
pointer are NULL, there are no dnode page locate in the tree indirect/
double-indirect pointer point to, it's not necessary to search the whole
region.
This patch introduces get_next_page_offset to calculate next page offset
based on current searching level and max searching level returned from
get_dnode_of_data, with this, we could skip searching the entire area
indirect or double-indirect node block is not exist.
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r-- | fs/f2fs/file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index e52af2d08864..8c51fc7d9396 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -358,7 +358,7 @@ static loff_t f2fs_seek_block(struct file *file, loff_t offset, int whence) } else if (err == -ENOENT) { /* direct node does not exists */ if (whence == SEEK_DATA) { - pgofs = PGOFS_OF_NEXT_DNODE(pgofs, inode); + pgofs = get_next_page_offset(&dn, pgofs); continue; } else { goto found; |