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 Feb 2022 15:36:03 +0000 (16:36 +0100)
commit30c37c77db3b187400660b6448d009eb45e4d136
tree557859e09c6fb1cb7c2f0f4bb0e78c2b8d2f4aeb
parent742f2e139a25db7f27cbaa5660777902dd233ea0
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