1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2001-2005 Silicon Graphics, Inc.
9 static struct ctl_table_header
*xfs_table_header
;
13 xfs_stats_clear_proc_handler(
14 struct ctl_table
*ctl
,
20 int ret
, *valp
= ctl
->data
;
22 ret
= proc_dointvec_minmax(ctl
, write
, buffer
, lenp
, ppos
);
24 if (!ret
&& write
&& *valp
) {
25 xfs_stats_clearall(xfsstats
.xs_stats
);
33 xfs_panic_mask_proc_handler(
34 struct ctl_table
*ctl
,
40 int ret
, *valp
= ctl
->data
;
42 ret
= proc_dointvec_minmax(ctl
, write
, buffer
, lenp
, ppos
);
44 xfs_panic_mask
= *valp
;
46 xfs_panic_mask
|= (XFS_PTAG_SHUTDOWN_CORRUPT
| XFS_PTAG_LOGRES
);
51 #endif /* CONFIG_PROC_FS */
53 static struct ctl_table xfs_table
[] = {
55 .procname
= "irix_sgid_inherit",
56 .data
= &xfs_params
.sgid_inherit
.val
,
57 .maxlen
= sizeof(int),
59 .proc_handler
= proc_dointvec_minmax
,
60 .extra1
= &xfs_params
.sgid_inherit
.min
,
61 .extra2
= &xfs_params
.sgid_inherit
.max
64 .procname
= "irix_symlink_mode",
65 .data
= &xfs_params
.symlink_mode
.val
,
66 .maxlen
= sizeof(int),
68 .proc_handler
= proc_dointvec_minmax
,
69 .extra1
= &xfs_params
.symlink_mode
.min
,
70 .extra2
= &xfs_params
.symlink_mode
.max
73 .procname
= "panic_mask",
74 .data
= &xfs_params
.panic_mask
.val
,
75 .maxlen
= sizeof(int),
77 .proc_handler
= xfs_panic_mask_proc_handler
,
78 .extra1
= &xfs_params
.panic_mask
.min
,
79 .extra2
= &xfs_params
.panic_mask
.max
83 .procname
= "error_level",
84 .data
= &xfs_params
.error_level
.val
,
85 .maxlen
= sizeof(int),
87 .proc_handler
= proc_dointvec_minmax
,
88 .extra1
= &xfs_params
.error_level
.min
,
89 .extra2
= &xfs_params
.error_level
.max
92 .procname
= "xfssyncd_centisecs",
93 .data
= &xfs_params
.syncd_timer
.val
,
94 .maxlen
= sizeof(int),
96 .proc_handler
= proc_dointvec_minmax
,
97 .extra1
= &xfs_params
.syncd_timer
.min
,
98 .extra2
= &xfs_params
.syncd_timer
.max
101 .procname
= "inherit_sync",
102 .data
= &xfs_params
.inherit_sync
.val
,
103 .maxlen
= sizeof(int),
105 .proc_handler
= proc_dointvec_minmax
,
106 .extra1
= &xfs_params
.inherit_sync
.min
,
107 .extra2
= &xfs_params
.inherit_sync
.max
110 .procname
= "inherit_nodump",
111 .data
= &xfs_params
.inherit_nodump
.val
,
112 .maxlen
= sizeof(int),
114 .proc_handler
= proc_dointvec_minmax
,
115 .extra1
= &xfs_params
.inherit_nodump
.min
,
116 .extra2
= &xfs_params
.inherit_nodump
.max
119 .procname
= "inherit_noatime",
120 .data
= &xfs_params
.inherit_noatim
.val
,
121 .maxlen
= sizeof(int),
123 .proc_handler
= proc_dointvec_minmax
,
124 .extra1
= &xfs_params
.inherit_noatim
.min
,
125 .extra2
= &xfs_params
.inherit_noatim
.max
128 .procname
= "inherit_nosymlinks",
129 .data
= &xfs_params
.inherit_nosym
.val
,
130 .maxlen
= sizeof(int),
132 .proc_handler
= proc_dointvec_minmax
,
133 .extra1
= &xfs_params
.inherit_nosym
.min
,
134 .extra2
= &xfs_params
.inherit_nosym
.max
137 .procname
= "rotorstep",
138 .data
= &xfs_params
.rotorstep
.val
,
139 .maxlen
= sizeof(int),
141 .proc_handler
= proc_dointvec_minmax
,
142 .extra1
= &xfs_params
.rotorstep
.min
,
143 .extra2
= &xfs_params
.rotorstep
.max
146 .procname
= "inherit_nodefrag",
147 .data
= &xfs_params
.inherit_nodfrg
.val
,
148 .maxlen
= sizeof(int),
150 .proc_handler
= proc_dointvec_minmax
,
151 .extra1
= &xfs_params
.inherit_nodfrg
.min
,
152 .extra2
= &xfs_params
.inherit_nodfrg
.max
155 .procname
= "filestream_centisecs",
156 .data
= &xfs_params
.fstrm_timer
.val
,
157 .maxlen
= sizeof(int),
159 .proc_handler
= proc_dointvec_minmax
,
160 .extra1
= &xfs_params
.fstrm_timer
.min
,
161 .extra2
= &xfs_params
.fstrm_timer
.max
,
164 .procname
= "speculative_prealloc_lifetime",
165 .data
= &xfs_params
.eofb_timer
.val
,
166 .maxlen
= sizeof(int),
168 .proc_handler
= proc_dointvec_minmax
,
169 .extra1
= &xfs_params
.eofb_timer
.min
,
170 .extra2
= &xfs_params
.eofb_timer
.max
,
173 .procname
= "speculative_cow_prealloc_lifetime",
174 .data
= &xfs_params
.cowb_timer
.val
,
175 .maxlen
= sizeof(int),
177 .proc_handler
= proc_dointvec_minmax
,
178 .extra1
= &xfs_params
.cowb_timer
.min
,
179 .extra2
= &xfs_params
.cowb_timer
.max
,
181 /* please keep this the last entry */
182 #ifdef CONFIG_PROC_FS
184 .procname
= "stats_clear",
185 .data
= &xfs_params
.stats_clear
.val
,
186 .maxlen
= sizeof(int),
188 .proc_handler
= xfs_stats_clear_proc_handler
,
189 .extra1
= &xfs_params
.stats_clear
.min
,
190 .extra2
= &xfs_params
.stats_clear
.max
192 #endif /* CONFIG_PROC_FS */
197 static struct ctl_table xfs_dir_table
[] = {
206 static struct ctl_table xfs_root_table
[] = {
210 .child
= xfs_dir_table
216 xfs_sysctl_register(void)
218 xfs_table_header
= register_sysctl_table(xfs_root_table
);
219 if (!xfs_table_header
)
225 xfs_sysctl_unregister(void)
227 unregister_sysctl_table(xfs_table_header
);