btrfs: rework wake_all_tickets
authorJosef Bacik <josef@toxicpanda.com>
Wed, 28 Aug 2019 15:12:47 +0000 (11:12 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 9 Sep 2019 12:59:18 +0000 (14:59 +0200)
commit2341ccd1bf05b3d844c10ad224cd38b06fd53219
tree989fc2ce8421ce2d9eb4fc183556c256220309b8
parent18fa2284aac3f1071f51a897dc5585178cae458f
btrfs: rework wake_all_tickets

Now that we no longer partially fill tickets we need to rework
wake_all_tickets to call btrfs_try_to_wakeup_tickets() in order to see
if any subsequent tickets are able to be satisfied.  If our tickets_id
changes we know something happened and we can keep flushing.

Also if we find a ticket that is smaller than the first ticket in our
queue then we want to retry the flushing loop again in case
may_commit_transaction() decides we could satisfy the ticket by
committing the transaction.

Rename this to maybe_fail_all_tickets() while we're at it, to better
reflect what the function is actually doing.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/space-info.c