Re: [PATCH 2/7] btrfs: Remove isize local variable in compress_file_range

Anand Jain
2019-01-05T06:27:13Z

On 01/03/2019 04:50 PM, Nikolay Borisov wrote:
> It's used only once so just inline the call to i_size_read.
>
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>

Reviewed-by: Anand Jain <anand.jain@oracle.com>

> ---
> fs/btrfs/inode.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index 43baca50fba5..97ad494d0b3c 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -453,7 +453,6 @@ static noinline void compress_file_range(struct inode *inode,
> struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
> u64 blocksize = fs_info->sectorsize;
> u64 actual_end;
> - u64 isize = i_size_read(inode);
> int ret = 0;
> struct page **pages = NULL;
> unsigned long nr_pages;
> @@ -467,7 +466,7 @@ static noinline void compress_file_range(struct inode *inode,
> inode_should_defrag(BTRFS_I(inode), start, end, end - start + 1,
> SZ_16K);
>
> - actual_end = min_t(u64, isize, end + 1);
> + actual_end = min_t(u64, i_size_read(inode), end + 1);
> again:
> will_compress = 0;
> nr_pages = (end >> PAGE_SHIFT) - (start >> PAGE_SHIFT) + 1;
>