Re: [PATCH 17/23] btrfs: use the same helper for data and metadata reservations

Nikolay Borisov
2020-02-03T15:47:15Z

On 1.02.20 г. 0:36 ч., Josef Bacik wrote:
> 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.
>
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

It's indeed identical but it's somewhat cryptic e.g.
btrfs_can_overcommit will return 0 for data space so if we don't have
space we proceed further down to setup our ticket. Since for data we can
never be called with BTRFS_RESERVE_FLUSH_ALL we just add a priority
ticket and eventually execute handle_reserve_ticket in __reserve_bytes.

Please add the above explanation to the changelog or David can do it if
he deems it necessary. Nevertheless,

Reviewed-by: Nikolay Borisov <nborisov@suse.com>