예제 #1
0
파일: farm.c 프로젝트: yaekumo/sheepdog
static int farm_format(struct siocb *iocb)
{
    char path[PATH_MAX];
    unsigned ret;
    const uint8_t name[] = "farm";

    dprintf("try get a clean store\n");
    snprintf(path, sizeof(path), "%s", obj_path);
    ret = rmdir_r(path);
    if (ret && ret != -ENOENT) {
        eprintf("failed to remove %s: %s\n", path, strerror(-ret));
        return SD_RES_EIO;
    }
    if (mkdir(path, def_dmode) < 0) {
        eprintf("%m\n");
        return SD_RES_EIO;
    }

    if (set_cluster_store(name) < 0)
        return SD_RES_EIO;

    trunk_reset();

    return SD_RES_SUCCESS;
}
예제 #2
0
파일: farm.c 프로젝트: yamt/sheepdog
static int farm_purge_obj(void)
{
	if (cleanup_working_dir() < 0)
		return SD_RES_EIO;
	trunk_reset();

	return SD_RES_SUCCESS;
}
예제 #3
0
파일: trunk.c 프로젝트: Dmilo/freewpc
CALLSET_ENTRY (trunk_drv, init_complete)
{
	trunk_reset ();
}