Use POSIX path for poll.h and fcntl.h headers
[fio.git] / engines / binject.c
index f8e83cd2b14426c08a1cd263cf376b757a7eb95a..49042a3b15843590c5500cb28d47069fc1abc7d8 100644 (file)
@@ -11,7 +11,7 @@
 #include <errno.h>
 #include <assert.h>
 #include <string.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 
@@ -59,11 +59,12 @@ static int pollin_events(struct pollfd *pfds, int fds)
        return 0;
 }
 
-static unsigned int binject_read_commands(struct thread_data *td, void *p,
+static unsigned int binject_read_commands(struct thread_data *td, void *buf,
                                          int left, int *err)
 {
        struct fio_file *f;
        int i, ret, events;
+       char *p = buf;
 
 one_more:
        events = 0;
@@ -94,7 +95,7 @@ static int fio_binject_getevents(struct thread_data *td, unsigned int min,
                                 unsigned int max,
                                 const struct timespec fio_unused *t)
 {
-       struct binject_data *bd = td->io_ops->data;
+       struct binject_data *bd = td->io_ops_data;
        int left = max, ret, r = 0, ev_index = 0;
        void *buf = bd->cmds;
        unsigned int i, events;
@@ -185,7 +186,7 @@ static int fio_binject_doio(struct thread_data *td, struct io_u *io_u)
 
 static int fio_binject_prep(struct thread_data *td, struct io_u *io_u)
 {
-       struct binject_data *bd = td->io_ops->data;
+       struct binject_data *bd = td->io_ops_data;
        struct b_user_cmd *buc = &io_u->buc;
        struct binject_file *bf = FILE_ENG_DATA(io_u->file);
 
@@ -234,7 +235,7 @@ static int fio_binject_queue(struct thread_data *td, struct io_u *io_u)
 
 static struct io_u *fio_binject_event(struct thread_data *td, int event)
 {
-       struct binject_data *bd = td->io_ops->data;
+       struct binject_data *bd = td->io_ops_data;
 
        return bd->events[event];
 }
@@ -351,7 +352,7 @@ static int fio_binject_open_file(struct thread_data *td, struct fio_file *f)
        if (ret)
                return 1;
 
-       if (f->filetype != FIO_TYPE_BD) {
+       if (f->filetype != FIO_TYPE_BLOCK) {
                log_err("fio: binject only works with block devices\n");
                goto err_close;
        }
@@ -376,7 +377,7 @@ err_close:
 
 static void fio_binject_cleanup(struct thread_data *td)
 {
-       struct binject_data *bd = td->io_ops->data;
+       struct binject_data *bd = td->io_ops_data;
 
        if (bd) {
                free(bd->events);
@@ -406,7 +407,7 @@ static int fio_binject_init(struct thread_data *td)
        bd->fd_flags = malloc(sizeof(int) * td->o.nr_files);
        memset(bd->fd_flags, 0, sizeof(int) * td->o.nr_files);
 
-       td->io_ops->data = bd;
+       td->io_ops_data = bd;
        return 0;
 }