openfiles fix
authorJens Axboe <jens.axboe@oracle.com>
Thu, 8 Mar 2007 12:08:24 +0000 (13:08 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 8 Mar 2007 12:08:24 +0000 (13:08 +0100)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
filesetup.c
init.c

index 9988498..48b5dcd 100644 (file)
@@ -327,7 +327,6 @@ int reopen_file(struct thread_data *td, struct fio_file *f)
        if (f->file_map)
                memset(f->file_map, 0, f->num_maps * sizeof(long));
 
-       printf("setting up %s again\n", f->file_name);
        return td_io_open_file(td, f);
 }
 
@@ -380,6 +379,8 @@ int setup_files(struct thread_data *td)
        for_each_file(td, f, i)
                td->total_file_size += f->file_size;
 
+       td->total_file_size = (td->total_file_size * td->nr_files) / td->open_files;
+
        td->io_size = td->total_file_size;
        if (td->io_size == 0) {
                log_err("%s: no io blocks\n", td->name);
diff --git a/init.c b/init.c
index 7cf5cab..a6d8bae 100644 (file)
--- a/init.c
+++ b/init.c
@@ -811,7 +811,7 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num)
        if (td->filename)
                td->nr_uniq_files = 1;
        else
-               td->nr_uniq_files = td->nr_files;
+               td->nr_uniq_files = td->open_files;
 
        if (td->filetype == FIO_TYPE_FILE || td->filename) {
                char tmp[PATH_MAX];