summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuis Chamberlain <mcgrof@kernel.org>2023-03-10 15:12:03 -0800
committerChristian Brauner (Microsoft) <brauner@kernel.org>2023-03-13 12:36:34 +0100
commit3e27877ac565807135209933e0894d8c522cc520 (patch)
tree87b49c0e1e11c1a06322573472400f38abee0b1f
parent7059a9aa4b6b8c6daf257a3978a4d8c476c29a96 (diff)
downloadlwn-3e27877ac565807135209933e0894d8c522cc520.tar.gz
lwn-3e27877ac565807135209933e0894d8c522cc520.zip
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>
-rw-r--r--fs/devpts/inode.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c
index 4f25015aa534..fe3db0eda8e4 100644
--- a/fs/devpts/inode.c
+++ b/fs/devpts/inode.c
@@ -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 {
int setuid;
int setgid;
@@ -630,7 +612,7 @@ static int __init init_devpts_fs(void)
{
int err = register_filesystem(&devpts_fs_type);
if (!err) {
- register_sysctl_table(pty_root_table);
+ register_sysctl("kernel/pty", pty_table);
}
return err;
}