Ejemplo n.º 1
0
void RE_multires_bake_images(MultiresBakeRender *bkr)
{
	MultiresBakeResult result;

	count_images(bkr);
	bake_images(bkr, &result);
	finish_images(bkr, &result);
}
Ejemplo n.º 2
0
static int rbdfs_getattr(const char *path, struct stat *stbuf)
{
    int fd;
    time_t now;

    if (!gotrados)
        return -ENXIO;

    if (path[0] == 0)
        return -ENOENT;

    memset(stbuf, 0, sizeof(struct stat));

    if (strcmp(path, "/") == 0) {

        now = time(NULL);
        stbuf->st_mode = S_IFDIR + 0755;
        stbuf->st_nlink = 2+count_images();
        stbuf->st_uid = getuid();
        stbuf->st_gid = getgid();
        stbuf->st_size = 1024;
        stbuf->st_blksize = 1024;
        stbuf->st_blocks = 1;
        stbuf->st_atime = now;
        stbuf->st_mtime = now;
        stbuf->st_ctime = now;

        return 0;
    }

    if (!in_opendir) {
        pthread_mutex_lock(&readdir_lock);
        enumerate_images(&rbd_images);
        pthread_mutex_unlock(&readdir_lock);
    }
    fd = open_rbd_image(path + 1);
    if (fd < 0)
        return -ENOENT;

    now = time(NULL);
    stbuf->st_mode = S_IFREG | 0666;
    stbuf->st_nlink = 1;
    stbuf->st_uid = getuid();
    stbuf->st_gid = getgid();
    stbuf->st_size = rbdsize(fd);
    stbuf->st_blksize = rbdblksize(fd);
    stbuf->st_blocks = rbdblkcnt(fd);
    stbuf->st_atime = now;
    stbuf->st_mtime = now;
    stbuf->st_ctime = now;

    return 0;
}
Ejemplo n.º 3
0
void RE_multires_bake_images(MultiresBakeRender *bkr)
{
	count_images(bkr);
	bake_images(bkr);
	finish_images(bkr);
}
Ejemplo n.º 4
0
static void multiresbake_start(MultiresBakeRender *bkr)
{
	count_images(bkr);
	bake_images(bkr);
	finish_images(bkr);
}