X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=filesetup.c;h=1ecdda61c3f460f8ae03dda4a6a5cce9c7fd5278;hp=a82163255690027f94baa487112458746c1256be;hb=3c746856fd63f3f7624a34ea70e226a290d9cc01;hpb=a3f001f5f679ae4efc5f34f682b16a2673ec2bac diff --git a/filesetup.c b/filesetup.c index a8216325..1ecdda61 100644 --- a/filesetup.c +++ b/filesetup.c @@ -329,7 +329,7 @@ static int char_size(struct thread_data *td, struct fio_file *f) int r; if (td->io_ops->open_file(td, f)) { - log_err("fio: failed opening blockdev %s for size check\n", + log_err("fio: failed opening chardev %s for size check\n", f->file_name); return 1; } @@ -809,6 +809,7 @@ int setup_files(struct thread_data *td) */ total_size = 0; for_each_file(td, f, i) { + f->fileno = i; if (f->real_file_size == -1ULL) total_size = -1ULL; else @@ -889,8 +890,10 @@ int setup_files(struct thread_data *td) if (f->io_size == -1ULL) total_size = -1ULL; else { - if (o->size_percent) - f->io_size = (f->io_size * o->size_percent) / 100; + if (o->size_percent) { + f->io_size = (f->io_size * o->size_percent) / 100; + f->io_size -= (f->io_size % td_min_bs(td)); + } total_size += f->io_size; } @@ -1218,10 +1221,12 @@ static void get_file_type(struct fio_file *f) else f->filetype = FIO_TYPE_FILE; +#ifdef WIN32 /* \\.\ is the device namespace in Windows, where every file is * a block device */ if (strncmp(f->file_name, "\\\\.\\", 4) == 0) f->filetype = FIO_TYPE_BD; +#endif if (!stat(f->file_name, &sb)) { if (S_ISBLK(sb.st_mode)) @@ -1328,7 +1333,8 @@ int add_file(struct thread_data *td, const char *fname, int numjob, int inc) dprint(FD_FILE, "add file %s\n", fname); if (td->o.directory) - len = set_name_idx(file_name, PATH_MAX, td->o.directory, numjob); + len = set_name_idx(file_name, PATH_MAX, td->o.directory, numjob, + td->o.unique_filename); sprintf(file_name + len, "%s", fname);