pre_read fixes
[fio.git] / engines / sg.c
index c50ad55d764ee3a408f09bbe3637c5eac81ea39c..39f99d8d0922050eb1a3aa3d60305cd865a09113 100644 (file)
@@ -277,7 +277,7 @@ static int fio_sgio_get_bs(struct thread_data *td, unsigned int *bs)
        int ret;
 
        io_u = __get_io_u(td);
-       io_u->file = &td->files[0];
+       io_u->file = td->files[0];
        assert(io_u);
 
        hdr = &io_u->hdr;
@@ -311,8 +311,6 @@ static void fio_sgio_cleanup(struct thread_data *td)
                free(sd->pfds);
                free(sd->sgbuf);
                free(sd);
-
-               td->io_ops->data = NULL;
        }
 }
 
@@ -364,7 +362,7 @@ static int fio_sgio_type_check(struct thread_data *td, struct fio_file *f)
                if (ret)
                        return 1;
        } else {
-               log_err("ioengine sgio only works on block devices\n");
+               log_err("ioengine sg only works on block devices\n");
                return 1;
        }
 
@@ -406,6 +404,7 @@ static struct ioengine_ops ioengine = {
        .cleanup        = fio_sgio_cleanup,
        .open_file      = fio_sgio_open,
        .close_file     = generic_close_file,
+       .get_file_size  = generic_get_file_size,
        .flags          = FIO_SYNCIO | FIO_RAWIO,
 };
 
@@ -418,12 +417,12 @@ static struct ioengine_ops ioengine = {
  */
 static int fio_sgio_init(struct thread_data fio_unused *td)
 {
-       fprintf(stderr, "fio: sgio not available\n");
+       fprintf(stderr, "fio: ioengine sg not available\n");
        return 1;
 }
 
 static struct ioengine_ops ioengine = {
-       .name           = "sgio",
+       .name           = "sg",
        .version        = FIO_IOOPS_VERSION,
        .init           = fio_sgio_init,
 };