xfs: create symlink proc/fs/xfs/stat to sys/fs/xfs/stats
PATCH 2/3 xfs: create symlink proc/fs/xfs/stat to sys/fs/xfs/stats
As a part of the work to move xfs global stats from procfs to sysfs, this patch creates the symlink from proc/fs/xfs/stat to sys/fs/xfs/stats.
Signed-off-by Bill O'Donnell <[email protected]>
--- fs/xfs/xfs_stats.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/xfs/xfs_stats.c +3 -2
@@ -244,9 +244,10 @@ xfs_init_procfs(void)if (!proc_mkdir ("fs/xfs" ,NULL )) goto out; -if (!proc_create ("fs/xfs/stat" ,0 ,NULL , - &xfs_stat_proc_fops)) +if (!proc_symlink ("fs/xfs/stat" ,NULL , +"/sys/fs/xfs/stats/stats" )) goto out_remove_xfs_dir; +#ifdef CONFIG_XFS_QUOTA if (!proc_create ("fs/xfs/xqmstat" ,0 ,NULL , &xqmstat_proc_fops))
Signature · 6 lines
2.4.3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH 3/3 xfs: remove unused procfs code
As a part of the work to move xfs global stats from procfs to sysfs, this patch removes the now unused procfs code that was xfs stat specific.
Signed-off-by Bill O'Donnell <[email protected]>
--- fs/xfs/xfs_stats.c | 74 ------------------------------------------------------ 1 file changed, 74 deletions(-)
fs/xfs/xfs_stats.c +0 -74
@@ -112,80 +112,6 @@ void xfs_stats_clearall(void) } } -static int xfs_stat_proc_show (struct seq_file *m,void *v) -{ -int i, j; -__uint64_t xs_xstrat_bytes =0 ; -__uint64_t xs_write_bytes =0 ; -__uint64_t xs_read_bytes =0 ; - -static const struct xstats_entry { -char *desc; -int endpoint; - } xstats[] = { - {"extent_alloc" ,XFSSTAT_END_EXTENT_ALLOC }, - {"abt" ,XFSSTAT_END_ALLOC_BTREE }, - {"blk_map" ,XFSSTAT_END_BLOCK_MAPPING }, - {"bmbt" ,XFSSTAT_END_BLOCK_MAP_BTREE }, - {"dir" ,XFSSTAT_END_DIRECTORY_OPS }, - {"trans" ,XFSSTAT_END_TRANSACTIONS }, - {"ig" ,XFSSTAT_END_INODE_OPS }, - {"log" ,XFSSTAT_END_LOG_OPS }, - {"push_ail" ,XFSSTAT_END_TAIL_PUSHING }, - {"xstrat" ,XFSSTAT_END_WRITE_CONVERT }, - {"rw" ,XFSSTAT_END_READ_WRITE_OPS }, - {"attr" ,XFSSTAT_END_ATTRIBUTE_OPS }, - {"icluster" ,XFSSTAT_END_INODE_CLUSTER }, - {"vnodes" ,XFSSTAT_END_VNODE_OPS }, - {"buf" ,XFSSTAT_END_BUF }, - {"abtb2" ,XFSSTAT_END_ABTB_V2 }, - {"abtc2" ,XFSSTAT_END_ABTC_V2 }, - {"bmbt2" ,XFSSTAT_END_BMBT_V2 }, - {"ibt2" ,XFSSTAT_END_IBT_V2 }, - {"fibt2" ,XFSSTAT_END_FIBT_V2 }, -/* we print both series of quota information together */ - {"qm" ,XFSSTAT_END_QM }, - }; - -/* Loop over all stats groups */ -for (i = j =0 ; i <ARRAY_SIZE (xstats); i++) { -seq_printf (m,"%s" , xstats[i].desc); -/* inner loop does each group */ -for (; j < xstats[i].endpoint; j++) -seq_printf (m," %u" ,counter_val (j)); -seq_putc (m,'\n' ); - } -/* extra precision counters */ -for_each_possible_cpu (i) { - xs_xstrat_bytes +=per_cpu (xfsstats, i).xs_xstrat_bytes; - xs_write_bytes +=per_cpu (xfsstats, i).xs_write_bytes; - xs_read_bytes +=per_cpu (xfsstats, i).xs_read_bytes; - } - -seq_printf (m,"xpc %Lu %Lu %Lu\n" , - xs_xstrat_bytes, xs_write_bytes, xs_read_bytes); -seq_printf (m,"debug %u\n" , -#if defined(DEBUG) - 1); -#else - 0); -#endif -return 0 ; -} - -static int xfs_stat_proc_open (struct inode *inode,struct file *file) -{ -return single_open (file, xfs_stat_proc_show,NULL ); -} - -static const struct file_operations xfs_stat_proc_fops = { - .owner =THIS_MODULE , - .open = xfs_stat_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; -/* legacy quota interfaces */ #ifdef CONFIG_XFS_QUOTA static int xqm_proc_show (struct seq_file *m,void *v)
Signature · 6 lines
2.4.3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs