diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2009-11-05 18:38:40 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2009-11-12 05:04:55 -0500 |
commit | 56992309ccbe71f4321ddd50ee2f76f91b412c1a (patch) | |
tree | d2ffd767aa21cae9364769a25c6b181ccb8b3fb3 /kernel | |
parent | ab09203e302b6e526f6930f3e460064b0f253ae9 (diff) |
sysctl kernel: Remove binary sysctl logic
Now that sys_sysctl is a generic wrapper around /proc/sys .ctl_name
and .strategy members of sysctl tables are dead code. Remove them.
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched.c | 5 | ||||
-rw-r--r-- | kernel/slow-work.c | 5 | ||||
-rw-r--r-- | kernel/utsname_sysctl.c | 31 |
3 files changed, 3 insertions, 38 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index a455dca884a6..dbb99d787a41 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -7373,17 +7373,16 @@ static struct ctl_table sd_ctl_dir[] = { | |||
7373 | .procname = "sched_domain", | 7373 | .procname = "sched_domain", |
7374 | .mode = 0555, | 7374 | .mode = 0555, |
7375 | }, | 7375 | }, |
7376 | {0, }, | 7376 | {} |
7377 | }; | 7377 | }; |
7378 | 7378 | ||
7379 | static struct ctl_table sd_ctl_root[] = { | 7379 | static struct ctl_table sd_ctl_root[] = { |
7380 | { | 7380 | { |
7381 | .ctl_name = CTL_KERN, | ||
7382 | .procname = "kernel", | 7381 | .procname = "kernel", |
7383 | .mode = 0555, | 7382 | .mode = 0555, |
7384 | .child = sd_ctl_dir, | 7383 | .child = sd_ctl_dir, |
7385 | }, | 7384 | }, |
7386 | {0, }, | 7385 | {} |
7387 | }; | 7386 | }; |
7388 | 7387 | ||
7389 | static struct ctl_table *sd_alloc_ctl_entry(int n) | 7388 | static struct ctl_table *sd_alloc_ctl_entry(int n) |
diff --git a/kernel/slow-work.c b/kernel/slow-work.c index 0d31135efbf4..0134b15b38d8 100644 --- a/kernel/slow-work.c +++ b/kernel/slow-work.c | |||
@@ -52,7 +52,6 @@ static const int slow_work_max_vslow = 99; | |||
52 | 52 | ||
53 | ctl_table slow_work_sysctls[] = { | 53 | ctl_table slow_work_sysctls[] = { |
54 | { | 54 | { |
55 | .ctl_name = CTL_UNNUMBERED, | ||
56 | .procname = "min-threads", | 55 | .procname = "min-threads", |
57 | .data = &slow_work_min_threads, | 56 | .data = &slow_work_min_threads, |
58 | .maxlen = sizeof(unsigned), | 57 | .maxlen = sizeof(unsigned), |
@@ -62,7 +61,6 @@ ctl_table slow_work_sysctls[] = { | |||
62 | .extra2 = &slow_work_max_threads, | 61 | .extra2 = &slow_work_max_threads, |
63 | }, | 62 | }, |
64 | { | 63 | { |
65 | .ctl_name = CTL_UNNUMBERED, | ||
66 | .procname = "max-threads", | 64 | .procname = "max-threads", |
67 | .data = &slow_work_max_threads, | 65 | .data = &slow_work_max_threads, |
68 | .maxlen = sizeof(unsigned), | 66 | .maxlen = sizeof(unsigned), |
@@ -72,7 +70,6 @@ ctl_table slow_work_sysctls[] = { | |||
72 | .extra2 = (void *) &slow_work_max_max_threads, | 70 | .extra2 = (void *) &slow_work_max_max_threads, |
73 | }, | 71 | }, |
74 | { | 72 | { |
75 | .ctl_name = CTL_UNNUMBERED, | ||
76 | .procname = "vslow-percentage", | 73 | .procname = "vslow-percentage", |
77 | .data = &vslow_work_proportion, | 74 | .data = &vslow_work_proportion, |
78 | .maxlen = sizeof(unsigned), | 75 | .maxlen = sizeof(unsigned), |
@@ -81,7 +78,7 @@ ctl_table slow_work_sysctls[] = { | |||
81 | .extra1 = (void *) &slow_work_min_vslow, | 78 | .extra1 = (void *) &slow_work_min_vslow, |
82 | .extra2 = (void *) &slow_work_max_vslow, | 79 | .extra2 = (void *) &slow_work_max_vslow, |
83 | }, | 80 | }, |
84 | { .ctl_name = 0 } | 81 | {} |
85 | }; | 82 | }; |
86 | #endif | 83 | #endif |
87 | 84 | ||
diff --git a/kernel/utsname_sysctl.c b/kernel/utsname_sysctl.c index 69eae358a726..a2cd77e70d4d 100644 --- a/kernel/utsname_sysctl.c +++ b/kernel/utsname_sysctl.c | |||
@@ -57,78 +57,47 @@ static int proc_do_uts_string(ctl_table *table, int write, | |||
57 | #define proc_do_uts_string NULL | 57 | #define proc_do_uts_string NULL |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | |||
61 | #ifdef CONFIG_SYSCTL_SYSCALL | ||
62 | /* The generic string strategy routine: */ | ||
63 | static int sysctl_uts_string(ctl_table *table, | ||
64 | void __user *oldval, size_t __user *oldlenp, | ||
65 | void __user *newval, size_t newlen) | ||
66 | { | ||
67 | struct ctl_table uts_table; | ||
68 | int r, write; | ||
69 | write = newval && newlen; | ||
70 | memcpy(&uts_table, table, sizeof(uts_table)); | ||
71 | uts_table.data = get_uts(table, write); | ||
72 | r = sysctl_string(&uts_table, oldval, oldlenp, newval, newlen); | ||
73 | put_uts(table, write, uts_table.data); | ||
74 | return r; | ||
75 | } | ||
76 | #else | ||
77 | #define sysctl_uts_string NULL | ||
78 | #endif | ||
79 | |||
80 | static struct ctl_table uts_kern_table[] = { | 60 | static struct ctl_table uts_kern_table[] = { |
81 | { | 61 | { |
82 | .ctl_name = KERN_OSTYPE, | ||
83 | .procname = "ostype", | 62 | .procname = "ostype", |
84 | .data = init_uts_ns.name.sysname, | 63 | .data = init_uts_ns.name.sysname, |
85 | .maxlen = sizeof(init_uts_ns.name.sysname), | 64 | .maxlen = sizeof(init_uts_ns.name.sysname), |
86 | .mode = 0444, | 65 | .mode = 0444, |
87 | .proc_handler = proc_do_uts_string, | 66 | .proc_handler = proc_do_uts_string, |
88 | .strategy = sysctl_uts_string, | ||
89 | }, | 67 | }, |
90 | { | 68 | { |
91 | .ctl_name = KERN_OSRELEASE, | ||
92 | .procname = "osrelease", | 69 | .procname = "osrelease", |
93 | .data = init_uts_ns.name.release, | 70 | .data = init_uts_ns.name.release, |
94 | .maxlen = sizeof(init_uts_ns.name.release), | 71 | .maxlen = sizeof(init_uts_ns.name.release), |
95 | .mode = 0444, | 72 | .mode = 0444, |
96 | .proc_handler = proc_do_uts_string, | 73 | .proc_handler = proc_do_uts_string, |
97 | .strategy = sysctl_uts_string, | ||
98 | }, | 74 | }, |
99 | { | 75 | { |
100 | .ctl_name = KERN_VERSION, | ||
101 | .procname = "version", | 76 | .procname = "version", |
102 | .data = init_uts_ns.name.version, | 77 | .data = init_uts_ns.name.version, |
103 | .maxlen = sizeof(init_uts_ns.name.version), | 78 | .maxlen = sizeof(init_uts_ns.name.version), |
104 | .mode = 0444, | 79 | .mode = 0444, |
105 | .proc_handler = proc_do_uts_string, | 80 | .proc_handler = proc_do_uts_string, |
106 | .strategy = sysctl_uts_string, | ||
107 | }, | 81 | }, |
108 | { | 82 | { |
109 | .ctl_name = KERN_NODENAME, | ||
110 | .procname = "hostname", | 83 | .procname = "hostname", |
111 | .data = init_uts_ns.name.nodename, | 84 | .data = init_uts_ns.name.nodename, |
112 | .maxlen = sizeof(init_uts_ns.name.nodename), | 85 | .maxlen = sizeof(init_uts_ns.name.nodename), |
113 | .mode = 0644, | 86 | .mode = 0644, |
114 | .proc_handler = proc_do_uts_string, | 87 | .proc_handler = proc_do_uts_string, |
115 | .strategy = sysctl_uts_string, | ||
116 | }, | 88 | }, |
117 | { | 89 | { |
118 | .ctl_name = KERN_DOMAINNAME, | ||
119 | .procname = "domainname", | 90 | .procname = "domainname", |
120 | .data = init_uts_ns.name.domainname, | 91 | .data = init_uts_ns.name.domainname, |
121 | .maxlen = sizeof(init_uts_ns.name.domainname), | 92 | .maxlen = sizeof(init_uts_ns.name.domainname), |
122 | .mode = 0644, | 93 | .mode = 0644, |
123 | .proc_handler = proc_do_uts_string, | 94 | .proc_handler = proc_do_uts_string, |
124 | .strategy = sysctl_uts_string, | ||
125 | }, | 95 | }, |
126 | {} | 96 | {} |
127 | }; | 97 | }; |
128 | 98 | ||
129 | static struct ctl_table uts_root_table[] = { | 99 | static struct ctl_table uts_root_table[] = { |
130 | { | 100 | { |
131 | .ctl_name = CTL_KERN, | ||
132 | .procname = "kernel", | 101 | .procname = "kernel", |
133 | .mode = 0555, | 102 | .mode = 0555, |
134 | .child = uts_kern_table, | 103 | .child = uts_kern_table, |