summaryrefslogtreecommitdiff
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fb.com>2015-09-25 23:13:11 +0300
committerChris Mason <clm@fb.com>2015-10-22 04:51:46 +0300
commit36af4e0737f6aa494e43497a5a34588a1d5cb12f (patch)
tree9631ef934dbd519c706f89f4d3c987493295e381 /fs/btrfs/extent-tree.c
parent3204d33cda40d9bc97f257c441225d3713916661 (diff)
downloadlinux-36af4e0737f6aa494e43497a5a34588a1d5cb12f.tar.xz
Btrfs: don't loop in allocator for space cache
The space cache needs to have contiguous allocations, and the allocator tries to make allocations by reducing the amount of bytes requested and re-searching. But this just makes us waste time when we are very fragmented, so if we can't find our space just exit, don't bother trying to search again. Thanks, Signed-off-by: Josef Bacik <jbacik@fb.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index e0dfe3578b00..d6b5ef4b4c72 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -7337,7 +7337,7 @@ int btrfs_reserve_extent(struct btrfs_root *root,
u64 empty_size, u64 hint_byte,
struct btrfs_key *ins, int is_data, int delalloc)
{
- bool final_tried = false;
+ bool final_tried = num_bytes == min_alloc_size;
u64 flags;
int ret;