fio_ro_check(td, io_u);
assert((io_u->flags & IO_U_F_FLIGHT) == 0);
- io_u_set(io_u, IO_U_F_FLIGHT);
+ io_u_set(td, io_u, IO_U_F_FLIGHT);
assert(fio_file_open(io_u->file));
io_u->error = 0;
io_u->resid = 0;
- if (td->io_ops->flags & FIO_SYNCIO) {
+ if (td_ioengine_flagged(td, FIO_SYNCIO)) {
if (fio_fill_issue_time(td))
fio_gettime(&io_u->issue_time, NULL);
}
}
- if ((td->io_ops->flags & FIO_SYNCIO) == 0) {
+ if (!td_ioengine_flagged(td, FIO_SYNCIO)) {
if (fio_fill_issue_time(td))
fio_gettime(&io_u->issue_time, NULL);
td->error = ret;
}
- if (!ret && (td->io_ops->flags & FIO_NOIO))
+ if (!ret && td_ioengine_flagged(td, FIO_NOIO))
td->flags |= TD_F_NOIO;
return ret;
}
}
- if (td->io_ops->flags & FIO_DISKLESSIO)
+ if (td_ioengine_flagged(td, FIO_DISKLESSIO))
goto done;
if (td->o.invalidate_cache && file_invalidate_cache(td, f))
{
if (td->io_ops->unlink_file)
return td->io_ops->unlink_file(td, f);
- else
- return unlink(f->file_name);
+ else {
+ int ret;
+
+ ret = unlink(f->file_name);
+ if (ret < 0)
+ return errno;
+
+ return 0;
+ }
}
int td_io_get_file_size(struct thread_data *td, struct fio_file *f)