Skip to content

Commit 62b3762

Browse files
lorddoskiaskdave
authored andcommitted
btrfs: Remove isize local variable in compress_file_range
It's used only once so just inline the call to i_size_read. The semantics regarding the inode size are not changed, the pages in the range are locked and i_size cannot change between the time it was set and used. Reviewed-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 532425f commit 62b3762

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fs/btrfs/inode.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,6 @@ static noinline void compress_file_range(struct inode *inode,
453453
struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
454454
u64 blocksize = fs_info->sectorsize;
455455
u64 actual_end;
456-
u64 isize = i_size_read(inode);
457456
int ret = 0;
458457
struct page **pages = NULL;
459458
unsigned long nr_pages;
@@ -467,7 +466,7 @@ static noinline void compress_file_range(struct inode *inode,
467466
inode_should_defrag(BTRFS_I(inode), start, end, end - start + 1,
468467
SZ_16K);
469468

470-
actual_end = min_t(u64, isize, end + 1);
469+
actual_end = min_t(u64, i_size_read(inode), end + 1);
471470
again:
472471
will_compress = 0;
473472
nr_pages = (end >> PAGE_SHIFT) - (start >> PAGE_SHIFT) + 1;

0 commit comments

Comments
 (0)