Skip to content

Commit 03a6d6c

Browse files
Christoph Hellwigcmaiolino
authored andcommitted
xfs: cleanup inode counter stats
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>
1 parent fd81d3f commit 03a6d6c

4 files changed

Lines changed: 18 additions & 18 deletions

File tree

fs/xfs/xfs_icache.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ xfs_inode_alloc(
106106
mapping_set_folio_min_order(VFS_I(ip)->i_mapping,
107107
M_IGEO(mp)->min_folio_order);
108108

109-
XFS_STATS_INC(mp, vn_active);
109+
XFS_STATS_INC(mp, xs_inodes_active);
110110
ASSERT(atomic_read(&ip->i_pincount) == 0);
111111
ASSERT(ip->i_ino == 0);
112112

@@ -172,7 +172,7 @@ __xfs_inode_free(
172172
/* asserts to verify all state is correct here */
173173
ASSERT(atomic_read(&ip->i_pincount) == 0);
174174
ASSERT(!ip->i_itemp || list_empty(&ip->i_itemp->ili_item.li_bio_list));
175-
XFS_STATS_DEC(ip->i_mount, vn_active);
175+
XFS_STATS_DEC(ip->i_mount, xs_inodes_active);
176176

177177
call_rcu(&VFS_I(ip)->i_rcu, xfs_inode_free_callback);
178178
}
@@ -2234,7 +2234,7 @@ xfs_inode_mark_reclaimable(
22342234
struct xfs_mount *mp = ip->i_mount;
22352235
bool need_inactive;
22362236

2237-
XFS_STATS_INC(mp, vn_reclaim);
2237+
XFS_STATS_INC(mp, xs_inode_mark_reclaimable);
22382238

22392239
/*
22402240
* We should never get here with any of the reclaim flags already set.

fs/xfs/xfs_stats.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ int xfs_stats_format(struct xfsstats __percpu *stats, char *buf)
4242
{ "xstrat", xfsstats_offset(xs_write_calls) },
4343
{ "rw", xfsstats_offset(xs_attr_get) },
4444
{ "attr", xfsstats_offset(xs_iflush_count)},
45-
{ "icluster", xfsstats_offset(vn_active) },
45+
{ "icluster", xfsstats_offset(xs_inodes_active) },
4646
{ "vnodes", xfsstats_offset(xb_get) },
4747
{ "buf", xfsstats_offset(xs_abtb_2) },
4848
{ "abtb2", xfsstats_offset(xs_abtc_2) },
@@ -100,15 +100,15 @@ int xfs_stats_format(struct xfsstats __percpu *stats, char *buf)
100100
void xfs_stats_clearall(struct xfsstats __percpu *stats)
101101
{
102102
int c;
103-
uint32_t vn_active;
103+
uint32_t xs_inodes_active;
104104

105105
xfs_notice(NULL, "Clearing xfsstats");
106106
for_each_possible_cpu(c) {
107107
preempt_disable();
108-
/* save vn_active, it's a universal truth! */
109-
vn_active = per_cpu_ptr(stats, c)->s.vn_active;
108+
/* save xs_inodes_active, it's a universal truth! */
109+
xs_inodes_active = per_cpu_ptr(stats, c)->s.xs_inodes_active;
110110
memset(per_cpu_ptr(stats, c), 0, sizeof(*stats));
111-
per_cpu_ptr(stats, c)->s.vn_active = vn_active;
111+
per_cpu_ptr(stats, c)->s.xs_inodes_active = xs_inodes_active;
112112
preempt_enable();
113113
}
114114
}

fs/xfs/xfs_stats.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,14 @@ struct __xfsstats {
100100
uint32_t xs_iflush_count;
101101
uint32_t xs_icluster_flushcnt;
102102
uint32_t xs_icluster_flushinode;
103-
uint32_t vn_active; /* # vnodes not on free lists */
104-
uint32_t vn_alloc; /* # times vn_alloc called */
105-
uint32_t vn_get; /* # times vn_get called */
106-
uint32_t vn_hold; /* # times vn_hold called */
107-
uint32_t vn_rele; /* # times vn_rele called */
108-
uint32_t vn_reclaim; /* # times vn_reclaim called */
109-
uint32_t vn_remove; /* # times vn_remove called */
110-
uint32_t vn_free; /* # times vn_free called */
103+
uint32_t xs_inodes_active;
104+
uint32_t __unused_vn_alloc;
105+
uint32_t __unused_vn_get;
106+
uint32_t __unused_vn_hold;
107+
uint32_t xs_inode_destroy;
108+
uint32_t xs_inode_destroy2; /* same as xs_inode_destroy */
109+
uint32_t xs_inode_mark_reclaimable;
110+
uint32_t __unused_vn_free;
111111
uint32_t xb_get;
112112
uint32_t xb_create;
113113
uint32_t xb_get_locked;

fs/xfs/xfs_super.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,8 +712,8 @@ xfs_fs_destroy_inode(
712712
trace_xfs_destroy_inode(ip);
713713

714714
ASSERT(!rwsem_is_locked(&inode->i_rwsem));
715-
XFS_STATS_INC(ip->i_mount, vn_rele);
716-
XFS_STATS_INC(ip->i_mount, vn_remove);
715+
XFS_STATS_INC(ip->i_mount, xs_inode_destroy);
716+
XFS_STATS_INC(ip->i_mount, xs_inode_destroy2);
717717
xfs_inode_mark_reclaimable(ip);
718718
}
719719

0 commit comments

Comments
 (0)