Пример #1
0
Файл: libpmem.c Проект: arh/fio
static int fio_libpmem_open_file(struct thread_data *td, struct fio_file *f)
{
	struct fio_libpmem_data *fdd;
	int ret;

	dprint(FD_IO,"DEBUG fio_libpmem_open_file\n");
	dprint(FD_IO,"f->io_size=%ld \n",f->io_size);
	dprint(FD_IO,"td->o.size=%lld \n",td->o.size);
	dprint(FD_IO,"td->o.iodepth=%d\n",td->o.iodepth);
	dprint(FD_IO,"td->o.iodepth_batch=%d \n",td->o.iodepth_batch);

	ret = generic_open_file(td, f);
	if (ret)
		return ret;

	fdd = calloc(1, sizeof(*fdd));
	if (!fdd) {
		int fio_unused __ret;
		__ret = generic_close_file(td, f);
		return 1;
	}

	FILE_SET_ENG_DATA(f, fdd);

	return 0;
}
Пример #2
0
Файл: mtd.c Проект: rainmeng/fio
static int fio_mtd_open_file(struct thread_data *td, struct fio_file *f)
{
    struct fio_mtd_data *fmd;
    int ret;

    ret = generic_open_file(td, f);
    if (ret)
        return ret;

    fmd = calloc(1, sizeof(*fmd));
    if (!fmd)
        goto err_close;

    ret = mtd_get_dev_info(desc, f->file_name, &fmd->info);
    if (ret != 0) {
        td_verror(td, errno, "mtd_get_dev_info");
        goto err_free;
    }

    FILE_SET_ENG_DATA(f, fmd);
    return 0;

err_free:
    free(fmd);
err_close:
    {
        int fio_unused __ret;
        __ret = generic_close_file(td, f);
        return 1;
    }
}
Пример #3
0
Файл: mtd.c Проект: rainmeng/fio
static int fio_mtd_close_file(struct thread_data *td, struct fio_file *f)
{
    struct fio_mtd_data *fmd = FILE_ENG_DATA(f);

    FILE_SET_ENG_DATA(f, NULL);
    free(fmd);

    return generic_close_file(td, f);
}
Пример #4
0
Файл: mmap.c Проект: arh/fio
static int fio_mmapio_close_file(struct thread_data *td, struct fio_file *f)
{
	struct fio_mmap_data *fmd = FILE_ENG_DATA(f);

	FILE_SET_ENG_DATA(f, NULL);
	free(fmd);
	fio_file_clear_partial_mmap(f);

	return generic_close_file(td, f);
}
Пример #5
0
Файл: libpmem.c Проект: arh/fio
static int fio_libpmem_close_file(struct thread_data *td, struct fio_file *f)
{
	struct fio_libpmem_data *fdd = FILE_ENG_DATA(f);

	dprint(FD_IO,"DEBUG fio_libpmem_close_file\n");
	dprint(FD_IO,"td->o.odirect %d \n",td->o.odirect);

	if (!td->o.odirect) {
		dprint(FD_IO,"pmem_drain\n");
		pmem_drain();
	}

	FILE_SET_ENG_DATA(f, NULL);
	free(fdd);
	fio_file_clear_partial_mmap(f);

	return generic_close_file(td, f);
}
Пример #6
0
Файл: mmap.c Проект: arh/fio
static int fio_mmapio_open_file(struct thread_data *td, struct fio_file *f)
{
	struct fio_mmap_data *fmd;
	int ret;

	ret = generic_open_file(td, f);
	if (ret)
		return ret;

	fmd = calloc(1, sizeof(*fmd));
	if (!fmd) {
		int fio_unused __ret;
		__ret = generic_close_file(td, f);
		return 1;
	}

	FILE_SET_ENG_DATA(f, fmd);
	return 0;
}