]> git.itanic.dy.fi Git - linux-stable/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)
commit6a921de589926a350634e6e279f43fa5b9dbf5ba
tree15abf14ed45ce8ac533a038e942b9f24342a7470
parent393f646e34c18b85d0f41272bfcbd475ae3a0d34
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