Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 232982
b: refs/heads/master
c: 5e71b5d
h: refs/heads/master
v: v3
  • Loading branch information
Li Zefan committed Jan 26, 2011
1 parent d49ad77 commit 71da369
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 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: 70b7da304f9f9bbf1566085155895e32e775a745
refs/heads/master: 5e71b5d5ec07e4b3fb4c78c4e4b108ff667f123f
17 changes: 14 additions & 3 deletions trunk/fs/btrfs/free-space-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1843,15 +1843,26 @@ u64 btrfs_alloc_from_cluster(struct btrfs_block_group_cache *block_group,
entry->offset += bytes;
entry->bytes -= bytes;

if (entry->bytes == 0) {
if (entry->bytes == 0)
rb_erase(&entry->offset_index, &cluster->root);
kfree(entry);
}
break;
}
out:
spin_unlock(&cluster->lock);

if (!ret)
return 0;

spin_lock(&block_group->tree_lock);

block_group->free_space -= bytes;
if (entry->bytes == 0) {
block_group->free_extents--;
kfree(entry);
}

spin_unlock(&block_group->tree_lock);

return ret;
}

Expand Down

0 comments on commit 71da369

Please sign in to comment.