• Josef Bacik's avatar
    Btrfs: cut down on loops through the allocator · a5e681d9
    Josef Bacik authored
    We try really really hard to make allocations, but sometimes it is just not
    going to happen, especially when free space is extremely fragmented.  So add a
    few short cuts through the looping states.  For example if we couldn't allocate
    a chunk, just go straight to the NO_EMPTY_SIZE loop.  If there are no uncached
    block groups and we've done a full search, go straight to the ALLOC_CHUNK stage.
    And finally if we already have empty_size and empty_cluster set to 0 go ahead
    and return -ENOSPC.  Thanks,
    Signed-off-by: default avatarJosef Bacik <jbacik@fb.com>
    Signed-off-by: default avatarChris Mason <clm@fb.com>
    a5e681d9
extent-tree.c 283 KB