f2fs: Clean up the loop outside of f2fs_invalidate_blocks()
PATCH 1/1 f2fs: Clean up the loop outside of f2fs_invalidate_blocks()
Now f2fs_invalidate_blocks() supports a continuous range of addresses, so the for loop can be omitted.
Signed-off-by Yi Sun <[email protected]>
Signed-off-by Zhiguo Niu <[email protected]>
--- fs/f2fs/file.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
fs/f2fs/file.c +1 -3
@@ -811,10 +811,8 @@ int f2fs_do_truncate_blocks(struct inode *inode, u64 from, bool lock)if (IS_DEVICE_ALIASING (inode)) {struct extent_tree *et =F2FS_I (inode)->extent_tree[EX_READ ];struct extent_info ei = et->largest; -unsigned int i; -for (i =0 ; i < ei.len; i++) -f2fs_invalidate_blocks (sbi, ei.blk + i,1 ); +f2fs_invalidate_blocks (sbi, ei.blk, ei.len);dec_valid_block_count (sbi, inode, ei.len);f2fs_update_time (sbi,REQ_TIME );
Signature · 8 lines
2.25.1 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Quoted 5 lines · Yi Sun
Now
f2fs_invalidate_blocks()supports a continuous range of addresses, so the for loop can be omitted.Signed-off-by Yi Sun <[email protected]>Signed-off-by Zhiguo Niu <[email protected]>
Actually, this can be merged into "f2fs: add parameter @len to f2fs_invalidate_blocks()", but, anyway, I guess it's fine to merge it separately.
Reviewed-by Chao Yu <[email protected]>
Thanks,
Quoted 20 lines
--- fs/f2fs/file.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)fs/f2fs/file.c +1
-3@@ -811,10 +811,8 @@ int f2fs_do_truncate_blocks(struct inode *inode, u64 from, bool lock)if (IS_DEVICE_ALIASING (inode)) {struct extent_tree *et =F2FS_I (inode)->extent_tree[EX_READ ];struct extent_info ei = et->largest; -unsigned int i; -for (i =0 ; i < ei.len; i++) -f2fs_invalidate_blocks (sbi, ei.blk + i,1 ); +f2fs_invalidate_blocks (sbi, ei.blk, ei.len);dec_valid_block_count (sbi, inode, ei.len);f2fs_update_time (sbi,REQ_TIME );
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 8 lines · On Mon, 13 Jan 2025 09:47:02 +0800 you wrote:
Now
f2fs_invalidate_blocks()supports a continuous range of addresses, so the for loop can be omitted.Signed-off-by Yi Sun <[email protected]>Signed-off-by Zhiguo Niu <[email protected]>--- fs/f2fs/file.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
Here is the summary with links:
- [f2fs-dev] f2fs: Clean up the loop outside of f2fs_invalidate_blocks()
https://git.kernel.org/jaegeuk/f2fs/c/6d4008dc4a8e
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html