summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>2025-12-17 14:41:39 +0100
committerDavid Sterba <dsterba@suse.com>2026-02-03 07:49:12 +0100
commit9da49784ae9fff59b6056d8a4018d95a16f9915b (patch)
treed8a57c540a83d1aecbe7482fa849d26bfe892045
parent2ef2e97fe74e937a246681713434ca16d8e5552e (diff)
btrfs: zoned: print block-group type for zoned statistics
When printing the zoned statistics, also include the block-group type in the block-group listing output. The updated output looks as follows: device /dev/vda mounted on /mnt with fstype btrfs zoned statistics: active block-groups: 9 reclaimable: 0 unused: 2 need reclaim: false data relocation block-group: 3221225472 active zones: start: 1073741824, wp: 268419072 used: 268419072, reserved: 0, unusable: 0 (DATA) start: 1342177280, wp: 0 used: 0, reserved: 0, unusable: 0 (DATA) start: 1610612736, wp: 81920 used: 16384, reserved: 16384, unusable: 49152 (SYSTEM) start: 1879048192, wp: 2031616 used: 1458176, reserved: 65536, unusable: 507904 (METADATA) start: 2147483648, wp: 268419072 used: 268419072, reserved: 0, unusable: 0 (DATA) start: 2415919104, wp: 268419072 used: 268419072, reserved: 0, unusable: 0 (DATA) start: 2684354560, wp: 268419072 used: 268419072, reserved: 0, unusable: 0 (DATA) start: 2952790016, wp: 65536 used: 65536, reserved: 0, unusable: 0 (DATA) start: 3221225472, wp: 0 used: 0, reserved: 0, unusable: 0 (DATA) Reviewed-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: Naohiro Aota <naohiro.aota@wdc.com> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/zoned.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index a58a4336a5b7..2e861eef5cd8 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -3023,6 +3023,7 @@ void btrfs_show_zoned_stats(struct btrfs_fs_info *fs_info, struct seq_file *seq)
u64 used;
u64 reserved;
u64 zone_unusable;
+ const char *typestr = btrfs_space_info_type_str(bg->space_info);
spin_lock(&bg->lock);
start = bg->start;
@@ -3033,8 +3034,8 @@ void btrfs_show_zoned_stats(struct btrfs_fs_info *fs_info, struct seq_file *seq)
spin_unlock(&bg->lock);
seq_printf(seq,
- "\t start: %llu, wp: %llu used: %llu, reserved: %llu, unusable: %llu\n",
- start, alloc_offset, used, reserved, zone_unusable);
+ "\t start: %llu, wp: %llu used: %llu, reserved: %llu, unusable: %llu (%s)\n",
+ start, alloc_offset, used, reserved, zone_unusable, typestr);
}
spin_unlock(&fs_info->zone_active_bgs_lock);
}