Skip to contentSkip to conversation

f2fs: let f2fs_precache_extents() traverses in file range

PATCH Applied Chao Yu 2 participants 2 messages Oct 10, 2023 – Oct 23, 2023 F2FS file system

lore
Share & tools
lore

Chao Yu

author maintainer
#0 lore raw

PATCH 1/1 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.

---
 fs/f2fs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/file.c +1 -1
index 06d35b8aceef..304d0516d3a4 100644
@@ -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;
Signature · 1 line
2.40.1
#1 lore raw
This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <[email protected]>:

Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <[email protected]>:

Quoted 7 lines · On Tue, 10 Oct 2023 09:34:59 +0800 you wrote:

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.

---
 fs/f2fs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
- [f2fs-dev] f2fs: let f2fs_precache_extents() traverses in file range

    https://git.kernel.org/jaegeuk/f2fs/c/6f560c0f2aa0

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html