提交 be064d11 编写于 作者: A Alexandre Oliva 提交者: Chris Mason

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: NAlexandre Oliva <oliva@lsd.ic.unicamp.br>
Signed-off-by: NChris Mason <chris.mason@oracle.com>
上级 425d8315
...@@ -5299,9 +5299,9 @@ static noinline int find_free_extent(struct btrfs_trans_handle *trans, ...@@ -5299,9 +5299,9 @@ static noinline int find_free_extent(struct btrfs_trans_handle *trans,
* people trying to start a new cluster * people trying to start a new cluster
*/ */
spin_lock(&last_ptr->refill_lock); spin_lock(&last_ptr->refill_lock);
if (last_ptr->block_group && if (!last_ptr->block_group ||
(last_ptr->block_group->ro || last_ptr->block_group->ro ||
!block_group_bits(last_ptr->block_group, data))) !block_group_bits(last_ptr->block_group, data))
goto refill_cluster; goto refill_cluster;
offset = btrfs_alloc_from_cluster(block_group, last_ptr, offset = btrfs_alloc_from_cluster(block_group, last_ptr,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册