On 1.02.20 г. 0:36 ч., Josef Bacik wrote:
> Now that we have all the infrastructure in place, use the ticketing
> infrastructure to make data allocations. This still maintains the exact
> same flushing behavior, but now we're using tickets to get our
> reservations satisfied.
>
> Signed-off-by: Josef Bacik <josef@xxxxxxxxxxxxxx>
Reviewed-by: Nikolay Borisov <nborisov@xxxxxxxx>
> ---
> fs/btrfs/space-info.c | 128 ++++++++++++++++++++++--------------------
> 1 file changed, 68 insertions(+), 60 deletions(-)
>
> diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c
> index 6b71f6d3a348..43c5775bcbc6 100644
> --- a/fs/btrfs/space-info.c
> +++ b/fs/btrfs/space-info.c
> @@ -829,7 +829,7 @@ static void priority_reclaim_metadata_space(struct btrfs_fs_info *fs_info,
> int states_nr)
> {
> u64 to_reclaim;
> - int flush_state;
> + int flush_state = 0;
>
> spin_lock(&space_info->lock);
> to_reclaim = btrfs_calc_reclaim_metadata_size(fs_info, space_info);
> @@ -839,7 +839,6 @@ static void priority_reclaim_metadata_space(struct btrfs_fs_info *fs_info,
> }
> spin_unlock(&space_info->lock);
>
> - flush_state = 0;
> do {
> flush_space(fs_info, space_info, to_reclaim, states[flush_state]);
> flush_state++;
nit: Those 2 hunks are unrelated and can be dropped.
<snip>