For non-file engines, set ->real_file_size if total size is known
[fio.git] / engines / null.c
index 70d1fa78f8bed7b9de40e7a0bc6d29d0e3db03c9..318952c2c00d492bed40486c05a12d3300a6a075 100644 (file)
@@ -70,8 +70,12 @@ static int fio_null_setup(struct thread_data *td)
        struct fio_file *f;
        unsigned int i;
 
-       for_each_file(td, f, i)
-               f->real_file_size = -1ULL;
+       for_each_file(td, f, i) {
+               if (td->o.size)
+                       f->real_file_size = td->o.size / td->o.nr_files;
+               else
+                       f->real_file_size = -1ULL;
+       }
 
        return 0;
 }
@@ -79,7 +83,6 @@ static int fio_null_setup(struct thread_data *td)
 static int fio_null_open(struct thread_data fio_unused *td,
                         struct fio_file fio_unused *f)
 {
-       f->fd = 0;
        return 0;
 }