Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec8f23ce authored by Eric W. Biederman's avatar Eric W. Biederman Committed by David S. Miller
Browse files

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: default avatarEric W. Biederman <ebiederm@xmission.com>
Acked-by: default avatarPavel Emelyanov <xemul@parallels.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f99e8f71
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -66,12 +66,6 @@ static ctl_table ucma_ctl_table[] = {
	{ }
};

static struct ctl_path ucma_ctl_path[] = {
	{ .procname = "net" },
	{ .procname = "rdma_ucm" },
	{ }
};

struct ucma_file {
	struct mutex		mut;
	struct file		*filp;
@@ -1392,7 +1386,7 @@ static int __init ucma_init(void)
		goto err1;
	}

	ucma_ctl_table_hdr = register_net_sysctl_table(&init_net, ucma_ctl_path, ucma_ctl_table);
	ucma_ctl_table_hdr = register_net_sysctl(&init_net, "net/rdma_ucm", ucma_ctl_table);
	if (!ucma_ctl_table_hdr) {
		printk(KERN_ERR "rdma_ucm: couldn't register sysctl paths\n");
		ret = -ENOMEM;
+1 −7
Original line number Diff line number Diff line
@@ -643,12 +643,6 @@ static struct ctl_table tr_table[] = {
	},
	{ },
};

static __initdata struct ctl_path tr_path[] = {
	{ .procname = "net", },
	{ .procname = "token-ring", },
	{ }
};
#endif

/*
@@ -662,7 +656,7 @@ static int __init rif_init(void)
	setup_timer(&rif_timer, rif_check_expire, 0);
	add_timer(&rif_timer);
#ifdef CONFIG_SYSCTL
	register_net_sysctl_table(&init_net, tr_path, tr_table);
	register_net_sysctl(&init_net, "net/token-ring", tr_table);
#endif
	proc_net_fops_create(&init_net, "tr_rif", S_IRUGO, &rif_seq_fops);
	return 0;
+1 −7
Original line number Diff line number Diff line
@@ -42,17 +42,11 @@ static struct ctl_table atalk_table[] = {
	{ },
};

static struct ctl_path atalk_path[] = {
	{ .procname = "net", },
	{ .procname = "appletalk", },
	{ }
};

static struct ctl_table_header *atalk_table_header;

void atalk_register_sysctl(void)
{
	atalk_table_header = register_net_sysctl_table(&init_net, atalk_path, atalk_table);
	atalk_table_header = register_net_sysctl(&init_net, "net/appletalk", atalk_table);
}

void atalk_unregister_sysctl(void)
+1 −7
Original line number Diff line number Diff line
@@ -1008,12 +1008,6 @@ static ctl_table brnf_table[] = {
	},
	{ }
};

static struct ctl_path brnf_path[] = {
	{ .procname = "net", },
	{ .procname = "bridge", },
	{ }
};
#endif

int __init br_netfilter_init(void)
@@ -1030,7 +1024,7 @@ int __init br_netfilter_init(void)
		return ret;
	}
#ifdef CONFIG_SYSCTL
	brnf_sysctl_header = register_net_sysctl_table(&init_net, brnf_path, brnf_table);
	brnf_sysctl_header = register_net_sysctl(&init_net, "net/bridge", brnf_table);
	if (brnf_sysctl_header == NULL) {
		printk(KERN_WARNING
		       "br_netfilter: can't register to sysctl.\n");
+1 −2
Original line number Diff line number Diff line
@@ -224,8 +224,7 @@ static __net_init int sysctl_core_net_init(struct net *net)
		tbl[0].data = &net->core.sysctl_somaxconn;
	}

	net->core.sysctl_hdr = register_net_sysctl_table(net,
			net_core_path, tbl);
	net->core.sysctl_hdr = register_net_sysctl(net, "net/core", tbl);
	if (net->core.sysctl_hdr == NULL)
		goto err_reg;

Loading