diff options
author | Alexandre Oliva <oliva@lsd.ic.unicamp.br> | 2011-11-30 13:43:00 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-11-30 13:43:00 -0500 |
commit | 1b22bad779be7fe07242be04749ec969164528b8 (patch) | |
tree | 08f8974f216e609a43119c4285844033775f6f7f /fs/btrfs/extent-tree.c | |
parent | b78d09bceb524ee6481c21b77bda22d766b10e6a (diff) |
Btrfs: start search for new cluster at the beginning
Instead of starting at zero (offset is always zero), request a cluster
starting at search_start, that denotes the beginning of the current
block group.
Signed-off-by: Alexandre Oliva <oliva@lsd.ic.unicamp.br>
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 | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index b7e5f6898d07..97c12067a4b0 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -5301,10 +5301,8 @@ alloc: | |||
5301 | spin_lock(&last_ptr->refill_lock); | 5301 | spin_lock(&last_ptr->refill_lock); |
5302 | if (last_ptr->block_group && | 5302 | if (last_ptr->block_group && |
5303 | (last_ptr->block_group->ro || | 5303 | (last_ptr->block_group->ro || |
5304 | !block_group_bits(last_ptr->block_group, data))) { | 5304 | !block_group_bits(last_ptr->block_group, data))) |
5305 | offset = 0; | ||
5306 | goto refill_cluster; | 5305 | goto refill_cluster; |
5307 | } | ||
5308 | 5306 | ||
5309 | offset = btrfs_alloc_from_cluster(block_group, last_ptr, | 5307 | offset = btrfs_alloc_from_cluster(block_group, last_ptr, |
5310 | num_bytes, search_start); | 5308 | num_bytes, search_start); |
@@ -5355,7 +5353,7 @@ refill_cluster: | |||
5355 | /* allocate a cluster in this block group */ | 5353 | /* allocate a cluster in this block group */ |
5356 | ret = btrfs_find_space_cluster(trans, root, | 5354 | ret = btrfs_find_space_cluster(trans, root, |
5357 | block_group, last_ptr, | 5355 | block_group, last_ptr, |
5358 | offset, num_bytes, | 5356 | search_start, num_bytes, |
5359 | empty_cluster + empty_size); | 5357 | empty_cluster + empty_size); |
5360 | if (ret == 0) { | 5358 | if (ret == 0) { |
5361 | /* | 5359 | /* |