]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: stop checking for NULL return from btrfs_get_extent()
authorFilipe Manana <fdmanana@suse.com>
Thu, 3 Feb 2022 15:36:42 +0000 (15:36 +0000)
committerDavid Sterba <dsterba@suse.com>
Mon, 14 Mar 2022 12:13:50 +0000 (13:13 +0100)
commit050a1600a27bfe89b7702e0630a5e02b31cd23a5
tree23999c6365332a4e739ce2be908a4cab38eb645d
parent5e6efef3820e1e533bbaedcea8b1b1d0314e0ed8
btrfs: stop checking for NULL return from btrfs_get_extent()

At extent_io.c, in the read page and write page code paths, we are testing
if the return value from btrfs_get_extent() can be NULL. However that is
not possible, as btrfs_get_extent() always returns either an error pointer
or a (non-NULL) pointer to an extent map structure.

Everywhere else outside extent_io.c we never check for NULL, we always
treat any returned value as a non-NULL pointer if it does not encode an
error.

So check only for the IS_ERR() case at extent_io.c.

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