From f4ee22ca72da53e0e891693d16358296b703a684 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Sat, 10 Feb 2007 18:57:18 +0100 Subject: [PATCH 1/1] [PATCH] File size fix on NULL io engines Just set the file sizes to the size given, it's pretend anyway. Signed-off-by: Jens Axboe --- filesetup.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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); -- 2.25.1