X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=filesetup.c;h=a51abc3cb48f9865a336a67cb24106716310aba1;hp=faef907aeefd44429896aa156f2fa4944593cac4;hb=127f686514ef8b1d9ab6ed702971b205454974e6;hpb=6d86144dd10b05e8b82e9b895c35dd778e5e71ab diff --git a/filesetup.c b/filesetup.c index faef907a..a51abc3c 100644 --- a/filesetup.c +++ b/filesetup.c @@ -123,7 +123,7 @@ static int create_files(struct thread_data *td) { struct fio_file *f; int err, need_create, can_extend; - unsigned long long total_file_size, local_file_size; + unsigned long long total_file_size, local_file_size, create_size; unsigned int i, new_files; new_files = 0; @@ -153,18 +153,22 @@ static int create_files(struct thread_data *td) if (can_extend) return 0; - need_create = 0; local_file_size = total_file_size; if (!local_file_size) local_file_size = -1; + total_file_size = 0; + need_create = 0; + create_size = 0; for_each_file(td, f, i) { int file_there; if (f->filetype != FIO_TYPE_FILE) continue; - if (f->flags & FIO_FILE_EXISTS) + if (f->flags & FIO_FILE_EXISTS) { + total_file_size += f->file_size; continue; + } if (!td->file_size_low) f->file_size = total_file_size / new_files; @@ -184,6 +188,8 @@ static int create_files(struct thread_data *td) local_file_size -= f->file_size; } + total_file_size += f->file_size; + create_size += f->file_size; file_there = !file_ok(td, f); if (file_there && td_write(td) && !td->overwrite) { @@ -197,7 +203,7 @@ static int create_files(struct thread_data *td) if (!need_create) return 0; - if (!td->total_file_size) { + if (!td->total_file_size && !total_file_size) { log_err("Need size for create\n"); td_verror(td, EINVAL, "file_size"); return 1; @@ -205,7 +211,7 @@ static int create_files(struct thread_data *td) temp_stall_ts = 1; log_info("%s: Laying out IO file(s) (%u files / %LuMiB)\n", - td->name, new_files, total_file_size >> 20); + td->name, new_files, create_size >> 20); err = 0; for_each_file(td, f, i) {