From b38bf6a4e3bb321b1e4fad1be5a77faf22dcdcbc Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 30 Sep 2014 17:10:35 -0400 Subject: [PATCH] Remove register_sysctl() compatibility code The register_sysctl() interface has been stable since Linux 2.6.21. There is no longer a need to maintain compatibility code. Signed-off-by: Brian Behlendorf --- config/spl-build.m4 | 20 -------------------- include/linux/proc_compat.h | 9 --------- module/spl/spl-proc.c | 6 +++--- 3 files changed, 3 insertions(+), 32 deletions(-) diff --git a/config/spl-build.m4 b/config/spl-build.m4 index ba99025..93834c1 100644 --- a/config/spl-build.m4 +++ b/config/spl-build.m4 @@ -26,7 +26,6 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [ SPL_AC_TYPE_ATOMIC64_CMPXCHG SPL_AC_TYPE_ATOMIC64_XCHG SPL_AC_TYPE_UINTPTR_T - SPL_AC_2ARGS_REGISTER_SYSCTL SPL_AC_SHRINKER_CALLBACK SPL_AC_CTL_UNNUMBERED SPL_AC_CTL_NAME @@ -872,25 +871,6 @@ AC_DEFUN([SPL_AC_TYPE_UINTPTR_T], ]) ]) -dnl # -dnl # 2.6.21 API change, -dnl # 'register_sysctl_table' use only one argument instead of two -dnl # -AC_DEFUN([SPL_AC_2ARGS_REGISTER_SYSCTL], - [AC_MSG_CHECKING([whether register_sysctl_table() wants 2 args]) - SPL_LINUX_TRY_COMPILE([ - #include - ],[ - (void) register_sysctl_table(NULL, 0); - ],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_2ARGS_REGISTER_SYSCTL, 1, - [register_sysctl_table() wants 2 args]) - ],[ - AC_MSG_RESULT(no) - ]) -]) - AC_DEFUN([SPL_AC_SHRINKER_CALLBACK],[ tmp_flags="$EXTRA_KCFLAGS" EXTRA_KCFLAGS="-Werror" diff --git a/include/linux/proc_compat.h b/include/linux/proc_compat.h index 7b044e7..edd2df5 100644 --- a/include/linux/proc_compat.h +++ b/include/linux/proc_compat.h @@ -27,15 +27,6 @@ #include -#ifdef CONFIG_SYSCTL -#ifdef HAVE_2ARGS_REGISTER_SYSCTL -#define spl_register_sysctl_table(t, a) register_sysctl_table(t, a) -#else -#define spl_register_sysctl_table(t, a) register_sysctl_table(t) -#endif /* HAVE_2ARGS_REGISTER_SYSCTL */ -#define spl_unregister_sysctl_table(t) unregister_sysctl_table(t) -#endif /* CONFIG_SYSCTL */ - #ifdef HAVE_CTL_NAME #define CTL_NAME(cname) .ctl_name = (cname), #else diff --git a/module/spl/spl-proc.c b/module/spl/spl-proc.c index b4be84f..3559c95 100644 --- a/module/spl/spl-proc.c +++ b/module/spl/spl-proc.c @@ -1127,7 +1127,7 @@ spl_proc_init(void) SENTRY; #ifdef CONFIG_SYSCTL - spl_header = spl_register_sysctl_table(spl_root, 0); + spl_header = register_sysctl_table(spl_root); if (spl_header == NULL) SRETURN(-EUNATCH); #endif /* CONFIG_SYSCTL */ @@ -1160,7 +1160,7 @@ out: #endif remove_proc_entry("spl", NULL); #ifdef CONFIG_SYSCTL - spl_unregister_sysctl_table(spl_header); + unregister_sysctl_table(spl_header); #endif /* CONFIG_SYSCTL */ } @@ -1181,7 +1181,7 @@ spl_proc_fini(void) #ifdef CONFIG_SYSCTL ASSERT(spl_header != NULL); - spl_unregister_sysctl_table(spl_header); + unregister_sysctl_table(spl_header); #endif /* CONFIG_SYSCTL */ SEXIT; -- 2.40.0