diff options
author | Chao Yu <chao@kernel.org> | 2023-10-10 04:34:59 +0300 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2023-10-12 03:31:38 +0300 |
commit | 6f560c0f2aa00a3627c748aa0b194b81e99db5d7 (patch) | |
tree | c0ca22f3de49666a484855600ad139c0dbca6b53 /fs/f2fs | |
parent | e0d4e8acb3789c5a8651061fbab62ca24a45c063 (diff) | |
download | linux-6f560c0f2aa00a3627c748aa0b194b81e99db5d7.tar.xz |
f2fs: let f2fs_precache_extents() traverses in file range
Rather than in range of [0, max_file_blocks()), since data after EOF
is alwasy zero, it's unnecessary to preload mapping info of the data.
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-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 06d35b8aceef..304d0516d3a4 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -3263,7 +3263,7 @@ int f2fs_precache_extents(struct inode *inode) map.m_next_extent = &m_next_extent; map.m_seg_type = NO_CHECK_TYPE; map.m_may_create = false; - end = max_file_blocks(inode); + end = F2FS_BLK_ALIGN(i_size_read(inode)); while (map.m_lblk < end) { map.m_len = end - map.m_lblk; |