aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@lsd.ic.unicamp.br>2011-11-30 13:43:00 -0500
committerChris Mason <chris.mason@oracle.com>2011-11-30 13:43:00 -0500
commit1b22bad779be7fe07242be04749ec969164528b8 (patch)
tree08f8974f216e609a43119c4285844033775f6f7f /fs/btrfs/extent-tree.c
parentb78d09bceb524ee6481c21b77bda22d766b10e6a (diff)
downloadkernel_goldelico_gta04-1b22bad779be7fe07242be04749ec969164528b8.zip
kernel_goldelico_gta04-1b22bad779be7fe07242be04749ec969164528b8.tar.gz
kernel_goldelico_gta04-1b22bad779be7fe07242be04749ec969164528b8.tar.bz2
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.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index b7e5f68..97c1206 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -5301,10 +5301,8 @@ alloc:
spin_lock(&last_ptr->refill_lock);
if (last_ptr->block_group &&
(last_ptr->block_group->ro ||
- !block_group_bits(last_ptr->block_group, data))) {
- offset = 0;
+ !block_group_bits(last_ptr->block_group, data)))
goto refill_cluster;
- }
offset = btrfs_alloc_from_cluster(block_group, last_ptr,
num_bytes, search_start);
@@ -5355,7 +5353,7 @@ refill_cluster:
/* allocate a cluster in this block group */
ret = btrfs_find_space_cluster(trans, root,
block_group, last_ptr,
- offset, num_bytes,
+ search_start, num_bytes,
empty_cluster + empty_size);
if (ret == 0) {
/*