+ print_to_console(&header, mask,
+ string_buf, needed, file, fn);
+
+ trace_put_console_buffer(string_buf);
+ cdls->cdls_count = 0;
+ }
+
+ return 0;
+}
+EXPORT_SYMBOL(libcfs_debug_vmsg2);
+
+void
+libcfs_assertion_failed(const char *expr, const char *file,
+ const char *func, const int line)
+{
+ libcfs_debug_msg(NULL, 0, D_EMERG, file, func, line,
+ "ASSERTION(%s) failed\n", expr);
+ LBUG();
+}
+EXPORT_SYMBOL(libcfs_assertion_failed);
+
+void
+trace_assertion_failed(const char *str,
+ const char *fn, const char *file, int line)
+{
+ struct ptldebug_header hdr;
+
+ libcfs_panic_in_progress = 1;
+ libcfs_catastrophe = 1;
+ mb();
+
+ set_ptldebug_header(&hdr, DEBUG_SUBSYSTEM, D_EMERG, line,
+ CDEBUG_STACK());
+
+ print_to_console(&hdr, D_EMERG, str, strlen(str), file, fn);
+
+ LIBCFS_PANIC("Lustre debug assertion failure\n");
+
+ /* not reached */
+}
+
+static void
+panic_collect_pages(struct page_collection *pc)
+{
+ /* Do the collect_pages job on a single CPU: assumes that all other
+ * CPUs have been stopped during a panic. If this isn't true for some
+ * arch, this will have to be implemented separately in each arch. */
+ int i;
+ int j;
+ struct trace_cpu_data *tcd;
+
+ CFS_INIT_LIST_HEAD(&pc->pc_pages);
+
+ tcd_for_each(tcd, i, j) {
+ list_splice_init(&tcd->tcd_pages, &pc->pc_pages);
+ tcd->tcd_cur_pages = 0;
+
+ if (pc->pc_want_daemon_pages) {
+ list_splice_init(&tcd->tcd_daemon_pages, &pc->pc_pages);
+ tcd->tcd_cur_daemon_pages = 0;
+ }
+ }