btrfs: use PTR_ERR() instead of PTR_ERR_OR_ZERO() for btrfs_get_extent()
authorQu Wenruo <wqu@suse.com>
Sun, 24 Nov 2024 22:43:24 +0000 (09:13 +1030)
committerDavid Sterba <dsterba@suse.com>
Mon, 13 Jan 2025 13:53:14 +0000 (14:53 +0100)
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>
fs/btrfs/extent_io.c

index b923d0cec61c73274334d720ae98160a912ce973..9725ff7f274ded907577f93181a9f9dff1fa4b15 100644 (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);