btrfs: Refactor unclustered extent allocation into find_free_extent_unclustered()
authorQu Wenruo <wqu@suse.com>
Fri, 2 Nov 2018 01:39:49 +0000 (09:39 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Dec 2018 13:51:26 +0000 (14:51 +0100)
commite1a4184815672c0cd8ea91beca3dd6d0bd4b9e53
tree48c3b390097ea2823553ac1d6e7bd759dc7a9c96
parentd06e3bb69009d21802776b8751dfe5deef7102f5
btrfs: Refactor unclustered extent allocation into find_free_extent_unclustered()

This patch will extract unclsutered extent allocation code into
find_free_extent_unclustered().

And this helper function will use return value to indicate what to do
next.

This should make find_free_extent() a little easier to read.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Su Yue <suy.fnst@cn.fujitsu.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
[Update merge conflict with fb5c39d7a887 ("btrfs: don't use ctl->free_space for max_extent_size")]
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c