Fix offset retrieval problem for read and write having different bs ranges
[fio.git] / engines / sg.c
index cc50d6b937e747009b39d1651ab279800ee8a446..a9ff93a30280a5b95ceeb68bf04d83ce21bff4fe 100644 (file)
@@ -61,8 +61,8 @@ static int pollin_events(struct pollfd *pfds, int fds)
        return 0;
 }
 
-static int fio_sgio_getevents(struct thread_data *td, int min, int max,
-                             struct timespec fio_unused *t)
+static int fio_sgio_getevents(struct thread_data *td, unsigned int min,
+                             unsigned int max, struct timespec fio_unused *t)
 {
        struct sgio_data *sd = td->io_ops->data;
        int left = max, ret, r = 0;
@@ -242,6 +242,8 @@ static int fio_sgio_queue(struct thread_data *td, struct io_u *io_u)
        struct sg_io_hdr *hdr = &io_u->hdr;
        int ret;
 
+       fio_ro_check(td, io_u);
+
        ret = fio_sgio_doio(td, io_u, io_u->ddir == DDIR_SYNC);
 
        if (ret < 0)