diff options
author | Bill O'Donnell <billodo@redhat.com> | 2015-10-12 05:15:45 +1100 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2015-10-12 05:15:45 +1100 |
commit | bb230c124730f21eea13deab433f9f8fc96bd5f3 (patch) | |
tree | d01a02b30ce4a5aa04a371e416b22f9f6d533217 /fs/xfs/xfs_sysctl.c | |
parent | 1f93e4a96c9109378204c147b3eec0d0e8100fde (diff) |
xfs: create global stats and stats_clear in sysfs
Currently, xfs global stats are in procfs. This patch introduces
(replicates) the global stats in sysfs. Additionally a stats_clear file
is introduced in sysfs.
Signed-off-by: Bill O'Donnell <billodo@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_sysctl.c')
-rw-r--r-- | fs/xfs/xfs_sysctl.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/fs/xfs/xfs_sysctl.c b/fs/xfs/xfs_sysctl.c index a0c8067cea6f..5defabb391cb 100644 --- a/fs/xfs/xfs_sysctl.c +++ b/fs/xfs/xfs_sysctl.c @@ -19,6 +19,7 @@ #include <linux/sysctl.h> #include <linux/proc_fs.h> #include "xfs_error.h" +#include "xfs_stats.h" static struct ctl_table_header *xfs_table_header; @@ -31,22 +32,12 @@ xfs_stats_clear_proc_handler( size_t *lenp, loff_t *ppos) { - int c, ret, *valp = ctl->data; - __uint32_t vn_active; + int ret, *valp = ctl->data; ret = proc_dointvec_minmax(ctl, write, buffer, lenp, ppos); if (!ret && write && *valp) { - xfs_notice(NULL, "Clearing xfsstats"); - for_each_possible_cpu(c) { - preempt_disable(); - /* save vn_active, it's a universal truth! */ - vn_active = per_cpu(xfsstats, c).vn_active; - memset(&per_cpu(xfsstats, c), 0, - sizeof(struct xfsstats)); - per_cpu(xfsstats, c).vn_active = vn_active; - preempt_enable(); - } + xfs_stats_clearall(); xfs_stats_clear = 0; } |