btrfs: move leaf search logic out of btrfs_search_slot()
authorFilipe Manana <fdmanana@suse.com>
Thu, 2 Dec 2021 10:30:38 +0000 (10:30 +0000)
committerDavid Sterba <dsterba@suse.com>
Fri, 7 Jan 2022 13:18:23 +0000 (14:18 +0100)
commit109324cfda067b84b948002584849a02dd0a6641
treee6e4d9bf3f3b270366790886ff1a43bd0d1a68b1
parente5e1c1741b3de3f8d06fe4b700d83709a7da0610
btrfs: move leaf search logic out of btrfs_search_slot()

There's quite a significant amount of code for doing the key search for a
leaf at btrfs_search_slot(), with a couple labels and gotos in it, plus
btrfs_search_slot() is already big enough.

So move the logic that does the key search on a leaf into a new helper
function. This makes it better organized, removing the need for the labels
and the gotos, as well as reducing the indentation level and the size of
btrfs_search_slot().

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
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/ctree.c