mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 14:11:20 +00:00
[UNIX]: Use ctl paths to register unix ctl tables
Unlike previous ones, this patch is useful by its own, as it decreases the vmlinux size :) But it will be used later, when the per-namespace sysctl is added. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Acked-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d392e49756
commit
1d430b913c
1 changed files with 5 additions and 19 deletions
|
@ -26,31 +26,17 @@ static ctl_table unix_table[] = {
|
||||||
{ .ctl_name = 0 }
|
{ .ctl_name = 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
static ctl_table unix_net_table[] = {
|
static struct ctl_path unix_path[] = {
|
||||||
{
|
{ .procname = "net", .ctl_name = CTL_NET, },
|
||||||
.ctl_name = NET_UNIX,
|
{ .procname = "unix", .ctl_name = NET_UNIX, },
|
||||||
.procname = "unix",
|
{ },
|
||||||
.mode = 0555,
|
|
||||||
.child = unix_table
|
|
||||||
},
|
|
||||||
{ .ctl_name = 0 }
|
|
||||||
};
|
|
||||||
|
|
||||||
static ctl_table unix_root_table[] = {
|
|
||||||
{
|
|
||||||
.ctl_name = CTL_NET,
|
|
||||||
.procname = "net",
|
|
||||||
.mode = 0555,
|
|
||||||
.child = unix_net_table
|
|
||||||
},
|
|
||||||
{ .ctl_name = 0 }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct ctl_table_header * unix_sysctl_header;
|
static struct ctl_table_header * unix_sysctl_header;
|
||||||
|
|
||||||
int unix_sysctl_register(struct net *net)
|
int unix_sysctl_register(struct net *net)
|
||||||
{
|
{
|
||||||
unix_sysctl_header = register_sysctl_table(unix_root_table);
|
unix_sysctl_header = register_sysctl_paths(unix_path, unix_table);
|
||||||
return unix_sysctl_header == NULL ? -ENOMEM : 0;
|
return unix_sysctl_header == NULL ? -ENOMEM : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue