projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fio: syslet.h build fix
[fio.git]
/
ioengines.c
diff --git
a/ioengines.c
b/ioengines.c
index 56a718c6cfea2f9cd26738560d76036d5a8385a1..16ea928fe727c094f651e75922f52308eb36c70a 100644
(file)
--- a/
ioengines.c
+++ b/
ioengines.c
@@
-33,16
+33,27
@@
static int check_engine_ops(struct ioengine_ops *ops)
if (ops->flags & FIO_CPUIO)
return 0;
if (ops->flags & FIO_CPUIO)
return 0;
+ if (!ops->queue) {
+ log_err("%s: no queue handler\n", ops->name);
+ return 1;
+ }
+
+ /*
+ * sync engines only need a ->queue()
+ */
+ if (ops->flags & FIO_SYNCIO)
+ return 0;
+
if (!ops->event) {
if (!ops->event) {
- log_err("%s: no event handler
)
\n", ops->name);
+ log_err("%s: no event handler\n", ops->name);
return 1;
}
if (!ops->getevents) {
return 1;
}
if (!ops->getevents) {
- log_err("%s: no getevents handler
)
\n", ops->name);
+ log_err("%s: no getevents handler\n", ops->name);
return 1;
}
if (!ops->queue) {
return 1;
}
if (!ops->queue) {
- log_err("%s: no queue handler
)
\n", ops->name);
+ log_err("%s: no queue handler\n", ops->name);
return 1;
}
return 1;
}
@@
-57,9
+68,6
@@
void unregister_ioengine(struct ioengine_ops *ops)
int register_ioengine(struct ioengine_ops *ops)
{
int register_ioengine(struct ioengine_ops *ops)
{
- if (check_engine_ops(ops))
- return 1;
-
INIT_LIST_HEAD(&ops->list);
list_add_tail(&ops->list, &engine_list);
return 0;
INIT_LIST_HEAD(&ops->list);
list_add_tail(&ops->list, &engine_list);
return 0;
@@
-162,8
+170,8
@@
void close_ioengine(struct thread_data *td)
int td_io_prep(struct thread_data *td, struct io_u *io_u)
{
int td_io_prep(struct thread_data *td, struct io_u *io_u)
{
- if (td->io_ops->prep
&& td->io_ops->prep(td, io_u)
)
- return
1
;
+ if (td->io_ops->prep)
+ return
td->io_ops->prep(td, io_u)
;
return 0;
}
return 0;
}
@@
-171,12
+179,18
@@
int td_io_prep(struct thread_data *td, struct io_u *io_u)
int td_io_getevents(struct thread_data *td, int min, int max,
struct timespec *t)
{
int td_io_getevents(struct thread_data *td, int min, int max,
struct timespec *t)
{
- return td->io_ops->getevents(td, min, max, t);
+ if (td->io_ops->getevents)
+ return td->io_ops->getevents(td, min, max, t);
+
+ return 0;
}
int td_io_queue(struct thread_data *td, struct io_u *io_u)
{
}
int td_io_queue(struct thread_data *td, struct io_u *io_u)
{
- gettimeofday(&io_u->issue_time, NULL);
+ fio_gettime(&io_u->issue_time, NULL);
+
+ if (io_u->ddir != DDIR_SYNC)
+ td->io_issues[io_u->ddir]++;
return td->io_ops->queue(td, io_u);
}
return td->io_ops->queue(td, io_u);
}
@@
-188,3
+202,11
@@
int td_io_init(struct thread_data *td)
return 0;
}
return 0;
}
+
+int td_io_commit(struct thread_data *td)
+{
+ if (td->io_ops->commit)
+ return td->io_ops->commit(td);
+
+ return 0;
+}