]> git.proxmox.com Git - mirror_spl-debian.git/commitdiff
Reviewed and applied spl-00-rm-gpl-symbol-notifier_chain.patch
authorbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>
Mon, 3 Nov 2008 19:53:23 +0000 (19:53 +0000)
committerbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>
Mon, 3 Nov 2008 19:53:23 +0000 (19:53 +0000)
from Ricardo which removes a dependency on the GPL-only symbol
needed for a panic time notifier.  This funcationality was never
used and this improves our portability.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@159 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

autoconf/spl-build.m4
configure.ac
modules/spl/spl-debug.c

index e13c5b8752cc6a95bb16f5711190207c89e204b5..61d11e8ff579ae88188e5c65b631eebf058b60cf 100644 (file)
@@ -230,10 +230,10 @@ dnl # SPL_LINUX_TRY_COMPILE like AC_TRY_COMPILE
 dnl #
 AC_DEFUN([SPL_LINUX_TRY_COMPILE],
        [SPL_LINUX_COMPILE_IFELSE(
-        [AC_LANG_SOURCE([SPL_LANG_PROGRAM([[$1]], [[$2]])])],
-        [modules],
-        [test -s build/conftest.o],
-        [$3], [$4])
+       [AC_LANG_SOURCE([SPL_LANG_PROGRAM([[$1]], [[$2]])])],
+       [modules],
+       [test -s build/conftest.o],
+       [$3], [$4])
 ])
 
 dnl #
@@ -296,7 +296,7 @@ dnl #
 AC_DEFUN([SPL_CHECK_HEADER],
        [AC_MSG_CHECKING([whether header $1 exists])
        SPL_LINUX_TRY_COMPILE([
-               #include <$1>
+               #include <$1>
        ],[
                return 0;
        ],[
@@ -316,36 +316,15 @@ dnl #
 AC_DEFUN([SPL_AC_TYPE_UINTPTR_T],
        [AC_MSG_CHECKING([whether kernel defines uintptr_t])
        SPL_LINUX_TRY_COMPILE([
-               #include <linux/types.h>
+               #include <linux/types.h>
        ],[
-               uintptr_t *ptr;
+               uintptr_t *ptr;
        ],[
-               AC_MSG_RESULT([yes])
-               AC_DEFINE(HAVE_UINTPTR_T, 1,
+               AC_MSG_RESULT([yes])
+               AC_DEFINE(HAVE_UINTPTR_T, 1,
                          [kernel defines uintptr_t])
        ],[
-               AC_MSG_RESULT([no])
-       ])
-])
-
-dnl #
-dnl # 2.6.19 API change,
-dnl # panic_notifier_list use atomic_notifier operations
-dnl #
-
-AC_DEFUN([SPL_AC_ATOMIC_PANIC_NOTIFIER],
-       [AC_MSG_CHECKING([whether panic_notifier_list is atomic])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/notifier.h>
-               #include <linux/kernel.h>
-       ],[
-               struct atomic_notifier_head panic_notifier_list;
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_ATOMIC_PANIC_NOTIFIER, 1,
-                       [panic_notifier_list is atomic])
-       ],[
-               AC_MSG_RESULT(no)
+               AC_MSG_RESULT([no])
        ])
 ])
 
@@ -356,17 +335,16 @@ dnl #
 AC_DEFUN([SPL_AC_3ARGS_INIT_WORK],
        [AC_MSG_CHECKING([whether INIT_WORK wants 3 args])
        SPL_LINUX_TRY_COMPILE([
-               #include <linux/workqueue.h>
+               #include <linux/workqueue.h>
        ],[
-               struct work_struct work;
-
-               INIT_WORK(&work, NULL, NULL);
+               struct work_struct work;
+               INIT_WORK(&work, NULL, NULL);
        ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_3ARGS_INIT_WORK, 1,
-                         [INIT_WORK wants 3 args])
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_3ARGS_INIT_WORK, 1,
+                         [INIT_WORK wants 3 args])
        ],[
-               AC_MSG_RESULT(no)
+               AC_MSG_RESULT(no)
        ])
 ])
 
@@ -377,15 +355,15 @@ dnl #
 AC_DEFUN([SPL_AC_2ARGS_REGISTER_SYSCTL],
        [AC_MSG_CHECKING([whether register_sysctl_table() wants 2 args])
        SPL_LINUX_TRY_COMPILE([
-               #include <linux/sysctl.h>
+               #include <linux/sysctl.h>
        ],[
-               return register_sysctl_table(NULL,0);
+               return 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(yes)
+               AC_DEFINE(HAVE_2ARGS_REGISTER_SYSCTL, 1,
+                         [register_sysctl_table() wants 2 args])
        ],[
-               AC_MSG_RESULT(no)
+               AC_MSG_RESULT(no)
        ])
 ])
 
@@ -415,18 +393,18 @@ dnl #
 AC_DEFUN([SPL_AC_PATH_IN_NAMEIDATA],
        [AC_MSG_CHECKING([whether struct path used in struct nameidata])
        SPL_LINUX_TRY_COMPILE([
-               #include <linux/namei.h>
+               #include <linux/namei.h>
        ],[
-               struct nameidata nd;
+               struct nameidata nd;
 
                nd.path.mnt = NULL;
                nd.path.dentry = NULL;
        ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_PATH_IN_NAMEIDATA, 1,
-                         [struct path used in struct nameidata])
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PATH_IN_NAMEIDATA, 1,
+                         [struct path used in struct nameidata])
        ],[
-               AC_MSG_RESULT(no)
+               AC_MSG_RESULT(no)
        ])
 ])
 
@@ -446,17 +424,17 @@ dnl #
 AC_DEFUN([SPL_AC_CTL_UNNUMBERED],
        [AC_MSG_CHECKING([whether unnumbered sysctl support exists])
        SPL_LINUX_TRY_COMPILE([
-               #include <linux/sysctl.h>
+               #include <linux/sysctl.h>
        ],[
                #ifndef CTL_UNNUMBERED
                #error CTL_UNNUMBERED undefined
                #endif
        ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_CTL_UNNUMBERED, 1,
-                         [unnumbered sysctl support exists])
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_CTL_UNNUMBERED, 1,
+                         [unnumbered sysctl support exists])
        ],[
-               AC_MSG_RESULT(no)
+               AC_MSG_RESULT(no)
        ])
 ])
 
index f32db79da6be307357dc524dfcef3cd27469bd65..047ab89b1d5fabcef467f7e81b6ed099da877725 100644 (file)
@@ -44,7 +44,6 @@ SPL_AC_DEBUG_MUTEX
 SPL_AC_DEBUG_KSTAT
 SPL_AC_DEBUG_CALLB
 SPL_AC_TYPE_UINTPTR_T
-SPL_AC_ATOMIC_PANIC_NOTIFIER
 SPL_AC_3ARGS_INIT_WORK
 SPL_AC_2ARGS_REGISTER_SYSCTL
 SPL_AC_SET_SHRINKER
index 99f61d74fa021a171af62a2eacbb644b85de33da..c6a0b52f43db654c64be4cd91c43fd1588083934 100644 (file)
@@ -40,7 +40,6 @@
 #include <linux/kthread.h>
 #include <linux/hardirq.h>
 #include <linux/interrupt.h>
-#include <linux/notifier.h>
 #include <sys/sysmacros.h>
 #include <sys/proc.h>
 #include <sys/debug.h>
@@ -108,7 +107,6 @@ char *trace_console_buffers[NR_CPUS][3];
 struct rw_semaphore trace_sem;
 atomic_t trace_tage_allocated = ATOMIC_INIT(0);
 
-static int panic_notifier(struct notifier_block *, unsigned long, void *);
 static int spl_debug_dump_all_pages(dumplog_priv_t *dp, char *);
 static void trace_fini(void);
 
@@ -120,12 +118,6 @@ static unsigned int pages_factor[TCD_TYPE_MAX] = {
        10   /* 10% pages for TCD_TYPE_IRQ */
 };
 
-static struct notifier_block spl_panic_notifier = {
-        notifier_call:   panic_notifier,
-        next:            NULL,
-        priority:        10000
-};
-
 const char *
 spl_debug_subsys2str(int subsys)
 {
@@ -1167,26 +1159,6 @@ spl_debug_mark_buffer(char *text)
 }
 EXPORT_SYMBOL(spl_debug_mark_buffer);
 
-static int
-panic_notifier(struct notifier_block *self,
-                   unsigned long unused1, void *unused2)
-{
-        if (spl_panic_in_progress)
-                return 0;
-
-        spl_panic_in_progress = 1;
-        mb();
-
-        if (!in_interrupt()) {
-                while (current->lock_depth >= 0)
-                        unlock_kernel();
-
-                spl_debug_dumplog(DL_NOTHREAD | DL_SINGLE_CPU);
-        }
-
-        return 0;
-}
-
 static int
 trace_init(int max_pages)
 {
@@ -1255,14 +1227,7 @@ debug_init(void)
         if (rc)
                 return rc;
 
-#ifdef HAVE_ATOMIC_PANIC_NOTIFIER
-        atomic_notifier_chain_register(&panic_notifier_list,
-                                       &spl_panic_notifier);
-#else
-        notifier_chain_register(&panic_notifier_list,
-                                &spl_panic_notifier);
-#endif
-       return rc;
+        return rc;
 }
 
 static void
@@ -1311,15 +1276,5 @@ trace_fini(void)
 void
 debug_fini(void)
 {
-#ifdef HAVE_ATOMIC_PANIC_NOTIFIER
-        atomic_notifier_chain_unregister(&panic_notifier_list,
-                                         &spl_panic_notifier);
-#else
-        notifier_chain_unregister(&panic_notifier_list,
-                                  &spl_panic_notifier);
-#endif
-
         trace_fini();
-
-       return;
 }