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 */
54 xfs_deprecated_dointvec_minmax(
55 struct ctl_table *ctl,
62 printk_ratelimited(KERN_WARNING
63 "XFS: %s sysctl option is deprecated.\n",
66 return proc_dointvec_minmax(ctl, write, buffer, lenp, ppos);
69 static struct ctl_table xfs_table[] = {
71 .procname = "irix_sgid_inherit",
72 .data = &xfs_params.sgid_inherit.val,
73 .maxlen = sizeof(int),
75 .proc_handler = xfs_deprecated_dointvec_minmax,
76 .extra1 = &xfs_params.sgid_inherit.min,
77 .extra2 = &xfs_params.sgid_inherit.max
80 .procname = "irix_symlink_mode",
81 .data = &xfs_params.symlink_mode.val,
82 .maxlen = sizeof(int),
84 .proc_handler = xfs_deprecated_dointvec_minmax,
85 .extra1 = &xfs_params.symlink_mode.min,
86 .extra2 = &xfs_params.symlink_mode.max
89 .procname = "panic_mask",
90 .data = &xfs_params.panic_mask.val,
91 .maxlen = sizeof(int),
93 .proc_handler = xfs_panic_mask_proc_handler,
94 .extra1 = &xfs_params.panic_mask.min,
95 .extra2 = &xfs_params.panic_mask.max
99 .procname = "error_level",
100 .data = &xfs_params.error_level.val,
101 .maxlen = sizeof(int),
103 .proc_handler = proc_dointvec_minmax,
104 .extra1 = &xfs_params.error_level.min,
105 .extra2 = &xfs_params.error_level.max
108 .procname = "xfssyncd_centisecs",
109 .data = &xfs_params.syncd_timer.val,
110 .maxlen = sizeof(int),
112 .proc_handler = proc_dointvec_minmax,
113 .extra1 = &xfs_params.syncd_timer.min,
114 .extra2 = &xfs_params.syncd_timer.max
117 .procname = "inherit_sync",
118 .data = &xfs_params.inherit_sync.val,
119 .maxlen = sizeof(int),
121 .proc_handler = proc_dointvec_minmax,
122 .extra1 = &xfs_params.inherit_sync.min,
123 .extra2 = &xfs_params.inherit_sync.max
126 .procname = "inherit_nodump",
127 .data = &xfs_params.inherit_nodump.val,
128 .maxlen = sizeof(int),
130 .proc_handler = proc_dointvec_minmax,
131 .extra1 = &xfs_params.inherit_nodump.min,
132 .extra2 = &xfs_params.inherit_nodump.max
135 .procname = "inherit_noatime",
136 .data = &xfs_params.inherit_noatim.val,
137 .maxlen = sizeof(int),
139 .proc_handler = proc_dointvec_minmax,
140 .extra1 = &xfs_params.inherit_noatim.min,
141 .extra2 = &xfs_params.inherit_noatim.max
144 .procname = "inherit_nosymlinks",
145 .data = &xfs_params.inherit_nosym.val,
146 .maxlen = sizeof(int),
148 .proc_handler = proc_dointvec_minmax,
149 .extra1 = &xfs_params.inherit_nosym.min,
150 .extra2 = &xfs_params.inherit_nosym.max
153 .procname = "rotorstep",
154 .data = &xfs_params.rotorstep.val,
155 .maxlen = sizeof(int),
157 .proc_handler = proc_dointvec_minmax,
158 .extra1 = &xfs_params.rotorstep.min,
159 .extra2 = &xfs_params.rotorstep.max
162 .procname = "inherit_nodefrag",
163 .data = &xfs_params.inherit_nodfrg.val,
164 .maxlen = sizeof(int),
166 .proc_handler = proc_dointvec_minmax,
167 .extra1 = &xfs_params.inherit_nodfrg.min,
168 .extra2 = &xfs_params.inherit_nodfrg.max
171 .procname = "filestream_centisecs",
172 .data = &xfs_params.fstrm_timer.val,
173 .maxlen = sizeof(int),
175 .proc_handler = proc_dointvec_minmax,
176 .extra1 = &xfs_params.fstrm_timer.min,
177 .extra2 = &xfs_params.fstrm_timer.max,
180 .procname = "speculative_prealloc_lifetime",
181 .data = &xfs_params.blockgc_timer.val,
182 .maxlen = sizeof(int),
184 .proc_handler = proc_dointvec_minmax,
185 .extra1 = &xfs_params.blockgc_timer.min,
186 .extra2 = &xfs_params.blockgc_timer.max,
189 .procname = "speculative_cow_prealloc_lifetime",
190 .data = &xfs_params.blockgc_timer.val,
191 .maxlen = sizeof(int),
193 .proc_handler = xfs_deprecated_dointvec_minmax,
194 .extra1 = &xfs_params.blockgc_timer.min,
195 .extra2 = &xfs_params.blockgc_timer.max,
197 /* please keep this the last entry */
198 #ifdef CONFIG_PROC_FS
200 .procname = "stats_clear",
201 .data = &xfs_params.stats_clear.val,
202 .maxlen = sizeof(int),
204 .proc_handler = xfs_stats_clear_proc_handler,
205 .extra1 = &xfs_params.stats_clear.min,
206 .extra2 = &xfs_params.stats_clear.max
208 #endif /* CONFIG_PROC_FS */
213 static struct ctl_table xfs_dir_table[] = {
222 static struct ctl_table xfs_root_table[] = {
226 .child = xfs_dir_table
232 xfs_sysctl_register(void)
234 xfs_table_header = register_sysctl_table(xfs_root_table);
235 if (!xfs_table_header)
241 xfs_sysctl_unregister(void)
243 unregister_sysctl_table(xfs_table_header);