Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xfs: active inodes stat is broken

vn_active only ever gets decremented, so it has a very large
negative number. Make it track the inode count we currently have
allocated properly so we can easily track the size of the inode
cache via tools like PCP.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>

authored by

Dave Chinner and committed by
Dave Chinner
cdc9cec7 4db431f5

+2 -1
+2
fs/xfs/xfs_icache.c
··· 65 65 return NULL; 66 66 } 67 67 68 + XFS_STATS_INC(vn_active); 68 69 ASSERT(atomic_read(&ip->i_pincount) == 0); 69 70 ASSERT(!spin_is_locked(&ip->i_flags_lock)); 70 71 ASSERT(!xfs_isiflocked(ip)); ··· 131 130 /* asserts to verify all state is correct here */ 132 131 ASSERT(atomic_read(&ip->i_pincount) == 0); 133 132 ASSERT(!xfs_isiflocked(ip)); 133 + XFS_STATS_DEC(vn_active); 134 134 135 135 call_rcu(&VFS_I(ip)->i_rcu, xfs_inode_free_callback); 136 136 }
-1
fs/xfs/xfs_super.c
··· 1008 1008 clear_inode(inode); 1009 1009 XFS_STATS_INC(vn_rele); 1010 1010 XFS_STATS_INC(vn_remove); 1011 - XFS_STATS_DEC(vn_active); 1012 1011 1013 1012 xfs_inactive(ip); 1014 1013 }