#include "../fio.h"
-#ifdef FIO_HAVE_SOLARISAIO
-
#include <sys/asynch.h>
struct solarisaio_data {
static int fio_solarisaio_prep(struct thread_data fio_unused *td,
struct io_u *io_u)
{
- struct solarisaio_data *sd = td->io_ops->data;
+ struct solarisaio_data *sd = td->io_ops_data;
io_u->resultp.aio_return = AIO_INPROGRESS;
io_u->engine_data = sd;
io_u->resid = io_u->xfer_buflen - io_u->resultp.aio_return;
io_u->error = 0;
} else
- io_u->error = io_u->resultp.aio_return;
+ io_u->error = io_u->resultp.aio_errno;
/*
* For SIGIO, we need a write barrier between the two, so that
}
static int fio_solarisaio_getevents(struct thread_data *td, unsigned int min,
- unsigned int max, struct timespec *t)
+ unsigned int max, const struct timespec *t)
{
- struct solarisaio_data *sd = td->io_ops->data;
+ struct solarisaio_data *sd = td->io_ops_data;
struct timeval tv;
int ret;
static struct io_u *fio_solarisaio_event(struct thread_data *td, int event)
{
- struct solarisaio_data *sd = td->io_ops->data;
+ struct solarisaio_data *sd = td->io_ops_data;
return sd->aio_events[event];
}
static int fio_solarisaio_queue(struct thread_data fio_unused *td,
struct io_u *io_u)
{
- struct solarisaio_data *sd = td->io_ops->data;
+ struct solarisaio_data *sd = td->io_ops_data;
struct fio_file *f = io_u->file;
off_t off;
int ret;
return FIO_Q_COMPLETED;
}
+ if (io_u->ddir == DDIR_DATASYNC) {
+ if (sd->nr)
+ return FIO_Q_BUSY;
+ if (fdatasync(f->fd) < 0)
+ io_u->error = errno;
+
+ return FIO_Q_COMPLETED;
+ }
+
if (sd->nr == sd->max_depth)
return FIO_Q_BUSY;
static void fio_solarisaio_cleanup(struct thread_data *td)
{
- struct solarisaio_data *sd = td->io_ops->data;
+ struct solarisaio_data *sd = td->io_ops_data;
if (sd) {
free(sd->aio_events);
fio_solarisaio_init_sigio();
#endif
- td->io_ops->data = sd;
+ td->io_ops_data = sd;
return 0;
}
.get_file_size = generic_get_file_size,
};
-#else /* FIO_HAVE_SOLARISAIO */
-
-/*
- * When we have a proper configure system in place, we simply wont build
- * and install this io engine. For now install a crippled version that
- * just complains and fails to load.
- */
-static int fio_solarisaio_init(struct thread_data fio_unused *td)
-{
- fprintf(stderr, "fio: solarisaio not available\n");
- return 1;
-}
-
-static struct ioengine_ops ioengine = {
- .name = "solarisaio",
- .version = FIO_IOOPS_VERSION,
- .init = fio_solarisaio_init,
-};
-
-#endif
-
static void fio_init fio_solarisaio_register(void)
{
register_ioengine(&ioengine);