Skip to content

Commit 3e729e5

Browse files
author
Jaegeuk Kim
committed
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: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent f5f3bd9 commit 3e729e5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/f2fs/file.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4858,6 +4858,9 @@ static int f2fs_file_fadvise(struct file *filp, loff_t offset, loff_t len,
48584858
filp->f_mode &= ~FMODE_RANDOM;
48594859
spin_unlock(&filp->f_lock);
48604860
return 0;
4861+
} else if (advice == POSIX_FADV_WILLNEED && offset == 0) {
4862+
/* Load extent cache at the first readahead. */
4863+
f2fs_precache_extents(inode);
48614864
}
48624865

48634866
err = generic_fadvise(filp, offset, len, advice);

0 commit comments

Comments
 (0)