pfn);
			SetPageResave(pfn_to_page(pfn));
			toi_num_resaved++;
			if (test_action_state(TOI_ABORT_ON_RESAVE_NEEDED))
				set_abort_result(TOI_RESAVE_NEEDED);
		}

		index++;
	}
	toi_message(TOI_IO, TOI_VERBOSE, 0, "Checksum verification complete.");
}

static struct toi_sysfs_data sysfs_params[] = {
	SYSFS_INT("enabled", SYSFS_RW, &toi_checksum_ops.enabled, 0, 1, 0,
			NULL),
	SYSFS_BIT("abort_if_resave_needed", SYSFS_RW, &toi_bkd.toi_action,
			TOI_ABORT_ON_RESAVE_NEEDED, 0)
};

/*
 * Ops structure.
 */
static struct toi_module_ops toi_checksum_ops = {
	.type			= MISC_MODULE,
	.name			= "checksumming",
	.directory		= "checksum",
	.module			= THIS_MODULE,
	.initialise		= toi_checksum_initialise,
	.cleanup		= toi_checksum_cleanup,
	.print_debug_info	= toi_checksum_print_debug_stats,
	.save_config_info	= toi_checksum_save_config_info,
	.load_config_info	= toi_checksum_load_config_info,
Exemple #2
0
		set_toi_state(TOI_CONTINUE_REQ);
}
EXPORT_SYMBOL_GPL(toi_early_boot_message);
#undef say

/*
 * User interface specific /sys/power/tuxonice entries.
 */

static struct toi_sysfs_data sysfs_params[] = {
#if defined(CONFIG_NET) && defined(CONFIG_SYSFS)
	SYSFS_INT("default_console_level", SYSFS_RW,
			&toi_bkd.toi_default_console_level, 0, 7, 0, NULL),
	SYSFS_UL("debug_sections", SYSFS_RW, &toi_bkd.toi_debug_state, 0,
			1 << 30, 0),
	SYSFS_BIT("log_everything", SYSFS_RW, &toi_bkd.toi_action, TOI_LOGALL,
			0)
#endif
};

static struct toi_module_ops userui_ops = {
	.type				= MISC_HIDDEN_MODULE,
	.name				= "printk ui",
	.directory			= "user_interface",
	.module				= THIS_MODULE,
	.sysfs_data			= sysfs_params,
	.num_sysfs_entries		= sizeof(sysfs_params) /
		sizeof(struct toi_sysfs_data),
};

int toi_register_ui_ops(struct ui_ops *this_ui)
{
		atomic_set(&toi_test_count[i], 0);
		atomic_set(&toi_fail_count[i], 0);
		toi_cur_allocd[i] = 0;
		toi_max_allocd[i] = 0;
	};

	max_allocd = 0;
	cur_allocd = 0;
	return 0;
}

static struct toi_sysfs_data sysfs_params[] = {
	SYSFS_INT("failure_test", SYSFS_RW, &toi_fail_num, 0, 99, 0, NULL),
	SYSFS_INT("trace", SYSFS_RW, &toi_trace_allocs, 0, TOI_ALLOC_PATHS, 0,
			NULL),
	SYSFS_BIT("find_max_mem_allocated", SYSFS_RW, &toi_bkd.toi_action,
			TOI_GET_MAX_MEM_ALLOCD, 0),
	SYSFS_INT("enabled", SYSFS_RW, &toi_alloc_ops.enabled, 0, 1, 0,
			NULL)
};

static struct toi_module_ops toi_alloc_ops = {
	.type					= MISC_HIDDEN_MODULE,
	.name					= "allocation debugging",
	.directory				= "alloc",
	.module					= THIS_MODULE,
	.early					= 1,
	.initialise				= toi_alloc_initialise,

	.sysfs_data		= sysfs_params,
	.num_sysfs_entries	= sizeof(sysfs_params) /
		sizeof(struct toi_sysfs_data),