Reviewed and applied spl-00-rm-gpl-symbol-notifier_chain.patch
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
This commit is contained in:
parent
e73187714d
commit
d50bd9e221
|
@ -328,27 +328,6 @@ AC_DEFUN([SPL_AC_TYPE_UINTPTR_T],
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
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)
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # 2.6.20 API change,
|
dnl # 2.6.20 API change,
|
||||||
dnl # INIT_WORK use 2 args and not store data inside
|
dnl # INIT_WORK use 2 args and not store data inside
|
||||||
|
@ -359,7 +338,6 @@ AC_DEFUN([SPL_AC_3ARGS_INIT_WORK],
|
||||||
#include <linux/workqueue.h>
|
#include <linux/workqueue.h>
|
||||||
],[
|
],[
|
||||||
struct work_struct work;
|
struct work_struct work;
|
||||||
|
|
||||||
INIT_WORK(&work, NULL, NULL);
|
INIT_WORK(&work, NULL, NULL);
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
|
|
|
@ -44,7 +44,6 @@ SPL_AC_DEBUG_MUTEX
|
||||||
SPL_AC_DEBUG_KSTAT
|
SPL_AC_DEBUG_KSTAT
|
||||||
SPL_AC_DEBUG_CALLB
|
SPL_AC_DEBUG_CALLB
|
||||||
SPL_AC_TYPE_UINTPTR_T
|
SPL_AC_TYPE_UINTPTR_T
|
||||||
SPL_AC_ATOMIC_PANIC_NOTIFIER
|
|
||||||
SPL_AC_3ARGS_INIT_WORK
|
SPL_AC_3ARGS_INIT_WORK
|
||||||
SPL_AC_2ARGS_REGISTER_SYSCTL
|
SPL_AC_2ARGS_REGISTER_SYSCTL
|
||||||
SPL_AC_SET_SHRINKER
|
SPL_AC_SET_SHRINKER
|
||||||
|
|
|
@ -40,7 +40,6 @@
|
||||||
#include <linux/kthread.h>
|
#include <linux/kthread.h>
|
||||||
#include <linux/hardirq.h>
|
#include <linux/hardirq.h>
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
#include <linux/notifier.h>
|
|
||||||
#include <sys/sysmacros.h>
|
#include <sys/sysmacros.h>
|
||||||
#include <sys/proc.h>
|
#include <sys/proc.h>
|
||||||
#include <sys/debug.h>
|
#include <sys/debug.h>
|
||||||
|
@ -108,7 +107,6 @@ char *trace_console_buffers[NR_CPUS][3];
|
||||||
struct rw_semaphore trace_sem;
|
struct rw_semaphore trace_sem;
|
||||||
atomic_t trace_tage_allocated = ATOMIC_INIT(0);
|
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 int spl_debug_dump_all_pages(dumplog_priv_t *dp, char *);
|
||||||
static void trace_fini(void);
|
static void trace_fini(void);
|
||||||
|
|
||||||
|
@ -120,12 +118,6 @@ static unsigned int pages_factor[TCD_TYPE_MAX] = {
|
||||||
10 /* 10% pages for TCD_TYPE_IRQ */
|
10 /* 10% pages for TCD_TYPE_IRQ */
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct notifier_block spl_panic_notifier = {
|
|
||||||
notifier_call: panic_notifier,
|
|
||||||
next: NULL,
|
|
||||||
priority: 10000
|
|
||||||
};
|
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
spl_debug_subsys2str(int subsys)
|
spl_debug_subsys2str(int subsys)
|
||||||
{
|
{
|
||||||
|
@ -1167,26 +1159,6 @@ spl_debug_mark_buffer(char *text)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(spl_debug_mark_buffer);
|
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
|
static int
|
||||||
trace_init(int max_pages)
|
trace_init(int max_pages)
|
||||||
{
|
{
|
||||||
|
@ -1255,13 +1227,6 @@ debug_init(void)
|
||||||
if (rc)
|
if (rc)
|
||||||
return 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1311,15 +1276,5 @@ trace_fini(void)
|
||||||
void
|
void
|
||||||
debug_fini(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();
|
trace_fini();
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue