Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 243156
b: refs/heads/master
c: 7d0d2e8
h: refs/heads/master
v: v3
  • Loading branch information
Josef Bacik committed Mar 21, 2011
1 parent ad90b21 commit a491a91
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 22a94d44bd6876a90630338229da6c0436d46593
refs/heads/master: 7d0d2e8e6b6f7da221a25238cf490a095c8c4788
10 changes: 10 additions & 0 deletions trunk/fs/btrfs/free-space-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1999,6 +1999,16 @@ int btrfs_find_space_cluster(struct btrfs_trans_handle *trans,
min_bytes = max(bytes, (bytes + empty_size) >> 2);

spin_lock(&block_group->tree_lock);

/*
* If we know we don't have enough space to make a cluster don't even
* bother doing all the work to try and find one.
*/
if (block_group->free_space < min_bytes) {
spin_unlock(&block_group->tree_lock);
return -ENOSPC;
}

spin_lock(&cluster->lock);

/* someone already found a cluster, hooray */
Expand Down

0 comments on commit a491a91

Please sign in to comment.