Commit b2460c2a authored by Filipe Manana's avatar Filipe Manana Committed by David Sterba
Browse files

btrfs: remove unnecessary NULL checks before freeing extent state



When manipulating extent bits for an io tree range, we have this pattern:

   if (prealloc)
          btrfs_free_extent_state(prealloc);

but this is not needed nowadays since btrfs_free_extent_state() ignores
a NULL pointer argument, following the common pattern of kernel and btrfs
freeing functions, as well as libc and other user space libraries.
So remove the NULL checks, reducing source code and object size.

Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent aa2c80a9
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -761,7 +761,6 @@ int btrfs_clear_extent_bit_changeset(struct extent_io_tree *tree, u64 start, u64

out:
	spin_unlock(&tree->lock);
	if (prealloc)
	btrfs_free_extent_state(prealloc);

	return ret;
@@ -1285,7 +1284,6 @@ static int set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,

out:
	spin_unlock(&tree->lock);
	if (prealloc)
	btrfs_free_extent_state(prealloc);

	return ret;
@@ -1525,7 +1523,6 @@ int btrfs_convert_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,

out:
	spin_unlock(&tree->lock);
	if (prealloc)
	btrfs_free_extent_state(prealloc);

	return ret;