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 | be064d113906f04ea13088a8260e1e68ae0a4050 (patch) | |
tree | 0adeb137e165fbcc5c9ed66d00189ef3194781f4 | |
parent | 425d83156ca27f74e2cc3f370138038c3c8947f8 (diff) | |
download | linux-be064d113906f04ea13088a8260e1e68ae0a4050.tar.gz linux-be064d113906f04ea13088a8260e1e68ae0a4050.tar.bz2 linux-be064d113906f04ea13088a8260e1e68ae0a4050.zip |
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>
-rw-r--r-- | fs/btrfs/extent-tree.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 71c8e7049d0c..813c6bb96c9a 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -5299,9 +5299,9 @@ alloc: * people trying to start a new cluster */ spin_lock(&last_ptr->refill_lock); - if (last_ptr->block_group && - (last_ptr->block_group->ro || - !block_group_bits(last_ptr->block_group, data))) + if (!last_ptr->block_group || + last_ptr->block_group->ro || + !block_group_bits(last_ptr->block_group, data)) goto refill_cluster; offset = btrfs_alloc_from_cluster(block_group, last_ptr, |