]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: remove unnecessary NULL checks before freeing extent state
authorFilipe Manana <fdmanana@suse.com>
Wed, 23 Apr 2025 09:41:31 +0000 (10:41 +0100)
committerDavid Sterba <dsterba@suse.com>
Thu, 15 May 2025 12:30:52 +0000 (14:30 +0200)
commitb2460c2aee9a757bf0b438dde5b5ee71afc54e44
tree1659148d847eb0669af4bd94a3ad3dfbd9017c11
parentaa2c80a9ae279578acbb5f5674e7345199d8173b
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: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-io-tree.c