]> git.ipfire.org Git - thirdparty/linux.git/commit
btrfs: refactor mergable_maps() for more readability
authorFilipe Manana <fdmanana@suse.com>
Mon, 4 Dec 2023 16:20:32 +0000 (16:20 +0000)
committerDavid Sterba <dsterba@suse.com>
Fri, 15 Dec 2023 21:59:02 +0000 (22:59 +0100)
commit27f0d9c98d1554a3c0021116aef1a250088d35a0
treeb9ca52a7307164a50050bfe8ff510318a742674f
parentb144cc0415e76b29bde86a969a0e1e8b4c8dbce2
btrfs: refactor mergable_maps() for more readability

At mergable_maps() instead of having a single if statement with many
ORed and ANDed conditions, refactor it with multiple if statements that
check a single condition and return immediately once a requirement fails.
This makes it easier to read.

Also change the return type from int to bool, make the arguments const
and rename the function from mergable_maps() to mergeable_maps().

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_map.c