diff options
| author | Qu Wenruo <[email protected]> | 2018-11-02 01:39:50 +0000 |
|---|---|---|
| committer | David Sterba <[email protected]> | 2018-12-17 13:51:26 +0000 |
| commit | e72d79d6bcee564dbdf83169c743bbd3f8438108 (patch) | |
| tree | 7bfe529dfee696265e9fab344bb2d61a8b12fc09 /fs/btrfs/dev-replace.c | |
| parent | btrfs: Refactor unclustered extent allocation into find_free_extent_uncluster... (diff) | |
| download | kernel-e72d79d6bcee564dbdf83169c743bbd3f8438108.tar.gz kernel-e72d79d6bcee564dbdf83169c743bbd3f8438108.zip | |
btrfs: Refactor find_free_extent loops update into find_free_extent_update_loop
We have a complex loop design for find_free_extent(), that has different
behavior for each loop, some even includes new chunk allocation.
Instead of putting such a long code into find_free_extent() and makes it
harder to read, just extract them into find_free_extent_update_loop().
With all the cleanups, the main find_free_extent() should be pretty
barebone:
find_free_extent()
|- Iterate through all block groups
| |- Get a valid block group
| |- Try to do clustered allocation in that block group
| |- Try to do unclustered allocation in that block group
| |- Check if the result is valid
| | |- If valid, then exit
| |- Jump to next block group
|
|- Push harder to find free extents
|- If not found, re-iterate all block groups
Signed-off-by: Qu Wenruo <[email protected]>
Reviewed-by: Su Yue <[email protected]>
[ copy callchain from changelog to function comment ]
Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/btrfs/dev-replace.c')
0 files changed, 0 insertions, 0 deletions
