2 * Copyright (c) 2000-2003 Silicon Graphics, Inc.
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
7 * published by the Free Software Foundation.
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.
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
23 #include "xfs_trans.h"
27 #include "xfs_alloc.h"
28 #include "xfs_dmapi.h"
29 #include "xfs_quota.h"
30 #include "xfs_mount.h"
31 #include "xfs_bmap_btree.h"
32 #include "xfs_alloc_btree.h"
33 #include "xfs_ialloc_btree.h"
34 #include "xfs_dir2_sf.h"
35 #include "xfs_attr_sf.h"
36 #include "xfs_dinode.h"
37 #include "xfs_inode.h"
38 #include "xfs_ialloc.h"
39 #include "xfs_itable.h"
41 #include "xfs_btree.h"
42 #include "xfs_rtalloc.h"
43 #include "xfs_error.h"
47 #include "xfs_buf_item.h"
50 struct xqmstats xqmstats
;
63 /* maximum; incore; ratio free to inuse; freelist */
64 len
= sprintf(buffer
, "%d\t%d\t%d\t%u\n",
66 xfs_Gqm
? atomic_read(&xfs_Gqm
->qm_totaldquots
) : 0,
67 xfs_Gqm
? xfs_Gqm
->qm_dqfree_ratio
: 0,
68 xfs_Gqm
? xfs_Gqm
->qm_dqfreelist
.qh_nelems
: 0);
75 *start
= buffer
+ offset
;
76 if ((len
-= offset
) > count
)
94 /* quota performance statistics */
95 len
= sprintf(buffer
, "qm %u %u %u %u %u %u %u %u\n",
96 xqmstats
.xs_qm_dqreclaims
,
97 xqmstats
.xs_qm_dqreclaim_misses
,
98 xqmstats
.xs_qm_dquot_dups
,
99 xqmstats
.xs_qm_dqcachemisses
,
100 xqmstats
.xs_qm_dqcachehits
,
101 xqmstats
.xs_qm_dqwants
,
102 xqmstats
.xs_qm_dqshake_reclaims
,
103 xqmstats
.xs_qm_dqinact_reclaims
);
110 *start
= buffer
+ offset
;
111 if ((len
-= offset
) > count
)
119 xfs_qm_init_procfs(void)
121 create_proc_read_entry("fs/xfs/xqmstat", 0, NULL
, xfs_qm_read_stats
, NULL
);
122 create_proc_read_entry("fs/xfs/xqm", 0, NULL
, xfs_qm_read_xfsquota
, NULL
);
126 xfs_qm_cleanup_procfs(void)
128 remove_proc_entry("fs/xfs/xqm", NULL
);
129 remove_proc_entry("fs/xfs/xqmstat", NULL
);