X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=filesetup.c;h=79e29da872cb85ebbb8eab682c2f935c82ce0606;hp=64da8bb825e27732529ef69816f215a35a45d62f;hb=e65a950ab73d7d91f267ad7f7b084d94e266fcb0;hpb=f3afa57e36550288340f1b6c694f354ae72654b9 diff --git a/filesetup.c b/filesetup.c index 64da8bb8..79e29da8 100644 --- a/filesetup.c +++ b/filesetup.c @@ -94,9 +94,9 @@ static int extend_file(struct thread_data *td, struct fio_file *f) r = fallocate(f->fd, FALLOC_FL_KEEP_SIZE, 0, f->real_file_size); - if (r != 0) { + if (r != 0) td_verror(td, errno, "fallocate"); - } + break; #endif /* FIO_HAVE_LINUX_FALLOCATE */ default: @@ -435,7 +435,7 @@ int generic_close_file(struct thread_data fio_unused *td, struct fio_file *f) return ret; } -static int file_lookup_open(struct fio_file *f, int flags) +int file_lookup_open(struct fio_file *f, int flags) { struct fio_file *__f; int from_hash; @@ -766,8 +766,11 @@ int setup_files(struct thread_data *td) if (f->io_size == -1ULL) total_size = -1ULL; - else + else { + if (td->o.size_percent) + f->io_size = (f->io_size * td->o.size_percent) / 100; total_size += f->io_size; + } if (f->filetype == FIO_TYPE_FILE && (f->io_size + f->file_offset) > f->real_file_size && @@ -781,9 +784,6 @@ int setup_files(struct thread_data *td) } } - if (td->o.size_percent) - total_size = (total_size * td->o.size_percent) / 100; - if (!td->o.size || td->o.size > total_size) td->o.size = total_size;