X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=engines%2Fsolarisaio.c;h=55a0cb95d133f8b6b85730023bf72172db5ec2f4;hb=1dc06a8f9bf1fee267f5cac6fcb99c2ce76e4102;hp=a48ec41825b67ceae574682ba73cc545bcd9156e;hpb=df9c26b10275a631e83e7cc92d5f7384998b2c49;p=fio.git diff --git a/engines/solarisaio.c b/engines/solarisaio.c index a48ec418..55a0cb95 100644 --- a/engines/solarisaio.c +++ b/engines/solarisaio.c @@ -10,8 +10,6 @@ #include "../fio.h" -#ifdef FIO_HAVE_SOLARISAIO - #include struct solarisaio_data { @@ -62,7 +60,7 @@ static void wait_for_event(struct timeval *tv) 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 @@ -75,7 +73,7 @@ static void wait_for_event(struct timeval *tv) } 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 timeval tv; @@ -126,6 +124,15 @@ static int fio_solarisaio_queue(struct thread_data fio_unused *td, 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; @@ -216,27 +223,6 @@ static struct ioengine_ops ioengine = { .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);