diff options
author | Miao Xie <miaox@cn.fujitsu.com> | 2011-01-05 05:07:26 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-01-16 11:30:19 -0500 |
commit | 7bfc837df935d850fe996dfe92ef48975cd4170a (patch) | |
tree | 8ca5f83c0c43e505b872368877504fa95c6276ab /fs/btrfs/extent-tree.c | |
parent | 1974a3b42d8cf7a9c74f1e0310c593023617037a (diff) |
btrfs: restructure find_free_dev_extent()
- make it return the start position and length of the max free space when it can
not find a suitable free space.
- make it more readability
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 3c71d95111fe..1e1c9a177626 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -8099,7 +8099,7 @@ int btrfs_can_relocate(struct btrfs_root *root, u64 bytenr) | |||
8099 | mutex_lock(&root->fs_info->chunk_mutex); | 8099 | mutex_lock(&root->fs_info->chunk_mutex); |
8100 | list_for_each_entry(device, &fs_devices->alloc_list, dev_alloc_list) { | 8100 | list_for_each_entry(device, &fs_devices->alloc_list, dev_alloc_list) { |
8101 | u64 min_free = btrfs_block_group_used(&block_group->item); | 8101 | u64 min_free = btrfs_block_group_used(&block_group->item); |
8102 | u64 dev_offset, max_avail; | 8102 | u64 dev_offset; |
8103 | 8103 | ||
8104 | /* | 8104 | /* |
8105 | * check to make sure we can actually find a chunk with enough | 8105 | * check to make sure we can actually find a chunk with enough |
@@ -8107,7 +8107,7 @@ int btrfs_can_relocate(struct btrfs_root *root, u64 bytenr) | |||
8107 | */ | 8107 | */ |
8108 | if (device->total_bytes > device->bytes_used + min_free) { | 8108 | if (device->total_bytes > device->bytes_used + min_free) { |
8109 | ret = find_free_dev_extent(NULL, device, min_free, | 8109 | ret = find_free_dev_extent(NULL, device, min_free, |
8110 | &dev_offset, &max_avail); | 8110 | &dev_offset, NULL); |
8111 | if (!ret) | 8111 | if (!ret) |
8112 | break; | 8112 | break; |
8113 | ret = -1; | 8113 | ret = -1; |