diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2008-10-16 01:04:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-16 14:21:47 -0400 |
commit | f221e726bf4e082a05dcd573379ac859bfba7126 (patch) | |
tree | a05f674caac693dc9aec7e46dd06115389f7ece3 /net/ipv4 | |
parent | f40cbaa5b0a4719489e6e7947351c99a159aca30 (diff) |
sysctl: simplify ->strategy
name and nlen parameters passed to ->strategy hook are unused, remove
them. In general ->strategy hook should know what it's doing, and don't
do something tricky for which, say, pointer to original userspace array
may be needed (name).
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: David S. Miller <davem@davemloft.net> [ networking bits ]
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Matt Mackall <mpm@selenic.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/devinet.c | 7 | ||||
-rw-r--r-- | net/ipv4/route.c | 7 | ||||
-rw-r--r-- | net/ipv4/sysctl_net_ipv4.c | 18 |
3 files changed, 13 insertions, 19 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index b12dae2b0b2d..5154e729cf16 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -1283,7 +1283,7 @@ static int devinet_conf_proc(ctl_table *ctl, int write, | |||
1283 | return ret; | 1283 | return ret; |
1284 | } | 1284 | } |
1285 | 1285 | ||
1286 | static int devinet_conf_sysctl(ctl_table *table, int __user *name, int nlen, | 1286 | static int devinet_conf_sysctl(ctl_table *table, |
1287 | void __user *oldval, size_t __user *oldlenp, | 1287 | void __user *oldval, size_t __user *oldlenp, |
1288 | void __user *newval, size_t newlen) | 1288 | void __user *newval, size_t newlen) |
1289 | { | 1289 | { |
@@ -1379,12 +1379,11 @@ int ipv4_doint_and_flush(ctl_table *ctl, int write, | |||
1379 | return ret; | 1379 | return ret; |
1380 | } | 1380 | } |
1381 | 1381 | ||
1382 | int ipv4_doint_and_flush_strategy(ctl_table *table, int __user *name, int nlen, | 1382 | int ipv4_doint_and_flush_strategy(ctl_table *table, |
1383 | void __user *oldval, size_t __user *oldlenp, | 1383 | void __user *oldval, size_t __user *oldlenp, |
1384 | void __user *newval, size_t newlen) | 1384 | void __user *newval, size_t newlen) |
1385 | { | 1385 | { |
1386 | int ret = devinet_conf_sysctl(table, name, nlen, oldval, oldlenp, | 1386 | int ret = devinet_conf_sysctl(table, oldval, oldlenp, newval, newlen); |
1387 | newval, newlen); | ||
1388 | struct net *net = table->extra2; | 1387 | struct net *net = table->extra2; |
1389 | 1388 | ||
1390 | if (ret == 1) | 1389 | if (ret == 1) |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index a6d7c584f53b..942be04e7955 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -2908,8 +2908,6 @@ static int ipv4_sysctl_rtcache_flush(ctl_table *__ctl, int write, | |||
2908 | } | 2908 | } |
2909 | 2909 | ||
2910 | static int ipv4_sysctl_rtcache_flush_strategy(ctl_table *table, | 2910 | static int ipv4_sysctl_rtcache_flush_strategy(ctl_table *table, |
2911 | int __user *name, | ||
2912 | int nlen, | ||
2913 | void __user *oldval, | 2911 | void __user *oldval, |
2914 | size_t __user *oldlenp, | 2912 | size_t __user *oldlenp, |
2915 | void __user *newval, | 2913 | void __user *newval, |
@@ -2972,16 +2970,13 @@ static int ipv4_sysctl_rt_secret_interval(ctl_table *ctl, int write, | |||
2972 | } | 2970 | } |
2973 | 2971 | ||
2974 | static int ipv4_sysctl_rt_secret_interval_strategy(ctl_table *table, | 2972 | static int ipv4_sysctl_rt_secret_interval_strategy(ctl_table *table, |
2975 | int __user *name, | ||
2976 | int nlen, | ||
2977 | void __user *oldval, | 2973 | void __user *oldval, |
2978 | size_t __user *oldlenp, | 2974 | size_t __user *oldlenp, |
2979 | void __user *newval, | 2975 | void __user *newval, |
2980 | size_t newlen) | 2976 | size_t newlen) |
2981 | { | 2977 | { |
2982 | int old = ip_rt_secret_interval; | 2978 | int old = ip_rt_secret_interval; |
2983 | int ret = sysctl_jiffies(table, name, nlen, oldval, oldlenp, newval, | 2979 | int ret = sysctl_jiffies(table, oldval, oldlenp, newval, newlen); |
2984 | newlen); | ||
2985 | 2980 | ||
2986 | rt_secret_reschedule(old); | 2981 | rt_secret_reschedule(old); |
2987 | 2982 | ||
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index 276d047fb85a..1bb10df8ce7d 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c | |||
@@ -64,8 +64,8 @@ static int ipv4_local_port_range(ctl_table *table, int write, struct file *filp, | |||
64 | } | 64 | } |
65 | 65 | ||
66 | /* Validate changes from sysctl interface. */ | 66 | /* Validate changes from sysctl interface. */ |
67 | static int ipv4_sysctl_local_port_range(ctl_table *table, int __user *name, | 67 | static int ipv4_sysctl_local_port_range(ctl_table *table, |
68 | int nlen, void __user *oldval, | 68 | void __user *oldval, |
69 | size_t __user *oldlenp, | 69 | size_t __user *oldlenp, |
70 | void __user *newval, size_t newlen) | 70 | void __user *newval, size_t newlen) |
71 | { | 71 | { |
@@ -80,7 +80,7 @@ static int ipv4_sysctl_local_port_range(ctl_table *table, int __user *name, | |||
80 | }; | 80 | }; |
81 | 81 | ||
82 | inet_get_local_port_range(range, range + 1); | 82 | inet_get_local_port_range(range, range + 1); |
83 | ret = sysctl_intvec(&tmp, name, nlen, oldval, oldlenp, newval, newlen); | 83 | ret = sysctl_intvec(&tmp, oldval, oldlenp, newval, newlen); |
84 | if (ret == 0 && newval && newlen) { | 84 | if (ret == 0 && newval && newlen) { |
85 | if (range[1] < range[0]) | 85 | if (range[1] < range[0]) |
86 | ret = -EINVAL; | 86 | ret = -EINVAL; |
@@ -109,8 +109,8 @@ static int proc_tcp_congestion_control(ctl_table *ctl, int write, struct file * | |||
109 | return ret; | 109 | return ret; |
110 | } | 110 | } |
111 | 111 | ||
112 | static int sysctl_tcp_congestion_control(ctl_table *table, int __user *name, | 112 | static int sysctl_tcp_congestion_control(ctl_table *table, |
113 | int nlen, void __user *oldval, | 113 | void __user *oldval, |
114 | size_t __user *oldlenp, | 114 | size_t __user *oldlenp, |
115 | void __user *newval, size_t newlen) | 115 | void __user *newval, size_t newlen) |
116 | { | 116 | { |
@@ -122,7 +122,7 @@ static int sysctl_tcp_congestion_control(ctl_table *table, int __user *name, | |||
122 | int ret; | 122 | int ret; |
123 | 123 | ||
124 | tcp_get_default_congestion_control(val); | 124 | tcp_get_default_congestion_control(val); |
125 | ret = sysctl_string(&tbl, name, nlen, oldval, oldlenp, newval, newlen); | 125 | ret = sysctl_string(&tbl, oldval, oldlenp, newval, newlen); |
126 | if (ret == 1 && newval && newlen) | 126 | if (ret == 1 && newval && newlen) |
127 | ret = tcp_set_default_congestion_control(val); | 127 | ret = tcp_set_default_congestion_control(val); |
128 | return ret; | 128 | return ret; |
@@ -165,8 +165,8 @@ static int proc_allowed_congestion_control(ctl_table *ctl, | |||
165 | return ret; | 165 | return ret; |
166 | } | 166 | } |
167 | 167 | ||
168 | static int strategy_allowed_congestion_control(ctl_table *table, int __user *name, | 168 | static int strategy_allowed_congestion_control(ctl_table *table, |
169 | int nlen, void __user *oldval, | 169 | void __user *oldval, |
170 | size_t __user *oldlenp, | 170 | size_t __user *oldlenp, |
171 | void __user *newval, | 171 | void __user *newval, |
172 | size_t newlen) | 172 | size_t newlen) |
@@ -179,7 +179,7 @@ static int strategy_allowed_congestion_control(ctl_table *table, int __user *nam | |||
179 | return -ENOMEM; | 179 | return -ENOMEM; |
180 | 180 | ||
181 | tcp_get_available_congestion_control(tbl.data, tbl.maxlen); | 181 | tcp_get_available_congestion_control(tbl.data, tbl.maxlen); |
182 | ret = sysctl_string(&tbl, name, nlen, oldval, oldlenp, newval, newlen); | 182 | ret = sysctl_string(&tbl, oldval, oldlenp, newval, newlen); |
183 | if (ret == 1 && newval && newlen) | 183 | if (ret == 1 && newval && newlen) |
184 | ret = tcp_set_allowed_congestion_control(tbl.data); | 184 | ret = tcp_set_allowed_congestion_control(tbl.data); |
185 | kfree(tbl.data); | 185 | kfree(tbl.data); |