+ extend_size = total_size = 0;
+ need_extend = 0;
+ for_each_file(td, f, i) {
+ if (!td->o.file_size_low) {
+ /*
+ * no file size range given, file size is equal to
+ * total size divided by number of files. if that is
+ * zero, set it to the real file size.
+ */
+ f->io_size = td->o.size / td->o.nr_files;
+ if (!f->io_size)
+ f->io_size = f->real_file_size;
+ } else if (f->real_file_size < td->o.file_size_low ||
+ f->real_file_size > td->o.file_size_high) {
+ /*
+ * file size given. if it's fixed, use that. if it's a
+ * range, generate a random size in-between.
+ */
+ if (td->o.file_size_low == td->o.file_size_high)
+ f->io_size = td->o.file_size_low;
+ else
+ f->io_size = get_rand_file_size(td);
+ } else
+ f->io_size = f->real_file_size;
+
+ if (f->io_size == -1ULL)
+ total_size = -1ULL;
+ else
+ total_size += f->io_size;
+
+ if (f->filetype == FIO_TYPE_FILE &&
+ f->io_size > f->real_file_size &&
+ !(td->io_ops->flags & FIO_DISKLESSIO)) {
+ need_extend++;
+ extend_size += f->io_size;
+ f->flags |= FIO_FILE_EXTEND;
+ }
+ }