Skip to content

Commit c1d889c

Browse files
mcgrofamschuma-ntap
authored andcommitted
lockd: simplify two-level sysctl registration for nlm_sysctls
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> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent 40882de commit c1d889c

1 file changed

Lines changed: 1 addition & 19 deletions

File tree

fs/lockd/svc.c

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -510,24 +510,6 @@ static struct ctl_table nlm_sysctls[] = {
510510
{ }
511511
};
512512

513-
static struct ctl_table nlm_sysctl_dir[] = {
514-
{
515-
.procname = "nfs",
516-
.mode = 0555,
517-
.child = nlm_sysctls,
518-
},
519-
{ }
520-
};
521-
522-
static struct ctl_table nlm_sysctl_root[] = {
523-
{
524-
.procname = "fs",
525-
.mode = 0555,
526-
.child = nlm_sysctl_dir,
527-
},
528-
{ }
529-
};
530-
531513
#endif /* CONFIG_SYSCTL */
532514

533515
/*
@@ -644,7 +626,7 @@ static int __init init_nlm(void)
644626

645627
#ifdef CONFIG_SYSCTL
646628
err = -ENOMEM;
647-
nlm_sysctl_table = register_sysctl_table(nlm_sysctl_root);
629+
nlm_sysctl_table = register_sysctl("fs/nfs", nlm_sysctls);
648630
if (nlm_sysctl_table == NULL)
649631
goto err_sysctl;
650632
#endif

0 commit comments

Comments
 (0)