Skip to content

Commit 64fb301

Browse files
ebiedermdavem330
authored andcommitted
net llc: Don't use sysctl tables with .child entries.
The sysctl core no longer natively understands sysctl tables with .child entries. Kill the intermediate tables and use register_net_sysctl directly to remove the need for compatibility code. 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>
1 parent 0ca7a4c commit 64fb301

1 file changed

Lines changed: 16 additions & 35 deletions

File tree

‎net/llc/sysctl_net_llc.c‎

Lines changed: 16 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -57,48 +57,29 @@ static struct ctl_table llc_station_table[] = {
5757
{ },
5858
};
5959

60-
static struct ctl_table llc2_dir_timeout_table[] = {
61-
{
62-
.procname = "timeout",
63-
.mode = 0555,
64-
.child = llc2_timeout_table,
65-
},
66-
{ },
67-
};
68-
69-
static struct ctl_table llc_table[] = {
70-
{
71-
.procname = "llc2",
72-
.mode = 0555,
73-
.child = llc2_dir_timeout_table,
74-
},
75-
{
76-
.procname = "station",
77-
.mode = 0555,
78-
.child = llc_station_table,
79-
},
80-
{ },
81-
};
82-
83-
static struct ctl_path llc_path[] = {
84-
{ .procname = "net", },
85-
{ .procname = "llc", },
86-
{ }
87-
};
88-
89-
static struct ctl_table_header *llc_table_header;
60+
static struct ctl_table_header *llc2_timeout_header;
61+
static struct ctl_table_header *llc_station_header;
9062

9163
int __init llc_sysctl_init(void)
9264
{
93-
llc_table_header = register_net_sysctl_table(&init_net, llc_path, llc_table);
65+
llc2_timeout_header = register_net_sysctl(&init_net, "net/llc/llc2/timeout", llc2_timeout_table);
66+
llc_station_header = register_net_sysctl(&init_net, "net/llc/station", llc_station_table);
9467

95-
return llc_table_header ? 0 : -ENOMEM;
68+
if (!llc2_timeout_header || !llc_station_header) {
69+
llc_sysctl_exit();
70+
return -ENOMEM;
71+
}
72+
return 0;
9673
}
9774

9875
void llc_sysctl_exit(void)
9976
{
100-
if (llc_table_header) {
101-
unregister_net_sysctl_table(llc_table_header);
102-
llc_table_header = NULL;
77+
if (llc2_timeout_header) {
78+
unregister_net_sysctl_table(llc2_timeout_header);
79+
llc2_timeout_header = NULL;
80+
}
81+
if (llc_station_header) {
82+
unregister_net_sysctl_table(llc_station_header);
83+
llc_station_header = NULL;
10384
}
10485
}

0 commit comments

Comments
 (0)