[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <63bb967d-5464-4d6b-9daa-7059608bfba2@kernel.org>
Date: Wed, 22 Jan 2025 15:59:55 +0800
From: Chao Yu <chao@...nel.org>
To: Yi Sun <yi.sun@...soc.com>, jaegeuk@...nel.org
Cc: chao@...nel.org, Ke.Wang@...soc.com, linux-kernel@...r.kernel.org,
linux-f2fs-devel@...ts.sourceforge.net, Hao_hao.Wang@...soc.com,
niuzhiguo84@...il.com, zhiguo.niu@...soc.com
Subject: Re: [PATCH] f2fs: Clean up the loop outside of
f2fs_invalidate_blocks()
On 1/13/25 09:47, Yi Sun wrote:
> Now f2fs_invalidate_blocks() supports a continuous range of addresses,
> so the for loop can be omitted.
>
> Signed-off-by: Yi Sun <yi.sun@...soc.com>
> Signed-off-by: Zhiguo Niu <zhiguo.niu@...soc.com>
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 <chao@...nel.org>
Thanks,
> ---
> fs/f2fs/file.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index 9980d17ef9f5..4baafad7a00c 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -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);
Powered by blists - more mailing lists