For non-file engines, set ->real_file_size if total size is known
[fio.git] / engines / cpu.c
index c908cab8af55aff7f86a58c35483af973450800d..dd69cedeaff7ee438fb284198dc2b91ad5f2b785 100644 (file)
@@ -6,7 +6,6 @@
  *
  */
 #include "../fio.h"
-#include "../os.h"
 
 static int fio_cpuio_queue(struct thread_data *td, struct io_u fio_unused *io_u)
 {
@@ -19,13 +18,11 @@ static int fio_cpuio_setup(struct thread_data fio_unused *td)
        struct fio_file *f;
        unsigned int i;
 
-       td->o.size = -1;
-       td->io_size = td->o.size;
-       td->total_io_size = td->io_size;
-
        for_each_file(td, f, i) {
-               f->real_file_size = -1;
-               f->file_size = -1;
+               if (td->o.size)
+                       f->real_file_size = td->o.size / td->o.nr_files;
+               else
+                       f->real_file_size = -1ULL;
        }
 
        return 0;
@@ -54,9 +51,9 @@ static int fio_cpuio_init(struct thread_data *td)
        return 0;
 }
 
-static int fio_cpuio_open(struct thread_data fio_unused *td, struct fio_file *f)
+static int fio_cpuio_open(struct thread_data fio_unused *td,
+                         struct fio_file fio_unused *f)
 {
-       f->fd = 0;
        return 0;
 }