Commit 36af4e07 authored by Josef Bacik's avatar Josef Bacik Committed by Chris Mason

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: default avatarJosef Bacik <jbacik@fb.com>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent 3204d33c
...@@ -7337,7 +7337,7 @@ int btrfs_reserve_extent(struct btrfs_root *root, ...@@ -7337,7 +7337,7 @@ int btrfs_reserve_extent(struct btrfs_root *root,
u64 empty_size, u64 hint_byte, u64 empty_size, u64 hint_byte,
struct btrfs_key *ins, int is_data, int delalloc) struct btrfs_key *ins, int is_data, int delalloc)
{ {
bool final_tried = false; bool final_tried = num_bytes == min_alloc_size;
u64 flags; u64 flags;
int ret; int ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment