]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: allow balance to explicitly allocate chunks as it relocates
authorChris Mason <chris.mason@oracle.com>
Wed, 16 Feb 2011 18:57:04 +0000 (13:57 -0500)
committerChris Mason <chris.mason@oracle.com>
Wed, 16 Feb 2011 20:28:47 +0000 (15:28 -0500)
commitca79c5024e28800cab5c86981e4fd782eaafeaa1
tree05cebe37380861a89faaea50c1ccb360ffb0f975
parent50e1e50c6e1f546ea0018deee4b9dc72ed50153a
Btrfs: allow balance to explicitly allocate chunks as it relocates

Btrfs device shrinking and balancing ends up reallocating all the blocks
in order to allow COW to move them to new destinations.  It is somewhat
awkward in terms of ENOSPC because most of the enospc code is built
around the idea that some operation on a reference counted tree triggers
allocations in the non-reference counted trees.

This commit changes the balancing code to deal with enospc by trying to
allocate a new chunk.  If that allocation succeeds, we go ahead and
retry whatever failed due to enospc.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/relocation.c