2 * Copyright (c) 2001-2004 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/
33 #include <linux/sysctl.h>
34 #include <linux/proc_fs.h>
37 static struct ctl_table_header
*xfs_table_header
;
42 xfs_stats_clear_proc_handler(
50 int c
, ret
, *valp
= ctl
->data
;
53 ret
= proc_dointvec_minmax(ctl
, write
, filp
, buffer
, lenp
, ppos
);
55 if (!ret
&& write
&& *valp
) {
56 printk("XFS Clearing xfsstats\n");
57 for (c
= 0; c
< NR_CPUS
; c
++) {
58 if (!cpu_possible(c
)) continue;
60 /* save vn_active, it's a universal truth! */
61 vn_active
= per_cpu(xfsstats
, c
).vn_active
;
62 memset(&per_cpu(xfsstats
, c
), 0,
63 sizeof(struct xfsstats
));
64 per_cpu(xfsstats
, c
).vn_active
= vn_active
;
72 #endif /* CONFIG_PROC_FS */
74 STATIC ctl_table xfs_table
[] = {
75 {XFS_RESTRICT_CHOWN
, "restrict_chown", &xfs_params
.restrict_chown
.val
,
76 sizeof(int), 0644, NULL
, &proc_dointvec_minmax
,
78 &xfs_params
.restrict_chown
.min
, &xfs_params
.restrict_chown
.max
},
80 {XFS_SGID_INHERIT
, "irix_sgid_inherit", &xfs_params
.sgid_inherit
.val
,
81 sizeof(int), 0644, NULL
, &proc_dointvec_minmax
,
83 &xfs_params
.sgid_inherit
.min
, &xfs_params
.sgid_inherit
.max
},
85 {XFS_SYMLINK_MODE
, "irix_symlink_mode", &xfs_params
.symlink_mode
.val
,
86 sizeof(int), 0644, NULL
, &proc_dointvec_minmax
,
88 &xfs_params
.symlink_mode
.min
, &xfs_params
.symlink_mode
.max
},
90 {XFS_PANIC_MASK
, "panic_mask", &xfs_params
.panic_mask
.val
,
91 sizeof(int), 0644, NULL
, &proc_dointvec_minmax
,
93 &xfs_params
.panic_mask
.min
, &xfs_params
.panic_mask
.max
},
95 {XFS_ERRLEVEL
, "error_level", &xfs_params
.error_level
.val
,
96 sizeof(int), 0644, NULL
, &proc_dointvec_minmax
,
98 &xfs_params
.error_level
.min
, &xfs_params
.error_level
.max
},
100 {XFS_SYNCD_TIMER
, "xfssyncd_centisecs", &xfs_params
.syncd_timer
.val
,
101 sizeof(int), 0644, NULL
, &proc_dointvec_minmax
,
102 &sysctl_intvec
, NULL
,
103 &xfs_params
.syncd_timer
.min
, &xfs_params
.syncd_timer
.max
},
105 {XFS_INHERIT_SYNC
, "inherit_sync", &xfs_params
.inherit_sync
.val
,
106 sizeof(int), 0644, NULL
, &proc_dointvec_minmax
,
107 &sysctl_intvec
, NULL
,
108 &xfs_params
.inherit_sync
.min
, &xfs_params
.inherit_sync
.max
},
110 {XFS_INHERIT_NODUMP
, "inherit_nodump", &xfs_params
.inherit_nodump
.val
,
111 sizeof(int), 0644, NULL
, &proc_dointvec_minmax
,
112 &sysctl_intvec
, NULL
,
113 &xfs_params
.inherit_nodump
.min
, &xfs_params
.inherit_nodump
.max
},
115 {XFS_INHERIT_NOATIME
, "inherit_noatime", &xfs_params
.inherit_noatim
.val
,
116 sizeof(int), 0644, NULL
, &proc_dointvec_minmax
,
117 &sysctl_intvec
, NULL
,
118 &xfs_params
.inherit_noatim
.min
, &xfs_params
.inherit_noatim
.max
},
120 {XFS_BUF_TIMER
, "xfsbufd_centisecs", &xfs_params
.xfs_buf_timer
.val
,
121 sizeof(int), 0644, NULL
, &proc_dointvec_minmax
,
122 &sysctl_intvec
, NULL
,
123 &xfs_params
.xfs_buf_timer
.min
, &xfs_params
.xfs_buf_timer
.max
},
125 {XFS_BUF_AGE
, "age_buffer_centisecs", &xfs_params
.xfs_buf_age
.val
,
126 sizeof(int), 0644, NULL
, &proc_dointvec_minmax
,
127 &sysctl_intvec
, NULL
,
128 &xfs_params
.xfs_buf_age
.min
, &xfs_params
.xfs_buf_age
.max
},
130 {XFS_INHERIT_NOSYM
, "inherit_nosymlinks", &xfs_params
.inherit_nosym
.val
,
131 sizeof(int), 0644, NULL
, &proc_dointvec_minmax
,
132 &sysctl_intvec
, NULL
,
133 &xfs_params
.inherit_nosym
.min
, &xfs_params
.inherit_nosym
.max
},
135 {XFS_ROTORSTEP
, "rotorstep", &xfs_params
.rotorstep
.val
,
136 sizeof(int), 0644, NULL
, &proc_dointvec_minmax
,
137 &sysctl_intvec
, NULL
,
138 &xfs_params
.rotorstep
.min
, &xfs_params
.rotorstep
.max
},
140 /* please keep this the last entry */
141 #ifdef CONFIG_PROC_FS
142 {XFS_STATS_CLEAR
, "stats_clear", &xfs_params
.stats_clear
.val
,
143 sizeof(int), 0644, NULL
, &xfs_stats_clear_proc_handler
,
144 &sysctl_intvec
, NULL
,
145 &xfs_params
.stats_clear
.min
, &xfs_params
.stats_clear
.max
},
146 #endif /* CONFIG_PROC_FS */
151 STATIC ctl_table xfs_dir_table
[] = {
152 {FS_XFS
, "xfs", NULL
, 0, 0555, xfs_table
},
156 STATIC ctl_table xfs_root_table
[] = {
157 {CTL_FS
, "fs", NULL
, 0, 0555, xfs_dir_table
},
162 xfs_sysctl_register(void)
164 xfs_table_header
= register_sysctl_table(xfs_root_table
, 1);
168 xfs_sysctl_unregister(void)
170 if (xfs_table_header
)
171 unregister_sysctl_table(xfs_table_header
);