projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revamp file open/close handling
[fio.git]
/
engines
/
posixaio.c
diff --git
a/engines/posixaio.c
b/engines/posixaio.c
index ef4d78ebe8a58c03465eb33cdc58aa7f90b52d7c..9ee3ca6bfbe680ee4b78c5dc6350a6528e35729a 100644
(file)
--- a/
engines/posixaio.c
+++ b/
engines/posixaio.c
@@
-67,8
+67,8
@@
static int fio_posixaio_prep(struct thread_data fio_unused *td,
struct fio_file *f = io_u->file;
aiocb->aio_fildes = f->fd;
struct fio_file *f = io_u->file;
aiocb->aio_fildes = f->fd;
- aiocb->aio_buf = io_u->buf;
- aiocb->aio_nbytes = io_u->buflen;
+ aiocb->aio_buf = io_u->
xfer_
buf;
+ aiocb->aio_nbytes = io_u->
xfer_
buflen;
aiocb->aio_offset = io_u->offset;
io_u->seen = 0;
aiocb->aio_offset = io_u->offset;
io_u->seen = 0;
@@
-100,6
+100,7
@@
restart:
default:
io_u->error = err;
case ECANCELED:
default:
io_u->error = err;
case ECANCELED:
+ io_u->resid = io_u->xfer_buflen;
case 0:
pd->aio_events[r++] = io_u;
io_u->seen = 1;
case 0:
pd->aio_events[r++] = io_u;
io_u->seen = 1;
@@
-151,10
+152,13
@@
static int fio_posixaio_queue(struct thread_data fio_unused *td,
else
ret = aio_fsync(O_SYNC, aiocb);
else
ret = aio_fsync(O_SYNC, aiocb);
- if (ret)
+ if (ret)
{
io_u->error = errno;
io_u->error = errno;
-
- return io_u->error;
+ td_verror(td, io_u->error, "xfer");
+ return FIO_Q_COMPLETED;
+ }
+
+ return FIO_Q_QUEUED;
}
static void fio_posixaio_cleanup(struct thread_data *td)
}
static void fio_posixaio_cleanup(struct thread_data *td)
@@
-190,6
+194,8
@@
static struct ioengine_ops ioengine = {
.getevents = fio_posixaio_getevents,
.event = fio_posixaio_event,
.cleanup = fio_posixaio_cleanup,
.getevents = fio_posixaio_getevents,
.event = fio_posixaio_event,
.cleanup = fio_posixaio_cleanup,
+ .open_file = generic_open_file,
+ .close_file = generic_close_file,
};
#else /* FIO_HAVE_POSIXAIO */
};
#else /* FIO_HAVE_POSIXAIO */