X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=filesetup.c;h=84cd7f7dfe2bffa93ed62d3ea7aaa790cd6e02b3;hp=1f1259d1ac156bd99666b73e8a6a71ecdd4d28ee;hb=a2e1b08afa641078832d69871ae5e404db3e4fc1;hpb=4d9345ae968ca92ace3dab06c25a9b73159cb329 diff --git a/filesetup.c b/filesetup.c index 1f1259d1..84cd7f7d 100644 --- a/filesetup.c +++ b/filesetup.c @@ -154,6 +154,16 @@ static int file_size(struct thread_data *td, struct fio_file *f) { struct stat st; + /* + * if we are not doing real io, just pretend the file is as large + * as the size= given. this works fine with nrfiles > 1 as well, + * we only really care about it being at least as big as size= + */ + if (td->io_ops->flags & FIO_NULLIO) { + f->real_file_size = f->file_size = td->total_file_size; + return 0; + } + if (td->overwrite) { if (fstat(f->fd, &st) == -1) { td_verror(td, errno);