mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
devpts: simplify two-level sysctl registration for pty_kern_table
There is no need to declare two tables to just create directories, this can be easily be done with a prefix path with register_sysctl(). Simplify this registration. Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
This commit is contained in:
committed by
Christian Brauner (Microsoft)
parent
7059a9aa4b
commit
3e27877ac5
@@ -72,24 +72,6 @@ static struct ctl_table pty_table[] = {
|
|||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct ctl_table pty_kern_table[] = {
|
|
||||||
{
|
|
||||||
.procname = "pty",
|
|
||||||
.mode = 0555,
|
|
||||||
.child = pty_table,
|
|
||||||
},
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct ctl_table pty_root_table[] = {
|
|
||||||
{
|
|
||||||
.procname = "kernel",
|
|
||||||
.mode = 0555,
|
|
||||||
.child = pty_kern_table,
|
|
||||||
},
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct pts_mount_opts {
|
struct pts_mount_opts {
|
||||||
int setuid;
|
int setuid;
|
||||||
int setgid;
|
int setgid;
|
||||||
@@ -630,7 +612,7 @@ static int __init init_devpts_fs(void)
|
|||||||
{
|
{
|
||||||
int err = register_filesystem(&devpts_fs_type);
|
int err = register_filesystem(&devpts_fs_type);
|
||||||
if (!err) {
|
if (!err) {
|
||||||
register_sysctl_table(pty_root_table);
|
register_sysctl("kernel/pty", pty_table);
|
||||||
}
|
}
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user