projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change IO engine queuing
[fio.git]
/
engines
/
libaio.c
diff --git
a/engines/libaio.c
b/engines/libaio.c
index c2f47d8bc87aee1b2b76d117c1f8d7c2532ea35a..ba8c49df6583ddf7051e215f9da46c968d3b34aa 100644
(file)
--- a/
engines/libaio.c
+++ b/
engines/libaio.c
@@
-18,7
+18,6
@@
struct libaio_data {
io_context_t aio_ctx;
struct io_event *aio_events;
struct libaio_data {
io_context_t aio_ctx;
struct io_event *aio_events;
- struct io_u *sync_io_u;
};
static int fio_libaio_prep(struct thread_data fio_unused *td, struct io_u *io_u)
};
static int fio_libaio_prep(struct thread_data fio_unused *td, struct io_u *io_u)
@@
-41,13
+40,6
@@
static struct io_u *fio_libaio_event(struct thread_data *td, int event)
{
struct libaio_data *ld = td->io_ops->data;
{
struct libaio_data *ld = td->io_ops->data;
- if (ld->sync_io_u) {
- struct io_u *ret = ld->sync_io_u;
-
- ld->sync_io_u = NULL;
- return ret;
- }
-
return ev_to_iou(ld->aio_events + event);
}
return ev_to_iou(ld->aio_events + event);
}
@@
-57,9
+49,6
@@
static int fio_libaio_getevents(struct thread_data *td, int min, int max,
struct libaio_data *ld = td->io_ops->data;
long r;
struct libaio_data *ld = td->io_ops->data;
long r;
- if (ld->sync_io_u)
- return 1;
-
do {
r = io_getevents(ld->aio_ctx, min, max, ld->aio_events, t);
if (r >= min)
do {
r = io_getevents(ld->aio_ctx, min, max, ld->aio_events, t);
if (r >= min)
@@
-88,7
+77,7
@@
static int fio_libaio_queue(struct thread_data *td, struct io_u *io_u)
do {
ret = io_submit(ld->aio_ctx, 1, &iocb);
if (ret == 1)
do {
ret = io_submit(ld->aio_ctx, 1, &iocb);
if (ret == 1)
-
break
;
+
return FIO_Q_QUEUED
;
else if (ret == -EAGAIN || !ret)
usleep(100);
else if (ret == -EINTR)
else if (ret == -EAGAIN || !ret)
usleep(100);
else if (ret == -EINTR)
@@
-103,10
+92,8
@@
static int fio_libaio_queue(struct thread_data *td, struct io_u *io_u)
*/
if (fsync(io_u->file->fd) < 0)
ret = errno;
*/
if (fsync(io_u->file->fd) < 0)
ret = errno;
- else {
- ret = 1;
- ld->sync_io_u = io_u;
- }
+ else
+ ret = FIO_Q_COMPLETED;
break;
} else
break;
break;
} else
break;
@@
-116,10
+103,10
@@
static int fio_libaio_queue(struct thread_data *td, struct io_u *io_u)
io_u->resid = io_u->xfer_buflen;
io_u->error = -ret;
td_verror(td, io_u->error);
io_u->resid = io_u->xfer_buflen;
io_u->error = -ret;
td_verror(td, io_u->error);
- return
1
;
+ return
FIO_Q_COMPLETED
;
}
}
- return
0
;
+ return
ret
;
}
static int fio_libaio_cancel(struct thread_data *td, struct io_u *io_u)
}
static int fio_libaio_cancel(struct thread_data *td, struct io_u *io_u)