X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=ioengines.c;h=ae55f951d413fbaeaf92dae3c8eb0746167d4c9d;hp=f7b5ed6bf38776e4240ffaff7f80fab8063a06a9;hb=e291cff14e97feb3cff711f5a5cbcb63b32f9c72;hpb=087d0ed0d9b5b763e3bd50ad225b3b25897904bb diff --git a/ioengines.c b/ioengines.c index f7b5ed6b..ae55f951 100644 --- a/ioengines.c +++ b/ioengines.c @@ -126,7 +126,7 @@ static struct ioengine_ops *dlopen_ioengine(struct thread_data *td, struct ioengine_ops *load_ioengine(struct thread_data *td, const char *name) { struct ioengine_ops *ops; - char engine[16]; + char engine[64]; dprint(FD_IO, "load ioengine %s\n", name); @@ -260,7 +260,7 @@ int td_io_queue(struct thread_data *td, struct io_u *io_u) 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)); @@ -272,7 +272,7 @@ int td_io_queue(struct thread_data *td, struct io_u *io_u) 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); @@ -346,7 +346,7 @@ int td_io_queue(struct thread_data *td, struct io_u *io_u) } } - 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); @@ -375,7 +375,7 @@ int td_io_init(struct thread_data *td) 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; @@ -441,7 +441,7 @@ int td_io_open_file(struct thread_data *td, struct fio_file *f) } } - 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)) @@ -521,8 +521,15 @@ int td_io_unlink_file(struct thread_data *td, struct fio_file *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)