]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: avoid assigning twice to block_start at btrfs_do_readpage()
authorFilipe Manana <fdmanana@suse.com>
Wed, 5 Feb 2025 11:30:34 +0000 (11:30 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 18 Mar 2025 19:35:41 +0000 (20:35 +0100)
commit87d6aaf79bbeedda4af4c104fa02ff57fda54b12
treed56646f5ce39bebce9f7bbd75f8aa9b7e24adc24
parent968f19c5b1b7d5595423b0ac0020cc18dfed8cb5
btrfs: avoid assigning twice to block_start at btrfs_do_readpage()

At btrfs_do_readpage() if we get an extent map for a prealloc extent we
end up assigning twice to the 'block_start' variable, first the value
returned by extent_map_block_start() and then EXTENT_MAP_HOLE. This is
pointless so make it more clear by using an if-else statement and doing
only one assignment. Also, while at it, move the declaration of
'block_start' into the while loop's scope, since it's not used outside of
it and the related 'disk_bytenr' is also declared in this scope.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c