]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: add btrfs_reserve_data_bytes and use it
authorJosef Bacik <josef@toxicpanda.com>
Tue, 21 Jul 2020 14:22:25 +0000 (10:22 -0400)
committerDavid Sterba <dsterba@suse.com>
Wed, 7 Oct 2020 10:06:52 +0000 (12:06 +0200)
commit12da4f75e59b289582ce64d28630c25189b8dda3
treec3e34ecebb57efe722b67fa664a8bdc727f4f431
parenta70b3a886a7a2b80004eff3f86b6fffd483bc4b4
btrfs: add btrfs_reserve_data_bytes and use it

Create a new function btrfs_reserve_data_bytes() in order to handle data
reservations.  This uses the new flush types and flush states to handle
making data reservations.

This patch specifically does not change any functionality, and is
purposefully not cleaned up in order to make bisection easier for the
future patches.  The new helper is identical to the old helper in how it
handles data reservations.  We first try to force a chunk allocation,
and then we run through the flush states all at once and in the same
order that they were done with the old helper.

Subsequent patches will clean this up and change the behavior of the
flushing, and it is important to keep those changes separate so we can
easily bisect down to the patch that caused the regression, rather than
the patch that made us start using the new infrastructure.

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/delalloc-space.c
fs/btrfs/space-info.c
fs/btrfs/space-info.h