]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: display more zone related information in mountstats
authorDamien Le Moal <dlemoal@kernel.org>
Mon, 16 Mar 2026 11:40:19 +0000 (20:40 +0900)
committerCarlos Maiolino <cem@kernel.org>
Wed, 18 Mar 2026 09:08:07 +0000 (10:08 +0100)
Modify xfs_zoned_show_stats() to add to the information displayed with
/proc/self/mountstats the total number of zones (RT groups) and the
number of open zones together with the maximum number of open zones.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hans Holmberg <hans.holmberg@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_zone_info.c

index 53eabbc3334c02ff59ba900a60a22d08f12f01a9..a2af4401165441bc09b46ac722822d3d43b35389 100644 (file)
@@ -90,9 +90,14 @@ xfs_zoned_show_stats(
        seq_printf(m, "\tRT GC required: %d\n",
                xfs_zoned_need_gc(mp));
 
+       seq_printf(m, "\ttotal number of zones: %u\n",
+               mp->m_sb.sb_rgcount);
        seq_printf(m, "\tfree zones: %d\n", atomic_read(&zi->zi_nr_free_zones));
-       seq_puts(m, "\topen zones:\n");
+
        spin_lock(&zi->zi_open_zones_lock);
+       seq_printf(m, "\tnumber of open zones: %u / %u\n",
+               zi->zi_nr_open_zones, mp->m_max_open_zones);
+       seq_puts(m, "\topen zones:\n");
        list_for_each_entry(oz, &zi->zi_open_zones, oz_entry)
                xfs_show_open_zone(m, oz);
        if (zi->zi_open_gc_zone) {