btrfs: use PTR_ERR() instead of PTR_ERR_OR_ZERO() for btrfs_get_extent()

The function btrfs_get_extent() will only return an PTR_ERR() or a valid
extent map pointer. It will not return NULL.

Thus the usage of PTR_ERR_OR_ZERO() inside submit_one_sector() is not
needed, use plain PTR_ERR() instead, and that is the only usage of
PTR_ERR_OR_ZERO() after btrfs_get_extent().

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Qu Wenruo 2024-11-25 09:13:24 +10:30 committed by David Sterba
parent 2b34879d97
commit 27602f1d1b

View File

@ -1335,7 +1335,7 @@ static int submit_one_sector(struct btrfs_inode *inode,
em = btrfs_get_extent(inode, NULL, filepos, sectorsize);
if (IS_ERR(em))
return PTR_ERR_OR_ZERO(em);
return PTR_ERR(em);
extent_offset = filepos - em->start;
em_end = extent_map_end(em);