nfs/lockd: simplify sysctl registration
Subsystems (3)
This is just following the work of the same sysctl registration [0] I just emailed you patches for sunprc but for nfs and lockd.
Feel free to pick up or let me know if you want me to take them through my tree. I haven't even finished compile testing all these yet, but they are pretty trivial.
I'm just dropping netdev on this series as its purely nfs/lockd stuff.
[0] https://lkml.kernel.org/r/[email protected]
Luis Chamberlain (3):
lockd: simplify two-level sysctl registration for nlm_sysctls
nfs: simplify two-level sysctl registration for nfs4_cb_sysctls
nfs: simplify two-level sysctl registration for nfs_cb_sysctls
fs/lockd/svc.c | 20 +------------------- fs/nfs/nfs4sysctl.c | 21 ++------------------- fs/nfs/sysctl.c | 20 +------------------- 3 files changed, 4 insertions(+), 57 deletions(-)
Signature · 1 line
2.39.1
PATCH 1/3 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.
--- fs/lockd/svc.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-)
fs/lockd/svc.c +1 -19
@@ -510,24 +510,6 @@ static struct ctl_table nlm_sysctls[] = { { } }; -static struct ctl_table nlm_sysctl_dir[] = { - { - .procname ="nfs" , - .mode =0555 , - .child = nlm_sysctls, - }, - { } -}; - -static struct ctl_table nlm_sysctl_root[] = { - { - .procname ="fs" , - .mode =0555 , - .child = nlm_sysctl_dir, - }, - { } -}; -#endif /* CONFIG_SYSCTL */ /*
@@ -644,7 +626,7 @@ static int __init init_nlm(void)#ifdef CONFIG_SYSCTL err = -ENOMEM ; - nlm_sysctl_table =register_sysctl_table (nlm_sysctl_root); + nlm_sysctl_table =register_sysctl ("fs/nfs" , nlm_sysctls);if (nlm_sysctl_table ==NULL ) goto err_sysctl;#endif
Signature · 1 line
2.39.1
PATCH 2/3 nfs: simplify two-level sysctl registration for nfs4_cb_sysctls
In reply to Luis ChamberlainThere 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.
--- fs/nfs/nfs4sysctl.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-)
fs/nfs/nfs4sysctl.c +2 -19
@@ -37,27 +37,10 @@ static struct ctl_table nfs4_cb_sysctls[] = { { } }; -static struct ctl_table nfs4_cb_sysctl_dir[] = { - { - .procname ="nfs" , - .mode =0555 , - .child = nfs4_cb_sysctls, - }, - { } -}; - -static struct ctl_table nfs4_cb_sysctl_root[] = { - { - .procname ="fs" , - .mode =0555 , - .child = nfs4_cb_sysctl_dir, - }, - { } -}; -int nfs4_register_sysctl (void ) { - nfs4_callback_sysctl_table =register_sysctl_table (nfs4_cb_sysctl_root); + nfs4_callback_sysctl_table =register_sysctl ("fs/nfs" , + nfs4_cb_sysctls);if (nfs4_callback_sysctl_table ==NULL )return -ENOMEM ;return 0 ;
Signature · 1 line
2.39.1
PATCH 3/3 nfs: simplify two-level sysctl registration for nfs_cb_sysctls
In reply to Luis ChamberlainThere 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.
--- fs/nfs/sysctl.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-)
fs/nfs/sysctl.c +1 -19
@@ -32,27 +32,9 @@ static struct ctl_table nfs_cb_sysctls[] = { { } }; -static struct ctl_table nfs_cb_sysctl_dir[] = { - { - .procname ="nfs" , - .mode =0555 , - .child = nfs_cb_sysctls, - }, - { } -}; - -static struct ctl_table nfs_cb_sysctl_root[] = { - { - .procname ="fs" , - .mode =0555 , - .child = nfs_cb_sysctl_dir, - }, - { } -}; -int nfs_register_sysctl (void ) { - nfs_callback_sysctl_table =register_sysctl_table (nfs_cb_sysctl_root); + nfs_callback_sysctl_table =register_sysctl ("fs/nfs" , nfs_cb_sysctls);if (nfs_callback_sysctl_table ==NULL )return -ENOMEM ;return 0 ;
Signature · 1 line
2.39.1
Quoted 16 lines · Luis Chamberlain
This is just following the work of the same sysctl registration [0] I just emailed you patches for sunprc but for nfs and lockd.
Feel free to pick up or let me know if you want me to take them through my tree. I haven't even finished compile testing all these yet, but they are pretty trivial.
I'm just dropping netdev on this series as its purely nfs/lockd stuff.
[0] https://lkml.kernel.org/r/[email protected]
Luis Chamberlain (3):
lockd: simplify two-level sysctl registration fornlm_sysctls
nfs: simplify two-level sysctl registration fornfs4_cb_sysctls
nfs: simplify two-level sysctl registration fornfs_cb_sysctls
Quoted 5 lines
fs/lockd/svc.c | 20 +------------------- fs/nfs/nfs4sysctl.c | 21 ++------------------- fs/nfs/sysctl.c | 20 +------------------- 3 files changed, 4 insertions(+), 57 deletions(-)