Skip to content

btrfs: zoned: replace active_total_bytes counter

Naohiro Aota linux-btrfs llvm oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs: zoned: count fresh BG region as zone unusablefs/btrfs/free-space-cache.c fs/btrfs/zoned.c+26 -50 replies
2/2btrfs: zoned: drop space_info->active_total_bytesfs/btrfs/block-group.c fs/btrfs/space-info.c fs/btrfs/space-info.h +1 more+9 -430 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] btrfs: zoned: replace active_total_bytes counter

This series depends on clean up part (patches 1 and 2) of Josef's series.

https://lore.kernel.org/linux-btrfs/[email protected]/

The naming of space_info->active_total_bytes is misleading. It counts not only active block groups but also full ones which are previously active but now inactive. That confusion results in a bug not counting the full BGs into active_total_bytes on mount time.

Instead, we can count the whole region of a newly allocated block group as zone_unusable. Then, once that block group is activated, release [0 .. zone_capcity] from the zone_unusable counters. With this, we can eliminate the confusing ->active_total_bytes and the code will be common among regular and the zoned mode.

Naohiro Aota (2):
btrfs: zoned: count fresh BG region as zone unusable
btrfs: zoned: drop space_info->active_total_bytes

 fs/btrfs/block-group.c      |  6 ------
 fs/btrfs/free-space-cache.c |  8 +++++++-
 fs/btrfs/space-info.c       | 40 +++++++++----------------------------
 fs/btrfs/space-info.h       |  2 --
 fs/btrfs/zoned.c            | 27 +++++++++++++++++--------
 5 files changed, 35 insertions(+), 48 deletions(-)
Signature · 1 line
2.39.2