aboutsummaryrefslogtreecommitdiffstats
path: root/fs
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
commitbe064d113906f04ea13088a8260e1e68ae0a4050 (patch)
tree0adeb137e165fbcc5c9ed66d00189ef3194781f4 /fs
parent425d83156ca27f74e2cc3f370138038c3c8947f8 (diff)
Btrfs: skip allocation attempt from empty cluster
If we don't have a cluster, don't bother trying to allocate from it, jumping right away to the attempt to allocate a new cluster. Signed-off-by: Alexandre Oliva <oliva@lsd.ic.unicamp.br> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/extent-tree.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 71c8e7049d0..813c6bb96c9 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -5299,9 +5299,9 @@ alloc:
5299 * people trying to start a new cluster 5299 * people trying to start a new cluster
5300 */ 5300 */
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 goto refill_cluster; 5305 goto refill_cluster;
5306 5306
5307 offset = btrfs_alloc_from_cluster(block_group, last_ptr, 5307 offset = btrfs_alloc_from_cluster(block_group, last_ptr,