]> Gentwo Git Trees - linux/.git/commit
btrfs: remove redundant level reset in btrfs_del_items()
authorSun YangKai <sunk67188@gmail.com>
Fri, 14 Nov 2025 07:24:48 +0000 (15:24 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 25 Nov 2025 00:50:56 +0000 (01:50 +0100)
commit4357dd76f558f03fe22f28c360f7798ee3a0d238
treeb85b9d3431f600f1648218085a60c74d79001a20
parent139f75a3b1677c76bd845228ec49e50d69ce556e
btrfs: remove redundant level reset in btrfs_del_items()

When btrfs_del_items() empties a leaf, it deletes the leaf unless it's
the root node. For the root leaf case, the code used to reset its level
to 0 via btrfs_set_header_level(). This is redundant as leaf nodes
always have level == 0.

Remove the unnecessary level assignment and invert the conditional to
handle only the non-root leaf deletion. The root leaf is correctly left
as-is.

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