]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
xfs: cleanup inode counter stats
authorChristoph Hellwig <hch@lst.de>
Mon, 2 Feb 2026 14:14:31 +0000 (15:14 +0100)
committerCarlos Maiolino <cem@kernel.org>
Wed, 25 Feb 2026 12:58:48 +0000 (13:58 +0100)
Most of them are unused, so mark them as such.  Give the remaining ones
names that match their use instead of the historic IRIX ones based on
vnodes.  Note that the names are purely internal to the XFS code, the
user interface is based on section names and arrays of counters.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_icache.c
fs/xfs/xfs_stats.c
fs/xfs/xfs_stats.h
fs/xfs/xfs_super.c

index dbaab4ae709f9ce35b2148f7e70ccc21fdb9192d..f76c6decdaa3f138274d3e61fb19a16131d714c0 100644 (file)
@@ -106,7 +106,7 @@ xfs_inode_alloc(
        mapping_set_folio_min_order(VFS_I(ip)->i_mapping,
                                    M_IGEO(mp)->min_folio_order);
 
-       XFS_STATS_INC(mp, vn_active);
+       XFS_STATS_INC(mp, xs_inodes_active);
        ASSERT(atomic_read(&ip->i_pincount) == 0);
        ASSERT(ip->i_ino == 0);
 
@@ -172,7 +172,7 @@ __xfs_inode_free(
        /* asserts to verify all state is correct here */
        ASSERT(atomic_read(&ip->i_pincount) == 0);
        ASSERT(!ip->i_itemp || list_empty(&ip->i_itemp->ili_item.li_bio_list));
-       XFS_STATS_DEC(ip->i_mount, vn_active);
+       XFS_STATS_DEC(ip->i_mount, xs_inodes_active);
 
        call_rcu(&VFS_I(ip)->i_rcu, xfs_inode_free_callback);
 }
@@ -2234,7 +2234,7 @@ xfs_inode_mark_reclaimable(
        struct xfs_mount        *mp = ip->i_mount;
        bool                    need_inactive;
 
-       XFS_STATS_INC(mp, vn_reclaim);
+       XFS_STATS_INC(mp, xs_inode_mark_reclaimable);
 
        /*
         * We should never get here with any of the reclaim flags already set.
index 017db0361cd860e7c3b64eca02f4624b482435d7..bc4a5d6dc7951ea2080fea892daeed40353c7d7e 100644 (file)
@@ -42,7 +42,7 @@ int xfs_stats_format(struct xfsstats __percpu *stats, char *buf)
                { "xstrat",             xfsstats_offset(xs_write_calls) },
                { "rw",                 xfsstats_offset(xs_attr_get)    },
                { "attr",               xfsstats_offset(xs_iflush_count)},
-               { "icluster",           xfsstats_offset(vn_active)      },
+               { "icluster",           xfsstats_offset(xs_inodes_active) },
                { "vnodes",             xfsstats_offset(xb_get)         },
                { "buf",                xfsstats_offset(xs_abtb_2)      },
                { "abtb2",              xfsstats_offset(xs_abtc_2)      },
@@ -100,15 +100,15 @@ int xfs_stats_format(struct xfsstats __percpu *stats, char *buf)
 void xfs_stats_clearall(struct xfsstats __percpu *stats)
 {
        int             c;
-       uint32_t        vn_active;
+       uint32_t        xs_inodes_active;
 
        xfs_notice(NULL, "Clearing xfsstats");
        for_each_possible_cpu(c) {
                preempt_disable();
-               /* save vn_active, it's a universal truth! */
-               vn_active = per_cpu_ptr(stats, c)->s.vn_active;
+               /* save xs_inodes_active, it's a universal truth! */
+               xs_inodes_active = per_cpu_ptr(stats, c)->s.xs_inodes_active;
                memset(per_cpu_ptr(stats, c), 0, sizeof(*stats));
-               per_cpu_ptr(stats, c)->s.vn_active = vn_active;
+               per_cpu_ptr(stats, c)->s.xs_inodes_active = xs_inodes_active;
                preempt_enable();
        }
 }
index 153d2381d0a8575b9a9a195e451de477a522c941..64bc0cc181267524fdfa9260abbc15b7d708037a 100644 (file)
@@ -100,14 +100,14 @@ struct __xfsstats {
        uint32_t                xs_iflush_count;
        uint32_t                xs_icluster_flushcnt;
        uint32_t                xs_icluster_flushinode;
-       uint32_t                vn_active;      /* # vnodes not on free lists */
-       uint32_t                vn_alloc;       /* # times vn_alloc called */
-       uint32_t                vn_get;         /* # times vn_get called */
-       uint32_t                vn_hold;        /* # times vn_hold called */
-       uint32_t                vn_rele;        /* # times vn_rele called */
-       uint32_t                vn_reclaim;     /* # times vn_reclaim called */
-       uint32_t                vn_remove;      /* # times vn_remove called */
-       uint32_t                vn_free;        /* # times vn_free called */
+       uint32_t                xs_inodes_active;
+       uint32_t                __unused_vn_alloc;
+       uint32_t                __unused_vn_get;
+       uint32_t                __unused_vn_hold;
+       uint32_t                xs_inode_destroy;
+       uint32_t                xs_inode_destroy2; /* same as xs_inode_destroy */
+       uint32_t                xs_inode_mark_reclaimable;
+       uint32_t                __unused_vn_free;
        uint32_t                xb_get;
        uint32_t                xb_create;
        uint32_t                xb_get_locked;
index abc45f860a7326e244c1ed1c070cf884fe89e361..f8de44443e81cec463e52f951a77f7d7444aba90 100644 (file)
@@ -712,8 +712,8 @@ xfs_fs_destroy_inode(
        trace_xfs_destroy_inode(ip);
 
        ASSERT(!rwsem_is_locked(&inode->i_rwsem));
-       XFS_STATS_INC(ip->i_mount, vn_rele);
-       XFS_STATS_INC(ip->i_mount, vn_remove);
+       XFS_STATS_INC(ip->i_mount, xs_inode_destroy);
+       XFS_STATS_INC(ip->i_mount, xs_inode_destroy2);
        xfs_inode_mark_reclaimable(ip);
 }