size_t sector_size;
};
-static int queue(struct thread_data *td, struct io_u *io_u)
+static enum fio_q_status queue(struct thread_data *td, struct io_u *io_u)
{
+ struct fas_data *d = FILE_ENG_DATA(io_u->file);
int rc;
- struct fas_data *d = (struct fas_data *) io_u->file->engine_data;
if (io_u->ddir != DDIR_WRITE) {
td_vmsg(td, EINVAL, "only writes supported", "io_u->ddir");
goto error;
}
d->nvm_handle = -1;
- f->engine_data = (uintptr_t) d;
+ FILE_SET_ENG_DATA(f, d);
rc = generic_open_file(td, f);
free(d);
error:
f->fd = -1;
- f->engine_data = 0;
+ FILE_SET_ENG_DATA(f, NULL);
goto out;
}
static int close_file(struct thread_data *td, struct fio_file *f)
{
- struct fas_data *d = (struct fas_data *) f->engine_data;
+ struct fas_data *d = FILE_ENG_DATA(f);
if (d) {
if (d->nvm_handle != -1)
nvm_release_handle(d->nvm_handle);
free(d);
- f->engine_data = 0;
+ FILE_SET_ENG_DATA(f, NULL);
}
return generic_close_file(td, f);