aboutsummaryrefslogtreecommitdiffstats
path: root/net/sysctl_net.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-04-19 13:18:47 +0000
committerDavid S. Miller <davem@davemloft.net>2012-04-20 21:21:15 -0400
commitab41a2ca50d27ee2dc8b9eef07aeb251168271be (patch)
treef564a922248d90a0007b9958fbef4964501d98f9 /net/sysctl_net.c
parent167de77fd4e5646f98f67bd9f0a0054a891f6ff4 (diff)
net: Implement register_net_sysctl.
Right now all of the networking sysctl registrations are running in a compatibiity mode. The natvie sysctl registration api takes a cstring for a path and a simple ctl_table. Implement register_net_sysctl so that we can register network sysctls without needing to use compatiblity code in the sysctl core. Switching from a ctl_path to a cstring results in less boiler plate and denser code that is a little easier to read. I would simply have changed the arguments to register_net_sysctl_table instead of keeping two functions in parallel but gcc will allow a ctl_path pointer to be passed to a char * pointer with only issuing a warning resulting in completely incorrect code can be built. Since I have to change the function name I am taking advantage of the situation to let both register_net_sysctl and register_net_sysctl_table live for a short time in parallel which makes clean conversion patches a bit easier to read and write. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Acked-by: Pavel Emelyanov <xemul@parallels.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sysctl_net.c')
-rw-r--r--net/sysctl_net.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/sysctl_net.c b/net/sysctl_net.c
index c3e65aebecc0..3865c4f76b82 100644
--- a/net/sysctl_net.c
+++ b/net/sysctl_net.c
@@ -117,6 +117,13 @@ struct ctl_table_header *register_net_sysctl_rotable(const
}
EXPORT_SYMBOL_GPL(register_net_sysctl_rotable);
+struct ctl_table_header *register_net_sysctl(struct net *net,
+ const char *path, struct ctl_table *table)
+{
+ return __register_sysctl_table(&net->sysctls, path, table);
+}
+EXPORT_SYMBOL_GPL(register_net_sysctl);
+
void unregister_net_sysctl_table(struct ctl_table_header *header)
{
unregister_sysctl_table(header);

Privacy Policy