]> Gentwo Git Trees - linux/.git/commit
btrfs: factor out root promotion logic into promote_child_to_root()
authorSun YangKai <sunk67188@gmail.com>
Fri, 14 Nov 2025 07:24:45 +0000 (15:24 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 25 Nov 2025 00:50:56 +0000 (01:50 +0100)
commit31b37b766753682ec1434bb591c5edee94649597
treeaab04d8eb71710f5fd350e4cc6315f1f151d96bd
parent1a332a6d70475d87067038ab0cbda8292da955e1
btrfs: factor out root promotion logic into promote_child_to_root()

The balance_level() function is overly long and contains a cold code path
that handles promoting a child node to root when the root has only one item.
This code has distinct logic that is clearer and more maintainable when
isolated in its own function.

Signed-off-by: Sun YangKai <sunk67188@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.c