2 * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of version 2 of the GNU General Public License as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it would be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * Further, this software is distributed without any warranty that it is
13 * free of the rightful claim of any third person regarding infringement
14 * or the like. Any license provided herein, whether implied or
15 * otherwise, applies only to this software file. Patent licenses, if
16 * any, provided herein do not apply to combinations of this program with
17 * other software, or any other product whatsoever.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write the Free Software Foundation, Inc., 59
21 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
23 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24 * Mountain View, CA 94043, or:
28 * For further information regarding this notice, see:
30 * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
38 #include "xfs_trans.h"
43 #include "xfs_alloc.h"
44 #include "xfs_dmapi.h"
45 #include "xfs_quota.h"
46 #include "xfs_mount.h"
47 #include "xfs_bmap_btree.h"
48 #include "xfs_alloc_btree.h"
49 #include "xfs_ialloc_btree.h"
50 #include "xfs_dir_sf.h"
51 #include "xfs_dir2_sf.h"
52 #include "xfs_attr_sf.h"
53 #include "xfs_dinode.h"
54 #include "xfs_inode.h"
55 #include "xfs_ialloc.h"
56 #include "xfs_itable.h"
58 #include "xfs_btree.h"
59 #include "xfs_rtalloc.h"
60 #include "xfs_error.h"
66 #include "xfs_buf_item.h"
70 struct xqmstats xqmstats;
83 /* maximum; incore; ratio free to inuse; freelist */
84 len = sprintf(buffer, "%d\t%d\t%d\t%u\n",
86 xfs_Gqm? atomic_read(&xfs_Gqm->qm_totaldquots) : 0,
87 xfs_Gqm? xfs_Gqm->qm_dqfree_ratio : 0,
88 xfs_Gqm? xfs_Gqm->qm_dqfreelist.qh_nelems : 0);
95 *start = buffer + offset;
96 if ((len -= offset) > count)
114 /* quota performance statistics */
115 len = sprintf(buffer, "qm %u %u %u %u %u %u %u %u\n",
116 xqmstats.xs_qm_dqreclaims,
117 xqmstats.xs_qm_dqreclaim_misses,
118 xqmstats.xs_qm_dquot_dups,
119 xqmstats.xs_qm_dqcachemisses,
120 xqmstats.xs_qm_dqcachehits,
121 xqmstats.xs_qm_dqwants,
122 xqmstats.xs_qm_dqshake_reclaims,
123 xqmstats.xs_qm_dqinact_reclaims);
130 *start = buffer + offset;
131 if ((len -= offset) > count)
139 xfs_qm_init_procfs(void)
141 create_proc_read_entry("fs/xfs/xqmstat", 0, NULL, xfs_qm_read_stats, NULL);
142 create_proc_read_entry("fs/xfs/xqm", 0, NULL, xfs_qm_read_xfsquota, NULL);
146 xfs_qm_cleanup_procfs(void)
148 remove_proc_entry("fs/xfs/xqm", NULL);
149 remove_proc_entry("fs/xfs/xqmstat", NULL);