Skip to content
Commit 7b78c170 authored by Chris Mason's avatar Chris Mason
Browse files

Btrfs: Only prep for btree deletion balances when nodes are mostly empty



Whenever an item deletion is done, we need to balance all the nodes
in the tree to make sure we don't end up with an empty node if a pointer
is deleted.  This balance prep happens from the root of the tree down
so we can drop our locks as we go.

reada_for_balance was triggering read-ahead on neighboring nodes even
when no balancing was required.  This adds an extra check to avoid
calling balance_level() and avoid reada_for_balance() when a balance
won't be required.

Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 12f4dacc
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment