diff options
author | Chris Mason <chris.mason@oracle.com> | 2011-02-16 13:57:04 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-02-16 15:28:47 -0500 |
commit | c87f08ca44e83b2c8d28f63f9c33f3a270a04bbe (patch) | |
tree | 05cebe37380861a89faaea50c1ccb360ffb0f975 /fs/btrfs/ctree.h | |
parent | 91435650c233b93e0da389db74f4b2c11c5ad2d4 (diff) |
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>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 6297701bc19c..28188a786da0 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -2219,6 +2219,8 @@ int btrfs_error_unpin_extent_range(struct btrfs_root *root, | |||
2219 | u64 start, u64 end); | 2219 | u64 start, u64 end); |
2220 | int btrfs_error_discard_extent(struct btrfs_root *root, u64 bytenr, | 2220 | int btrfs_error_discard_extent(struct btrfs_root *root, u64 bytenr, |
2221 | u64 num_bytes); | 2221 | u64 num_bytes); |
2222 | int btrfs_force_chunk_alloc(struct btrfs_trans_handle *trans, | ||
2223 | struct btrfs_root *root, u64 type); | ||
2222 | 2224 | ||
2223 | /* ctree.c */ | 2225 | /* ctree.c */ |
2224 | int btrfs_bin_search(struct extent_buffer *eb, struct btrfs_key *key, | 2226 | int btrfs_bin_search(struct extent_buffer *eb, struct btrfs_key *key, |