projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Various cleanups
[fio.git]
/
ioengines.c
diff --git
a/ioengines.c
b/ioengines.c
index 4129ac2363b9757baf89e54788f94b656746e824..ae55f951d413fbaeaf92dae3c8eb0746167d4c9d 100644
(file)
--- a/
ioengines.c
+++ b/
ioengines.c
@@
-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);
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));
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;
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 (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);
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;
}
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;
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))
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);
{
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)
}
int td_io_get_file_size(struct thread_data *td, struct fio_file *f)