]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: cut down on loops through the allocator
authorJosef Bacik <jbacik@fb.com>
Thu, 1 Oct 2015 18:54:10 +0000 (14:54 -0400)
committerChris Mason <clm@fb.com>
Thu, 22 Oct 2015 01:55:37 +0000 (18:55 -0700)
commitb22505420c47c4b42dbc621e912c48f90ac4194a
treef10e2f374d3309bdcb5afb24ec0018d882a4537c
parent37440d258cf1107aa2d264f790d74c917e9cfda5
Btrfs: cut down on loops through the allocator

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: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/extent-tree.c