]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: Only prep for btree deletion balances when nodes are mostly empty
authorChris Mason <chris.mason@oracle.com>
Wed, 4 Feb 2009 14:12:46 +0000 (09:12 -0500)
committerChris Mason <chris.mason@oracle.com>
Wed, 4 Feb 2009 14:12:46 +0000 (09:12 -0500)
commit950d235c0bea87eddaeb8fcc78fd77c009534558
treee2301fba4de0f3a04cf4b691f63e2bdf1e8c64d2
parent9072c12633258cc40a8d299ec4a8c2ceb8a95644
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: Chris Mason <chris.mason@oracle.com>
fs/btrfs/ctree.c