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

Commit b5ccd792 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by David S. Miller
Browse files

[NET]: Simple ctl_table to ctl_path conversions.



This patch includes many places, that only required
replacing the ctl_table-s with appropriate ctl_paths
and call register_sysctl_paths().

Nothing special was done with them.

Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cb7928a5
Loading
Loading
Loading
Loading
+5 −19
Original line number Diff line number Diff line
@@ -49,31 +49,17 @@ static struct ctl_table atalk_table[] = {
	{ 0 },
};

static struct ctl_table atalk_dir_table[] = {
	{
		.ctl_name	= NET_ATALK,
		.procname	= "appletalk",
		.mode		= 0555,
		.child		= atalk_table,
	},
	{ 0 },
};

static struct ctl_table atalk_root_table[] = {
	{
		.ctl_name	= CTL_NET,
		.procname	= "net",
		.mode		= 0555,
		.child		= atalk_dir_table,
	},
	{ 0 },
static struct ctl_path atalk_path[] = {
	{ .procname = "net", .ctl_name = CTL_NET, },
	{ .procname = "appletalk", .ctl_name = NET_ATALK, },
	{ }
};

static struct ctl_table_header *atalk_table_header;

void atalk_register_sysctl(void)
{
	atalk_table_header = register_sysctl_table(atalk_root_table);
	atalk_table_header = register_sysctl_paths(atalk_path, atalk_table);
}

void atalk_unregister_sysctl(void)
+5 −19
Original line number Diff line number Diff line
@@ -967,24 +967,10 @@ static ctl_table brnf_table[] = {
	{ .ctl_name = 0 }
};

static ctl_table brnf_bridge_table[] = {
	{
		.ctl_name	= NET_BRIDGE,
		.procname	= "bridge",
		.mode		= 0555,
		.child		= brnf_table,
	},
	{ .ctl_name = 0 }
};

static ctl_table brnf_net_table[] = {
	{
		.ctl_name	= CTL_NET,
		.procname	= "net",
		.mode		= 0555,
		.child		= brnf_bridge_table,
	},
	{ .ctl_name = 0 }
static struct ctl_path brnf_path[] = {
	{ .procname = "net", .ctl_name = CTL_NET, },
	{ .procname = "bridge", .ctl_name = NET_BRIDGE, },
	{ }
};
#endif

@@ -996,7 +982,7 @@ int __init br_netfilter_init(void)
	if (ret < 0)
		return ret;
#ifdef CONFIG_SYSCTL
	brnf_sysctl_header = register_sysctl_table(brnf_net_table);
	brnf_sysctl_header = register_sysctl_paths(brnf_path, brnf_table);
	if (brnf_sysctl_header == NULL) {
		printk(KERN_WARNING
		       "br_netfilter: can't register to sysctl.\n");
+7 −29
Original line number Diff line number Diff line
@@ -100,41 +100,19 @@ static struct ctl_table dccp_default_table[] = {
	{ .ctl_name = 0, }
};

static struct ctl_table dccp_table[] = {
	{
		.ctl_name	= NET_DCCP_DEFAULT,
		.procname	= "default",
		.mode		= 0555,
		.child		= dccp_default_table,
	},
	{ .ctl_name = 0, },
};

static struct ctl_table dccp_dir_table[] = {
	{
		.ctl_name	= NET_DCCP,
		.procname	= "dccp",
		.mode		= 0555,
		.child		= dccp_table,
	},
	{ .ctl_name = 0, },
};

static struct ctl_table dccp_root_table[] = {
	{
		.ctl_name	= CTL_NET,
		.procname	= "net",
		.mode		= 0555,
		.child		= dccp_dir_table,
	},
	{ .ctl_name = 0, },
static struct ctl_path dccp_path[] = {
	{ .procname = "net", .ctl_name = CTL_NET, },
	{ .procname = "dccp", .ctl_name = NET_DCCP, },
	{ .procname = "default", .ctl_name = NET_DCCP_DEFAULT, },
	{ }
};

static struct ctl_table_header *dccp_table_header;

int __init dccp_sysctl_init(void)
{
	dccp_table_header = register_sysctl_table(dccp_root_table);
	dccp_table_header = register_sysctl_paths(dccp_path,
			dccp_default_table);

	return dccp_table_header != NULL ? 0 : -ENOMEM;
}
+5 −19
Original line number Diff line number Diff line
@@ -28,31 +28,17 @@ static struct ctl_table ipx_table[] = {
	{ 0 },
};

static struct ctl_table ipx_dir_table[] = {
	{
		.ctl_name	= NET_IPX,
		.procname	= "ipx",
		.mode		= 0555,
		.child		= ipx_table,
	},
	{ 0 },
};

static struct ctl_table ipx_root_table[] = {
	{
		.ctl_name	= CTL_NET,
		.procname	= "net",
		.mode		= 0555,
		.child		= ipx_dir_table,
	},
	{ 0 },
static struct ctl_path ipx_path[] = {
	{ .procname = "net", .ctl_name = CTL_NET, },
	{ .procname = "ipx", .ctl_name = NET_IPX, },
	{ }
};

static struct ctl_table_header *ipx_table_header;

void ipx_register_sysctl(void)
{
	ipx_table_header = register_sysctl_table(ipx_root_table);
	ipx_table_header = register_sysctl_paths(ipx_path, ipx_table);
}

void ipx_unregister_sysctl(void)
+5 −23
Original line number Diff line number Diff line
@@ -234,28 +234,10 @@ static ctl_table irda_table[] = {
	{ .ctl_name = 0 }
};

/* One directory */
static ctl_table irda_net_table[] = {
	{
		.ctl_name	= NET_IRDA,
		.procname	= "irda",
		.maxlen		= 0,
		.mode		= 0555,
		.child		= irda_table
	},
	{ .ctl_name = 0 }
};

/* The parent directory */
static ctl_table irda_root_table[] = {
	{
		.ctl_name	= CTL_NET,
		.procname	= "net",
		.maxlen		= 0,
		.mode		= 0555,
		.child		= irda_net_table
	},
	{ .ctl_name = 0 }
static struct ctl_path irda_path[] = {
	{ .procname = "net", .ctl_name = CTL_NET, },
	{ .procname = "irda", .ctl_name = NET_IRDA, },
	{ }
};

static struct ctl_table_header *irda_table_header;
@@ -268,7 +250,7 @@ static struct ctl_table_header *irda_table_header;
 */
int __init irda_sysctl_register(void)
{
	irda_table_header = register_sysctl_table(irda_root_table);
	irda_table_header = register_sysctl_paths(irda_path, irda_table);
	if (!irda_table_header)
		return -ENOMEM;

Loading