]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: zoned: introduce space_info->active_total_bytes
authorNaohiro Aota <naohiro.aota@wdc.com>
Fri, 8 Jul 2022 23:18:45 +0000 (08:18 +0900)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Jul 2022 15:45:42 +0000 (17:45 +0200)
commitc6d979cbe257df81b8ec5ee126b52312c2f34deb
tree15abf14ed45ce8ac533a038e942b9f24342a7470
parenteb80f8693bb91a59fee2cd603468991a57e5e33b
btrfs: zoned: introduce space_info->active_total_bytes

The active_total_bytes, like the total_bytes, accounts for the total bytes
of active block groups in the space_info.

With an introduction of active_total_bytes, we can check if the reserved
bytes can be written to the block groups without activating a new block
group. The check is necessary for metadata allocation on zoned
filesystem. We cannot finish a block group, which may require waiting
for the current transaction, from the metadata allocation context.
Instead, we need to ensure the ongoing allocation (reserved bytes) fits
in active block groups.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/block-group.c
fs/btrfs/space-info.c
fs/btrfs/space-info.h
fs/btrfs/zoned.c