mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-26 12:30:23 +09:00
FROMGIT: 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.
Bug: 301585673
Bug: 296299682
Fixes: f43b021e14 ("FROMGIT: f2fs: preload extent_cache for POSIX_FADV_WILLNEED")
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit 3e729e50d01e6a336132d1739866a6463f82faa9
https://git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev)
Change-Id: I11702b172270b143209407d06aa0338f19f19b43
This commit is contained in:
@@ -4768,7 +4768,8 @@ 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) {
|
||||
} else if (advice == POSIX_FADV_WILLNEED && offset == 0) {
|
||||
/* Load extent cache at the first readahead. */
|
||||
f2fs_precache_extents(inode);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user