#include <unistd.h>
#include <errno.h>
#include <assert.h>
-#include "fio.h"
-#include "os.h"
+
+#include "../fio.h"
+#include "../os.h"
struct syncio_data {
struct io_u *last_io_u;
{
struct syncio_data *sd = td->io_ops->data;
struct fio_file *f = io_u->file;
- int ret;
+ unsigned int ret;
if (io_u->ddir == DDIR_READ)
ret = read(f->fd, io_u->buf, io_u->buflen);
else
ret = fsync(f->fd);
- if ((unsigned int) ret != io_u->buflen) {
+ if (ret != io_u->buflen) {
if (ret > 0) {
io_u->resid = io_u->buflen - ret;
io_u->error = EIO;
return 0;
}
-struct ioengine_ops ioengine = {
+static struct ioengine_ops ioengine = {
.name = "sync",
.version = FIO_IOOPS_VERSION,
.init = fio_syncio_init,
.cleanup = fio_syncio_cleanup,
.flags = FIO_SYNCIO,
};
+
+static void fio_init fio_syncio_register(void)
+{
+ register_ioengine(&ioengine);
+}
+
+static void fio_exit fio_syncio_unregister(void)
+{
+ unregister_ioengine(&ioengine);
+}