Prevent filetype disappearing
authorAaron Carroll <aaronc@gelato.unsw.edu.au>
Wed, 25 Jun 2008 07:20:37 +0000 (09:20 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Wed, 25 Jun 2008 07:20:37 +0000 (09:20 +0200)
fio_file->filetype is set in add_file(), but for duplicated files
fio-file->file_name is already set so add_file() is not called.
This patch copies the filetype at the same time as file_name so
it remains valid for dup'd files.

Signed-off-by: Aaron Carroll <aaronc@gelato.unsw.edu.au>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
filesetup.c

index 96d1b54f0a0f5bd6f6851b629e6f1e584460f5d3..8b04560907b911f8bcc7a484f71964e36d055708 100644 (file)
@@ -906,8 +906,10 @@ void dup_files(struct thread_data *td, struct thread_data *org)
 
                __f = smalloc(sizeof(*__f));
 
-               if (f->file_name)
+               if (f->file_name) {
                        __f->file_name = smalloc_strdup(f->file_name);
+                       __f->filetype = f->filetype;
+               }
 
                td->files[i] = __f;
        }