Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165915
b: refs/heads/master
c: 7ce618d
h: refs/heads/master
i:
  165913: 0a68123
  165911: 044a14f
v: v3
  • Loading branch information
Chris Mason committed Sep 22, 2009
1 parent 574e293 commit b06a4ea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 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: 33b4d47f5e24b986f486d7de9a2df915ad1fdfbc
refs/heads/master: 7ce618db9878689f87897b673fa3329070860fc7
20 changes: 7 additions & 13 deletions trunk/fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -6756,22 +6756,16 @@ int btrfs_can_relocate(struct btrfs_root *root, u64 bytenr)

/*
* if this is the last block group we have in this space, we can't
* relocate it.
* relocate it unless we're able to allocate a new chunk below.
*
* Otherwise, we need to make sure we have room in the space to handle
* all of the extents from this block group. If we can, we're good
*/
if (space_info->total_bytes == block_group->key.offset) {
ret = -1;
spin_unlock(&space_info->lock);
goto out;
}

/*
* need to make sure we have room in the space to handle all of the
* extents from this block group. If we can, we're good
*/
if (space_info->bytes_used + space_info->bytes_reserved +
if ((space_info->total_bytes != block_group->key.offset) &&
(space_info->bytes_used + space_info->bytes_reserved +
space_info->bytes_pinned + space_info->bytes_readonly +
btrfs_block_group_used(&block_group->item) <
space_info->total_bytes) {
space_info->total_bytes)) {
spin_unlock(&space_info->lock);
goto out;
}
Expand Down

0 comments on commit b06a4ea

Please sign in to comment.