diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2007-02-10 02:36:59 -0500 |
---|---|---|
committer | Tim Shimmin <tes@sgi.com> | 2007-02-10 02:36:59 -0500 |
commit | 3a68cbfe0277fb73d5f0c2a433884745fb500c38 (patch) | |
tree | 2644f3273a0da495e9fec4db06bd4a58550b8e32 /fs/xfs/linux-2.6 | |
parent | c167b77d5e172a2deb058be442ca652ad3a417f9 (diff) |
[XFS] XFS sysctl cleanups
Removes unneeded sysctl insert at head behaviour. Cleans up sysctl
definitions to use C99 initialisers. Patch provided by Eric W. Biederman.
SGI-PV: 960192
SGI-Modid: xfs-linux-melb:xfs-kern:28031a
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_sysctl.c | 260 |
1 files changed, 181 insertions, 79 deletions
diff --git a/fs/xfs/linux-2.6/xfs_sysctl.c b/fs/xfs/linux-2.6/xfs_sysctl.c index b1036dd5012d..5c46c35a97a5 100644 --- a/fs/xfs/linux-2.6/xfs_sysctl.c +++ b/fs/xfs/linux-2.6/xfs_sysctl.c | |||
@@ -55,101 +55,203 @@ xfs_stats_clear_proc_handler( | |||
55 | #endif /* CONFIG_PROC_FS */ | 55 | #endif /* CONFIG_PROC_FS */ |
56 | 56 | ||
57 | static ctl_table xfs_table[] = { | 57 | static ctl_table xfs_table[] = { |
58 | {XFS_RESTRICT_CHOWN, "restrict_chown", &xfs_params.restrict_chown.val, | 58 | { |
59 | sizeof(int), 0644, NULL, &proc_dointvec_minmax, | 59 | .ctl_name = XFS_RESTRICT_CHOWN, |
60 | &sysctl_intvec, NULL, | 60 | .procname = "restrict_chown", |
61 | &xfs_params.restrict_chown.min, &xfs_params.restrict_chown.max}, | 61 | .data = &xfs_params.restrict_chown.val, |
62 | 62 | .maxlen = sizeof(int), | |
63 | {XFS_SGID_INHERIT, "irix_sgid_inherit", &xfs_params.sgid_inherit.val, | 63 | .mode = 0644, |
64 | sizeof(int), 0644, NULL, &proc_dointvec_minmax, | 64 | .proc_handler = &proc_dointvec_minmax, |
65 | &sysctl_intvec, NULL, | 65 | .strategy = &sysctl_intvec, |
66 | &xfs_params.sgid_inherit.min, &xfs_params.sgid_inherit.max}, | 66 | .extra1 = &xfs_params.restrict_chown.min, |
67 | 67 | .extra2 = &xfs_params.restrict_chown.max | |
68 | {XFS_SYMLINK_MODE, "irix_symlink_mode", &xfs_params.symlink_mode.val, | 68 | }, |
69 | sizeof(int), 0644, NULL, &proc_dointvec_minmax, | 69 | { |
70 | &sysctl_intvec, NULL, | 70 | .ctl_name = XFS_SGID_INHERIT, |
71 | &xfs_params.symlink_mode.min, &xfs_params.symlink_mode.max}, | 71 | .procname = "irix_sgid_inherit", |
72 | 72 | .data = &xfs_params.sgid_inherit.val, | |
73 | {XFS_PANIC_MASK, "panic_mask", &xfs_params.panic_mask.val, | 73 | .maxlen = sizeof(int), |
74 | sizeof(int), 0644, NULL, &proc_dointvec_minmax, | 74 | .mode = 0644, |
75 | &sysctl_intvec, NULL, | 75 | .proc_handler = &proc_dointvec_minmax, |
76 | &xfs_params.panic_mask.min, &xfs_params.panic_mask.max}, | 76 | .strategy = &sysctl_intvec, |
77 | 77 | .extra1 = &xfs_params.sgid_inherit.min, | |
78 | {XFS_ERRLEVEL, "error_level", &xfs_params.error_level.val, | 78 | .extra2 = &xfs_params.sgid_inherit.max |
79 | sizeof(int), 0644, NULL, &proc_dointvec_minmax, | 79 | }, |
80 | &sysctl_intvec, NULL, | 80 | { |
81 | &xfs_params.error_level.min, &xfs_params.error_level.max}, | 81 | .ctl_name = XFS_SYMLINK_MODE, |
82 | 82 | .procname = "irix_symlink_mode", | |
83 | {XFS_SYNCD_TIMER, "xfssyncd_centisecs", &xfs_params.syncd_timer.val, | 83 | .data = &xfs_params.symlink_mode.val, |
84 | sizeof(int), 0644, NULL, &proc_dointvec_minmax, | 84 | .maxlen = sizeof(int), |
85 | &sysctl_intvec, NULL, | 85 | .mode = 0644, |
86 | &xfs_params.syncd_timer.min, &xfs_params.syncd_timer.max}, | 86 | .proc_handler = &proc_dointvec_minmax, |
87 | 87 | .strategy = &sysctl_intvec, | |
88 | {XFS_INHERIT_SYNC, "inherit_sync", &xfs_params.inherit_sync.val, | 88 | .extra1 = &xfs_params.symlink_mode.min, |
89 | sizeof(int), 0644, NULL, &proc_dointvec_minmax, | 89 | .extra2 = &xfs_params.symlink_mode.max |
90 | &sysctl_intvec, NULL, | 90 | }, |
91 | &xfs_params.inherit_sync.min, &xfs_params.inherit_sync.max}, | 91 | { |
92 | 92 | .ctl_name = XFS_PANIC_MASK, | |
93 | {XFS_INHERIT_NODUMP, "inherit_nodump", &xfs_params.inherit_nodump.val, | 93 | .procname = "panic_mask", |
94 | sizeof(int), 0644, NULL, &proc_dointvec_minmax, | 94 | .data = &xfs_params.panic_mask.val, |
95 | &sysctl_intvec, NULL, | 95 | .maxlen = sizeof(int), |
96 | &xfs_params.inherit_nodump.min, &xfs_params.inherit_nodump.max}, | 96 | .mode = 0644, |
97 | 97 | .proc_handler = &proc_dointvec_minmax, | |
98 | {XFS_INHERIT_NOATIME, "inherit_noatime", &xfs_params.inherit_noatim.val, | 98 | .strategy = &sysctl_intvec, |
99 | sizeof(int), 0644, NULL, &proc_dointvec_minmax, | 99 | .extra1 = &xfs_params.panic_mask.min, |
100 | &sysctl_intvec, NULL, | 100 | .extra2 = &xfs_params.panic_mask.max |
101 | &xfs_params.inherit_noatim.min, &xfs_params.inherit_noatim.max}, | 101 | }, |
102 | |||
103 | {XFS_BUF_TIMER, "xfsbufd_centisecs", &xfs_params.xfs_buf_timer.val, | ||
104 | sizeof(int), 0644, NULL, &proc_dointvec_minmax, | ||
105 | &sysctl_intvec, NULL, | ||
106 | &xfs_params.xfs_buf_timer.min, &xfs_params.xfs_buf_timer.max}, | ||
107 | |||
108 | {XFS_BUF_AGE, "age_buffer_centisecs", &xfs_params.xfs_buf_age.val, | ||
109 | sizeof(int), 0644, NULL, &proc_dointvec_minmax, | ||
110 | &sysctl_intvec, NULL, | ||
111 | &xfs_params.xfs_buf_age.min, &xfs_params.xfs_buf_age.max}, | ||
112 | |||
113 | {XFS_INHERIT_NOSYM, "inherit_nosymlinks", &xfs_params.inherit_nosym.val, | ||
114 | sizeof(int), 0644, NULL, &proc_dointvec_minmax, | ||
115 | &sysctl_intvec, NULL, | ||
116 | &xfs_params.inherit_nosym.min, &xfs_params.inherit_nosym.max}, | ||
117 | |||
118 | {XFS_ROTORSTEP, "rotorstep", &xfs_params.rotorstep.val, | ||
119 | sizeof(int), 0644, NULL, &proc_dointvec_minmax, | ||
120 | &sysctl_intvec, NULL, | ||
121 | &xfs_params.rotorstep.min, &xfs_params.rotorstep.max}, | ||
122 | |||
123 | {XFS_INHERIT_NODFRG, "inherit_nodefrag", &xfs_params.inherit_nodfrg.val, | ||
124 | sizeof(int), 0644, NULL, &proc_dointvec_minmax, | ||
125 | &sysctl_intvec, NULL, | ||
126 | &xfs_params.inherit_nodfrg.min, &xfs_params.inherit_nodfrg.max}, | ||
127 | 102 | ||
103 | { | ||
104 | .ctl_name = XFS_ERRLEVEL, | ||
105 | .procname = "error_level", | ||
106 | .data = &xfs_params.error_level.val, | ||
107 | .maxlen = sizeof(int), | ||
108 | .mode = 0644, | ||
109 | .proc_handler = &proc_dointvec_minmax, | ||
110 | .strategy = &sysctl_intvec, | ||
111 | .extra1 = &xfs_params.error_level.min, | ||
112 | .extra2 = &xfs_params.error_level.max | ||
113 | }, | ||
114 | { | ||
115 | .ctl_name = XFS_SYNCD_TIMER, | ||
116 | .procname = "xfssyncd_centisecs", | ||
117 | .data = &xfs_params.syncd_timer.val, | ||
118 | .maxlen = sizeof(int), | ||
119 | .mode = 0644, | ||
120 | .proc_handler = &proc_dointvec_minmax, | ||
121 | .strategy = &sysctl_intvec, | ||
122 | .extra1 = &xfs_params.syncd_timer.min, | ||
123 | .extra2 = &xfs_params.syncd_timer.max | ||
124 | }, | ||
125 | { | ||
126 | .ctl_name = XFS_INHERIT_SYNC, | ||
127 | .procname = "inherit_sync", | ||
128 | .data = &xfs_params.inherit_sync.val, | ||
129 | .maxlen = sizeof(int), | ||
130 | .mode = 0644, | ||
131 | .proc_handler = &proc_dointvec_minmax, | ||
132 | .strategy = &sysctl_intvec, | ||
133 | .extra1 = &xfs_params.inherit_sync.min, | ||
134 | .extra2 = &xfs_params.inherit_sync.max | ||
135 | }, | ||
136 | { | ||
137 | .ctl_name = XFS_INHERIT_NODUMP, | ||
138 | .procname = "inherit_nodump", | ||
139 | .data = &xfs_params.inherit_nodump.val, | ||
140 | .maxlen = sizeof(int), | ||
141 | .mode = 0644, | ||
142 | .proc_handler = &proc_dointvec_minmax, | ||
143 | .strategy = &sysctl_intvec, | ||
144 | .extra1 = &xfs_params.inherit_nodump.min, | ||
145 | .extra2 = &xfs_params.inherit_nodump.max | ||
146 | }, | ||
147 | { | ||
148 | .ctl_name = XFS_INHERIT_NOATIME, | ||
149 | .procname = "inherit_noatime", | ||
150 | .data = &xfs_params.inherit_noatim.val, | ||
151 | .maxlen = sizeof(int), | ||
152 | .mode = 0644, | ||
153 | .proc_handler = &proc_dointvec_minmax, | ||
154 | .strategy = &sysctl_intvec, | ||
155 | .extra1 = &xfs_params.inherit_noatim.min, | ||
156 | .extra2 = &xfs_params.inherit_noatim.max | ||
157 | }, | ||
158 | { | ||
159 | .ctl_name = XFS_BUF_TIMER, | ||
160 | .procname = "xfsbufd_centisecs", | ||
161 | .data = &xfs_params.xfs_buf_timer.val, | ||
162 | .maxlen = sizeof(int), | ||
163 | .mode = 0644, | ||
164 | .proc_handler = &proc_dointvec_minmax, | ||
165 | .strategy = &sysctl_intvec, | ||
166 | .extra1 = &xfs_params.xfs_buf_timer.min, | ||
167 | .extra2 = &xfs_params.xfs_buf_timer.max | ||
168 | }, | ||
169 | { | ||
170 | .ctl_name = XFS_BUF_AGE, | ||
171 | .procname = "age_buffer_centisecs", | ||
172 | .data = &xfs_params.xfs_buf_age.val, | ||
173 | .maxlen = sizeof(int), | ||
174 | .mode = 0644, | ||
175 | .proc_handler = &proc_dointvec_minmax, | ||
176 | .strategy = &sysctl_intvec, | ||
177 | .extra1 = &xfs_params.xfs_buf_age.min, | ||
178 | .extra2 = &xfs_params.xfs_buf_age.max | ||
179 | }, | ||
180 | { | ||
181 | .ctl_name = XFS_INHERIT_NOSYM, | ||
182 | .procname = "inherit_nosymlinks", | ||
183 | .data = &xfs_params.inherit_nosym.val, | ||
184 | .maxlen = sizeof(int), | ||
185 | .mode = 0644, | ||
186 | .proc_handler = &proc_dointvec_minmax, | ||
187 | .strategy = &sysctl_intvec, | ||
188 | .extra1 = &xfs_params.inherit_nosym.min, | ||
189 | .extra2 = &xfs_params.inherit_nosym.max | ||
190 | }, | ||
191 | { | ||
192 | .ctl_name = XFS_ROTORSTEP, | ||
193 | .procname = "rotorstep", | ||
194 | .data = &xfs_params.rotorstep.val, | ||
195 | .maxlen = sizeof(int), | ||
196 | .mode = 0644, | ||
197 | .proc_handler = &proc_dointvec_minmax, | ||
198 | .strategy = &sysctl_intvec, | ||
199 | .extra1 = &xfs_params.rotorstep.min, | ||
200 | .extra2 = &xfs_params.rotorstep.max | ||
201 | }, | ||
202 | { | ||
203 | .ctl_name = XFS_INHERIT_NODFRG, | ||
204 | .procname = "inherit_nodefrag", | ||
205 | .data = &xfs_params.inherit_nodfrg.val, | ||
206 | .maxlen = sizeof(int), | ||
207 | .mode = 0644, | ||
208 | .proc_handler = &proc_dointvec_minmax, | ||
209 | .strategy = &sysctl_intvec, | ||
210 | .extra1 = &xfs_params.inherit_nodfrg.min, | ||
211 | .extra2 = &xfs_params.inherit_nodfrg.max | ||
212 | }, | ||
128 | /* please keep this the last entry */ | 213 | /* please keep this the last entry */ |
129 | #ifdef CONFIG_PROC_FS | 214 | #ifdef CONFIG_PROC_FS |
130 | {XFS_STATS_CLEAR, "stats_clear", &xfs_params.stats_clear.val, | 215 | { |
131 | sizeof(int), 0644, NULL, &xfs_stats_clear_proc_handler, | 216 | .ctl_name = XFS_STATS_CLEAR, |
132 | &sysctl_intvec, NULL, | 217 | .procname = "stats_clear", |
133 | &xfs_params.stats_clear.min, &xfs_params.stats_clear.max}, | 218 | .data = &xfs_params.stats_clear.val, |
219 | .maxlen = sizeof(int), | ||
220 | .mode = 0644, | ||
221 | .proc_handler = &xfs_stats_clear_proc_handler, | ||
222 | .strategy = &sysctl_intvec, | ||
223 | .extra1 = &xfs_params.stats_clear.min, | ||
224 | .extra2 = &xfs_params.stats_clear.max | ||
225 | }, | ||
134 | #endif /* CONFIG_PROC_FS */ | 226 | #endif /* CONFIG_PROC_FS */ |
135 | 227 | ||
136 | {0} | 228 | {} |
137 | }; | 229 | }; |
138 | 230 | ||
139 | static ctl_table xfs_dir_table[] = { | 231 | static ctl_table xfs_dir_table[] = { |
140 | {FS_XFS, "xfs", NULL, 0, 0555, xfs_table}, | 232 | { |
141 | {0} | 233 | .ctl_name = FS_XFS, |
234 | .procname = "xfs", | ||
235 | .mode = 0555, | ||
236 | .child = xfs_table | ||
237 | }, | ||
238 | {} | ||
142 | }; | 239 | }; |
143 | 240 | ||
144 | static ctl_table xfs_root_table[] = { | 241 | static ctl_table xfs_root_table[] = { |
145 | {CTL_FS, "fs", NULL, 0, 0555, xfs_dir_table}, | 242 | { |
146 | {0} | 243 | .ctl_name = CTL_FS, |
244 | .procname = "fs", | ||
245 | .mode = 0555, | ||
246 | .child = xfs_dir_table | ||
247 | }, | ||
248 | {} | ||
147 | }; | 249 | }; |
148 | 250 | ||
149 | void | 251 | void |
150 | xfs_sysctl_register(void) | 252 | xfs_sysctl_register(void) |
151 | { | 253 | { |
152 | xfs_table_header = register_sysctl_table(xfs_root_table, 1); | 254 | xfs_table_header = register_sysctl_table(xfs_root_table, 0); |
153 | } | 255 | } |
154 | 256 | ||
155 | void | 257 | void |