Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 232999
b: refs/heads/master
c: e9e2289
h: refs/heads/master
i:
  232997: 809baab
  232995: f3ad06f
  232991: d7f98b9
v: v3
  • Loading branch information
Josef Bacik authored and Chris Mason committed Jan 28, 2011
1 parent 330acd6 commit 4afaf34
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dedefd7215d3ec451291ca393e5c8e4c1882c8c6
refs/heads/master: e9e22899de661af94cb9995885fd04e4c738838b
16 changes: 14 additions & 2 deletions trunk/fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -3589,8 +3589,20 @@ void block_rsv_release_bytes(struct btrfs_block_rsv *block_rsv,

if (num_bytes > 0) {
if (dest) {
block_rsv_add_bytes(dest, num_bytes, 0);
} else {
spin_lock(&dest->lock);
if (!dest->full) {
u64 bytes_to_add;

bytes_to_add = dest->size - dest->reserved;
bytes_to_add = min(num_bytes, bytes_to_add);
dest->reserved += bytes_to_add;
if (dest->reserved >= dest->size)
dest->full = 1;
num_bytes -= bytes_to_add;
}
spin_unlock(&dest->lock);
}
if (num_bytes) {
spin_lock(&space_info->lock);
space_info->bytes_reserved -= num_bytes;
spin_unlock(&space_info->lock);
Expand Down

0 comments on commit 4afaf34

Please sign in to comment.