aboutsummaryrefslogtreecommitdiff
path: root/net/llc/sysctl_net_llc.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/llc/sysctl_net_llc.c')
-rw-r--r--net/llc/sysctl_net_llc.c101
1 files changed, 24 insertions, 77 deletions
diff --git a/net/llc/sysctl_net_llc.c b/net/llc/sysctl_net_llc.c
index d1eaddb1363..612a5ddaf93 100644
--- a/net/llc/sysctl_net_llc.c
+++ b/net/llc/sysctl_net_llc.c
@@ -1,13 +1,13 @@
/*
* sysctl_net_llc.c: sysctl interface to LLC net subsystem.
- *
+ *
* Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*/
-#include <linux/config.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/sysctl.h>
+#include <net/net_namespace.h>
#include <net/llc.h>
#ifndef CONFIG_SYSCTL
@@ -16,116 +16,63 @@
static struct ctl_table llc2_timeout_table[] = {
{
- .ctl_name = NET_LLC2_ACK_TIMEOUT,
.procname = "ack",
.data = &sysctl_llc2_ack_timeout,
.maxlen = sizeof(long),
.mode = 0644,
- .proc_handler = &proc_dointvec_jiffies,
- .strategy = &sysctl_jiffies,
+ .proc_handler = proc_dointvec_jiffies,
},
{
- .ctl_name = NET_LLC2_BUSY_TIMEOUT,
.procname = "busy",
.data = &sysctl_llc2_busy_timeout,
.maxlen = sizeof(long),
.mode = 0644,
- .proc_handler = &proc_dointvec_jiffies,
- .strategy = &sysctl_jiffies,
+ .proc_handler = proc_dointvec_jiffies,
},
{
- .ctl_name = NET_LLC2_P_TIMEOUT,
.procname = "p",
.data = &sysctl_llc2_p_timeout,
.maxlen = sizeof(long),
.mode = 0644,
- .proc_handler = &proc_dointvec_jiffies,
- .strategy = &sysctl_jiffies,
+ .proc_handler = proc_dointvec_jiffies,
},
{
- .ctl_name = NET_LLC2_REJ_TIMEOUT,
.procname = "rej",
.data = &sysctl_llc2_rej_timeout,
.maxlen = sizeof(long),
.mode = 0644,
- .proc_handler = &proc_dointvec_jiffies,
- .strategy = &sysctl_jiffies,
+ .proc_handler = proc_dointvec_jiffies,
},
- { 0 },
+ { },
};
static struct ctl_table llc_station_table[] = {
- {
- .ctl_name = NET_LLC_STATION_ACK_TIMEOUT,
- .procname = "ack_timeout",
- .data = &sysctl_llc_station_ack_timeout,
- .maxlen = sizeof(long),
- .mode = 0644,
- .proc_handler = &proc_dointvec_jiffies,
- .strategy = &sysctl_jiffies,
- },
- { 0 },
+ { },
};
-static struct ctl_table llc2_dir_timeout_table[] = {
- {
- .ctl_name = NET_LLC2,
- .procname = "timeout",
- .mode = 0555,
- .child = llc2_timeout_table,
- },
- { 0 },
-};
-
-static struct ctl_table llc_table[] = {
- {
- .ctl_name = NET_LLC2,
- .procname = "llc2",
- .mode = 0555,
- .child = llc2_dir_timeout_table,
- },
- {
- .ctl_name = NET_LLC_STATION,
- .procname = "station",
- .mode = 0555,
- .child = llc_station_table,
- },
- { 0 },
-};
-
-static struct ctl_table llc_dir_table[] = {
- {
- .ctl_name = NET_LLC,
- .procname = "llc",
- .mode = 0555,
- .child = llc_table,
- },
- { 0 },
-};
-
-static struct ctl_table llc_root_table[] = {
- {
- .ctl_name = CTL_NET,
- .procname = "net",
- .mode = 0555,
- .child = llc_dir_table,
- },
- { 0 },
-};
-
-static struct ctl_table_header *llc_table_header;
+static struct ctl_table_header *llc2_timeout_header;
+static struct ctl_table_header *llc_station_header;
int __init llc_sysctl_init(void)
{
- llc_table_header = register_sysctl_table(llc_root_table, 1);
+ llc2_timeout_header = register_net_sysctl(&init_net, "net/llc/llc2/timeout", llc2_timeout_table);
+ llc_station_header = register_net_sysctl(&init_net, "net/llc/station", llc_station_table);
- return llc_table_header ? 0 : -ENOMEM;
+ if (!llc2_timeout_header || !llc_station_header) {
+ llc_sysctl_exit();
+ return -ENOMEM;
+ }
+ return 0;
}
void llc_sysctl_exit(void)
{
- if (llc_table_header) {
- unregister_sysctl_table(llc_table_header);
- llc_table_header = NULL;
+ if (llc2_timeout_header) {
+ unregister_net_sysctl_table(llc2_timeout_header);
+ llc2_timeout_header = NULL;
+ }
+ if (llc_station_header) {
+ unregister_net_sysctl_table(llc_station_header);
+ llc_station_header = NULL;
}
}