* UCRL-CODE-235197
*
* This file is part of the SPL, Solaris Porting Layer.
- * For details, see <http://github.com/behlendorf/spl/>.
+ * For details, see <http://zfsonlinux.org/>.
*
* The SPL is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
#include <linux/spinlock.h>
#include <linux/proc_compat.h>
#include <linux/file_compat.h>
+#include <linux/swap.h>
#include <sys/sysmacros.h>
#include <spl-debug.h>
#include <spl-trace.h>
static int
trace_max_debug_mb(void)
{
- return MAX(512, ((num_physpages >> (20 - PAGE_SHIFT)) * 80) / 100);
+ return MAX(512, ((totalram_pages >> (20 - PAGE_SHIFT)) * 80) / 100);
}
static struct trace_page *
if (strchr(file, '/'))
file = strrchr(file, '/') + 1;
- trace_set_debug_header(&header, subsys, mask, line, 0);
-
tcd = trace_get_tcd();
+ trace_set_debug_header(&header, subsys, mask, line, 0);
if (tcd == NULL)
goto console;
spl_panic_in_progress = 1;
spl_debug_dumpstack(NULL);
- spl_debug_dumplog(flags);
- if (spl_debug_panic_on_bug)
+ if (spl_debug_panic_on_bug) {
+ spl_debug_dumplog(flags);
panic("SPL PANIC");
+ }
set_task_state(current, TASK_UNINTERRUPTIBLE);
while (1)
/* If spl_debug_mb is set to an invalid value or uninitialized
* then just make the total buffers smp_num_cpus TCD_MAX_PAGES */
- if (max > (num_physpages >> (20 - 2 - PAGE_SHIFT)) / 5 ||
+ if (max > (totalram_pages >> (20 - 2 - PAGE_SHIFT)) / 5 ||
max >= 512 || max < 0) {
max = TCD_MAX_PAGES;
} else {