Home
last modified time | relevance | path

Searched hist:"88 ad95b0" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/fs/btrfs/
H A Dctree.c88ad95b0 Wed Apr 26 05:51:37 CDT 2023 Filipe Manana <fdmanana@suse.com> btrfs: tag as unlikely the key comparison when checking sibling keys

When checking siblings keys, before moving keys from one node/leaf to a
sibling node/leaf, it's very unexpected to have the last key of the left
sibling greater than or equals to the first key of the right sibling, as
that means we have a (serious) corruption that breaks the key ordering
properties of a b+tree. Since this is unexpected, surround the comparison
with the unlikely macro, which helps the compiler generate better code
for the most expected case (no existing b+tree corruption). This is also
what we do for other unexpected cases of invalid key ordering (like at
btrfs_set_item_key_safe()).

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>