summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-04-27 11:42:05 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-04-27 11:42:05 -0400
commit28b8bb9e001aa1c4abdd10a8e36972658237fe43 (patch)
treeff22f2c2d9daa6abd6f9d8d95615d061f1827b87 /fs/btrfs/extent-tree.c
parentcd1bc4653dc37f6390f4d6df4f987044c64f700b (diff)
downloadlinux-28b8bb9e001aa1c4abdd10a8e36972658237fe43.tar.bz2
Btrfs: allocator tweaks
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 71e3b311fc42..aca5802a8a1e 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -311,7 +311,10 @@ int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans, struct
clear_radix_bit(pinned_radix, gang[i]);
}
}
- root->fs_info->block_group_cache = NULL;
+ if (root->fs_info->block_group_cache) {
+ root->fs_info->block_group_cache->last_alloc =
+ root->fs_info->block_group_cache->first_free;
+ }
return 0;
}
@@ -578,7 +581,7 @@ check_failed:
if (last_block < search_start)
last_block = search_start;
hole_size = key.objectid - last_block;
- if (hole_size > num_blocks) {
+ if (hole_size >= num_blocks) {
ins->objectid = last_block;
ins->offset = hole_size;
goto check_pending;