xfs: drop dmapi hooks
[deliverable/linux.git] / fs / xfs / quota / xfs_qm_stats.c
CommitLineData
1da177e4 1/*
4ce3121f
NS
2 * Copyright (c) 2000-2003 Silicon Graphics, Inc.
3 * All Rights Reserved.
1da177e4 4 *
4ce3121f
NS
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
1da177e4
LT
7 * published by the Free Software Foundation.
8 *
4ce3121f
NS
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
1da177e4 13 *
4ce3121f
NS
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1da177e4 17 */
1da177e4
LT
18#include "xfs.h"
19#include "xfs_fs.h"
a844f451 20#include "xfs_bit.h"
1da177e4 21#include "xfs_log.h"
a844f451 22#include "xfs_inum.h"
1da177e4
LT
23#include "xfs_trans.h"
24#include "xfs_sb.h"
a844f451 25#include "xfs_ag.h"
1da177e4
LT
26#include "xfs_dir2.h"
27#include "xfs_alloc.h"
1da177e4
LT
28#include "xfs_quota.h"
29#include "xfs_mount.h"
1da177e4 30#include "xfs_bmap_btree.h"
a844f451 31#include "xfs_alloc_btree.h"
1da177e4 32#include "xfs_ialloc_btree.h"
1da177e4 33#include "xfs_dir2_sf.h"
a844f451 34#include "xfs_attr_sf.h"
1da177e4
LT
35#include "xfs_dinode.h"
36#include "xfs_inode.h"
a844f451
NS
37#include "xfs_ialloc.h"
38#include "xfs_itable.h"
1da177e4 39#include "xfs_bmap.h"
a844f451 40#include "xfs_btree.h"
1da177e4
LT
41#include "xfs_rtalloc.h"
42#include "xfs_error.h"
1da177e4 43#include "xfs_rw.h"
1da177e4
LT
44#include "xfs_attr.h"
45#include "xfs_buf_item.h"
1da177e4
LT
46#include "xfs_qm.h"
47
48struct xqmstats xqmstats;
49
361735fd 50static int xqm_proc_show(struct seq_file *m, void *v)
1da177e4 51{
1da177e4 52 /* maximum; incore; ratio free to inuse; freelist */
361735fd 53 seq_printf(m, "%d\t%d\t%d\t%u\n",
1da177e4
LT
54 ndquot,
55 xfs_Gqm? atomic_read(&xfs_Gqm->qm_totaldquots) : 0,
56 xfs_Gqm? xfs_Gqm->qm_dqfree_ratio : 0,
3a8406f6 57 xfs_Gqm? xfs_Gqm->qm_dqfrlist_cnt : 0);
361735fd 58 return 0;
1da177e4
LT
59}
60
361735fd 61static int xqm_proc_open(struct inode *inode, struct file *file)
1da177e4 62{
361735fd
AD
63 return single_open(file, xqm_proc_show, NULL);
64}
65
66static const struct file_operations xqm_proc_fops = {
67 .owner = THIS_MODULE,
68 .open = xqm_proc_open,
69 .read = seq_read,
70 .llseek = seq_lseek,
71 .release = single_release,
72};
1da177e4 73
361735fd
AD
74static int xqmstat_proc_show(struct seq_file *m, void *v)
75{
1da177e4 76 /* quota performance statistics */
361735fd 77 seq_printf(m, "qm %u %u %u %u %u %u %u %u\n",
1da177e4
LT
78 xqmstats.xs_qm_dqreclaims,
79 xqmstats.xs_qm_dqreclaim_misses,
80 xqmstats.xs_qm_dquot_dups,
81 xqmstats.xs_qm_dqcachemisses,
82 xqmstats.xs_qm_dqcachehits,
83 xqmstats.xs_qm_dqwants,
84 xqmstats.xs_qm_dqshake_reclaims,
85 xqmstats.xs_qm_dqinact_reclaims);
361735fd
AD
86 return 0;
87}
1da177e4 88
361735fd
AD
89static int xqmstat_proc_open(struct inode *inode, struct file *file)
90{
91 return single_open(file, xqmstat_proc_show, NULL);
1da177e4
LT
92}
93
361735fd
AD
94static const struct file_operations xqmstat_proc_fops = {
95 .owner = THIS_MODULE,
96 .open = xqmstat_proc_open,
97 .read = seq_read,
98 .llseek = seq_lseek,
99 .release = single_release,
100};
101
1da177e4
LT
102void
103xfs_qm_init_procfs(void)
104{
361735fd
AD
105 proc_create("fs/xfs/xqmstat", 0, NULL, &xqmstat_proc_fops);
106 proc_create("fs/xfs/xqm", 0, NULL, &xqm_proc_fops);
1da177e4
LT
107}
108
109void
110xfs_qm_cleanup_procfs(void)
111{
112 remove_proc_entry("fs/xfs/xqm", NULL);
113 remove_proc_entry("fs/xfs/xqmstat", NULL);
114}
This page took 0.499956 seconds and 5 git commands to generate.