net: Convert all sysctl registrations to register_net_sysctl
This results in code with less boiler plate that is a bit easier to read. Additionally stops us from using compatibility code in the sysctl core, hastening the day when the compatibility code can be removed. 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>
This commit is contained in:

committed by
David S. Miller

parent
f99e8f715a
commit
ec8f23ce0f
@@ -106,13 +106,6 @@ static ctl_table rds_ib_sysctl_table[] = {
|
||||
{ }
|
||||
};
|
||||
|
||||
static struct ctl_path rds_ib_sysctl_path[] = {
|
||||
{ .procname = "net", },
|
||||
{ .procname = "rds", },
|
||||
{ .procname = "ib", },
|
||||
{ }
|
||||
};
|
||||
|
||||
void rds_ib_sysctl_exit(void)
|
||||
{
|
||||
if (rds_ib_sysctl_hdr)
|
||||
@@ -121,7 +114,7 @@ void rds_ib_sysctl_exit(void)
|
||||
|
||||
int rds_ib_sysctl_init(void)
|
||||
{
|
||||
rds_ib_sysctl_hdr = register_net_sysctl_table(&init_net, rds_ib_sysctl_path, rds_ib_sysctl_table);
|
||||
rds_ib_sysctl_hdr = register_net_sysctl(&init_net, "net/rds/ib", rds_ib_sysctl_table);
|
||||
if (!rds_ib_sysctl_hdr)
|
||||
return -ENOMEM;
|
||||
return 0;
|
||||
|
@@ -109,13 +109,6 @@ static ctl_table rds_iw_sysctl_table[] = {
|
||||
{ }
|
||||
};
|
||||
|
||||
static struct ctl_path rds_iw_sysctl_path[] = {
|
||||
{ .procname = "net", },
|
||||
{ .procname = "rds", },
|
||||
{ .procname = "iw", },
|
||||
{ }
|
||||
};
|
||||
|
||||
void rds_iw_sysctl_exit(void)
|
||||
{
|
||||
if (rds_iw_sysctl_hdr)
|
||||
@@ -124,7 +117,7 @@ void rds_iw_sysctl_exit(void)
|
||||
|
||||
int rds_iw_sysctl_init(void)
|
||||
{
|
||||
rds_iw_sysctl_hdr = register_net_sysctl_table(&init_net, rds_iw_sysctl_path, rds_iw_sysctl_table);
|
||||
rds_iw_sysctl_hdr = register_net_sysctl(&init_net, "net/rds/iw", rds_iw_sysctl_table);
|
||||
if (!rds_iw_sysctl_hdr)
|
||||
return -ENOMEM;
|
||||
return 0;
|
||||
|
@@ -92,13 +92,6 @@ static ctl_table rds_sysctl_rds_table[] = {
|
||||
{ }
|
||||
};
|
||||
|
||||
static struct ctl_path rds_sysctl_path[] = {
|
||||
{ .procname = "net", },
|
||||
{ .procname = "rds", },
|
||||
{ }
|
||||
};
|
||||
|
||||
|
||||
void rds_sysctl_exit(void)
|
||||
{
|
||||
if (rds_sysctl_reg_table)
|
||||
@@ -110,7 +103,7 @@ int rds_sysctl_init(void)
|
||||
rds_sysctl_reconnect_min = msecs_to_jiffies(1);
|
||||
rds_sysctl_reconnect_min_jiffies = rds_sysctl_reconnect_min;
|
||||
|
||||
rds_sysctl_reg_table = register_net_sysctl_table(&init_net, rds_sysctl_path, rds_sysctl_rds_table);
|
||||
rds_sysctl_reg_table = register_net_sysctl(&init_net,"net/rds", rds_sysctl_rds_table);
|
||||
if (!rds_sysctl_reg_table)
|
||||
return -ENOMEM;
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user