]> www.infradead.org Git - nvme.git/commit
btrfs: reduce nesting for extent processing at btrfs_lookup_extent_info()
authorFilipe Manana <fdmanana@suse.com>
Tue, 18 Jun 2024 10:52:19 +0000 (11:52 +0100)
committerDavid Sterba <dsterba@suse.com>
Thu, 11 Jul 2024 13:33:26 +0000 (15:33 +0200)
commit5c83b3beaee06aa88d4015408ac2d8bb35380b06
treeedc4562f84498f492e5bab528988b5964f8f6ea2
parentc65967ac4d1668dfcb903215c8af128fa15f05d6
btrfs: reduce nesting for extent processing at btrfs_lookup_extent_info()

Instead of using an if-else statement when processing the extent item at
btrfs_lookup_extent_info(), use a single if statement for the error case
since it does a goto at the end and leave the success (expected) case
following the if statement, reducing indentation and making the logic a
bit easier to follow. Also make the if statement's condition as unlikely
since it's not expected to ever happen, as it signals some corruption,
making it clear and hint the compiler to generate more efficient code.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c