{
int ret = 0;
+ if (f->flags & FIO_SIZE_KNOWN)
+ return 0;
+
if (f->filetype == FIO_TYPE_FILE)
ret = file_size(td, f);
else if (f->filetype == FIO_TYPE_BD)
return 1;
}
+ f->flags |= FIO_SIZE_KNOWN;
return 0;
}
clear_error(td);
else
td->io_ops->close_file(td, f);
+
+ if (f->real_file_size == -1ULL && td->o.size)
+ f->real_file_size = td->o.size / td->o.nr_files;
}
}
/*
* device/file sizes are zero and no size given, punt
*/
- if (!total_size && !td->o.size) {
+ if ((!total_size || total_size == -1ULL) && !td->o.size) {
log_err("%s: you need to specify size=\n", td->o.name);
td_verror(td, EINVAL, "total_file_size");
return 1;
if (!(f->flags & FIO_FILE_EXTEND))
continue;
+ assert(f->filetype == FIO_TYPE_FILE);
f->flags &= ~FIO_FILE_EXTEND;
f->real_file_size = f->io_size;
err = extend_file(td, f);