Beispiel #1
0
static int farm_restore(const struct siocb *iocb)
{
	int ret = SD_RES_EIO, epoch = iocb->epoch;

	sd_dprintf("try recover user epoch %d", epoch);

	/* Remove all the objects of WD and object cache */
	for_each_object_in_wd(rm_object, true, NULL);
	if (sys->enable_object_cache)
		object_cache_format();

	ret = restore_objects_from_snap(epoch);
	if (ret != SD_RES_SUCCESS)
		goto out;
out:
	return ret;
}
Beispiel #2
0
static int farm_restore(struct siocb *iocb)
{
    int ret = SD_RES_EIO, epoch = iocb->epoch;

    dprintf("try recover user epoch %d\n", epoch);

    if (cleanup_working_dir() < 0) {
        eprintf("failed to clean up the working dir %m\n");
        goto out;
    }

    ret = restore_objects_from_snap(epoch);
    if (ret != SD_RES_SUCCESS)
        goto out;
out:
    return ret;
}