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, 28 Feb 2022 15:19:51 +0000 (16:19 +0100)
commit4cdd7aec054e45cffee5d55465ac8f494b69d3f5
tree9eefea81603196efd943f812be13084a3868e337
parentba5b6a18b80bb91e682a2f8ce31fe6eea4a1ec32
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