Esempio n. 1
0
static int ext4dev_image(const void *buf, unsigned long long *bytes)
{
	int ret, test_fs, ext4dev_present, ext4_present;

	ret = base_ext4_image(buf, bytes, &test_fs);
	if (ret == 0)
		return 0;
	ext4dev_present = (fs_proc_check("ext4dev") ||
			   check_for_modules("ext4dev"));
	ext4_present = (fs_proc_check("ext4") || check_for_modules("ext4"));
	if ((!test_fs || !ext4dev_present) && ext4_present)
		return 0;
	return 1;
}
Esempio n. 2
0
static int system_supports_ext4dev(void)
{
	static time_t	last_check = 0;
	static int	ret = -1;
	time_t		now = time(0);

	if (ret != -1 || (now - last_check) < 5)
		return ret;
	last_check = now;
	ret = (fs_proc_check("ext4dev") || check_for_modules("ext4dev"));
	return ret;
}