Пример #1
0
static int farm_init(char *p)
{
	struct siocb iocb;

	dprintf("use farm store driver\n");
	if (create_directory(p) < 0)
		goto err;

	if ((listxattr(p, NULL, 0) == -1) && (errno == ENOTSUP))
		goto err;

	if (trunk_init() < 0)
		goto err;

	if (snap_init() < 0)
		goto err;

	if (init_sys_vdi_bitmap(p) < 0)
		goto err;

	iocb.epoch = sys->epoch ? sys->epoch - 1 : 0;
	farm_cleanup_sys_obj(&iocb);

	return SD_RES_SUCCESS;
err:
	return SD_RES_EIO;
}
Пример #2
0
static int farm_init(char *p)
{
    struct siocb iocb;

    dprintf("use farm store driver\n");
    if (create_directory(p) < 0)
        goto err;

    if (trunk_init() < 0)
        goto err;

    if (snap_init() < 0)
        goto err;

    if (init_sys_vdi_bitmap(p) < 0)
        goto err;

    iocb.epoch = sys->epoch - 1;
    farm_cleanup_sys_obj(&iocb);

    return SD_RES_SUCCESS;
err:
    return SD_RES_EIO;
}