Skip to contentSkip to conversation

btrfs: restructure find_free_dev_extent()

PATCH In review Miao Xie 1 participant 1 message Jan 5, 2011 Btrfs file system

lore
Share & tools
lore

Miao Xie

author
#0 lore raw

PATCH v3 4/6 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

---
 fs/btrfs/extent-tree.c |    4 +-
 fs/btrfs/volumes.c     |  155 +++++++++++++++++++++++++++--------------------
 2 files changed, 91 insertions(+), 68 deletions(-)
fs/btrfs/extent-tree.c +2 -2
index 4bcd875..7c1a053 100644
@@ -8098,7 +8098,7 @@ int btrfs_can_relocate(struct btrfs_root *root, u64 bytenr)
 	mutex_lock(&root->fs_info->chunk_mutex);
 	list_for_each_entry(device, &fs_devices->alloc_list, dev_alloc_list) {
 		u64 min_free = btrfs_block_group_used(&block_group->item);
-		u64 dev_offset, max_avail;
+		u64 dev_offset;
 
 		/*
 		 * check to make sure we can actually find a chunk with enough
@@ -8106,7 +8106,7 @@ int btrfs_can_relocate(struct btrfs_root *root, u64 bytenr)
 		 */
 		if (device->total_bytes > device->bytes_used + min_free) {
 			ret = find_free_dev_extent(NULL, device, min_free,
-						   &dev_offset, &max_avail);
+						   &dev_offset, NULL);
 			if (!ret)
 				break;
 			ret = -1;
fs/btrfs/volumes.c +89 -66

219 lines not on this page · raw message

Signature · 1 line
1.7.2.3