btrfs: use the same helper for data and metadata reservations
authorJosef Bacik <josef@toxicpanda.com>
Tue, 21 Jul 2020 14:22:28 +0000 (10:22 -0400)
committerDavid Sterba <dsterba@suse.com>
Wed, 7 Oct 2020 10:06:53 +0000 (12:06 +0200)
commitf3bda421c16fe2f67cb3ff81b65ce8de331dd8e2
treec382df51968f1260d6ea991a6b365066fdd2b6cd
parent0532a6f8b6ce64ced0ffcca0a2ab5d66a8eb9a6d
btrfs: use the same helper for data and metadata reservations

Now that data reservations follow the same pattern as metadata
reservations we can simply rename __reserve_metadata_bytes to
__reserve_bytes and use that helper for data reservations.

Things to keep in mind, btrfs_can_overcommit() returns 0 for data,
because we can never overcommit.  We also will never pass in FLUSH_ALL
for data, so we'll simply be added to the priority list and go straight
into handle_reserve_ticket.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Tested-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/space-info.c