f2fs: initialize extent tree with on-disk extent info of inode

With normal extent info cache, we records largest extent mapping between logical
block and physical block into extent info, and we persist extent info in on-disk
inode.

When we enable extent tree cache, if extent info of on-disk inode is exist, and
the extent is not a small fragmented mapping extent. We'd better to load the
extent info into extent tree cache when inode is loaded. By this way we can have
more chance to hit extent tree cache rather than taking more time to read dnode
page for block address.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Chao Yu
2015-03-19 19:26:02 +08:00
committed by Jaegeuk Kim
parent 93dfc52656
commit 028a41e893
3 changed files with 45 additions and 3 deletions

View File

@@ -137,9 +137,7 @@ static int do_read_inode(struct inode *inode)
fi->i_pino = le32_to_cpu(ri->i_pino);
fi->i_dir_level = ri->i_dir_level;
write_lock(&fi->ext_lock);
get_extent_info(&fi->ext, ri->i_ext);
write_unlock(&fi->ext_lock);
f2fs_init_extent_cache(inode, &ri->i_ext);
get_inline_info(fi, ri);