Commit 3e729e50 authored by Jaegeuk Kim's avatar Jaegeuk Kim

f2fs: preload extent_cache for POSIX_FADV_WILLNEED

This patch tries to preload extent_cache given POSIX_FADV_WILLNEED, which is
more useful for generic usecases.
Reviewed-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent f5f3bd90
......@@ -4858,6 +4858,9 @@ static int f2fs_file_fadvise(struct file *filp, loff_t offset, loff_t len,
filp->f_mode &= ~FMODE_RANDOM;
spin_unlock(&filp->f_lock);
return 0;
} else if (advice == POSIX_FADV_WILLNEED && offset == 0) {
/* Load extent cache at the first readahead. */
f2fs_precache_extents(inode);
}
err = generic_fadvise(filp, offset, len, advice);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment