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;
}
uint64_t get_start_offset(struct thread_data *td, struct fio_file *f)
{
struct thread_options *o = &td->o;
- uint64_t offset;
if (o->file_append && f->filetype == FIO_TYPE_FILE)
return f->real_file_size;
- offset = td->o.start_offset + td->subjob_number * td->o.offset_increment;
- if (offset % td_max_bs(td))
- offset -= (offset % td_max_bs(td));
-
- return offset;
+ return td->o.start_offset +
+ td->subjob_number * td->o.offset_increment;
}
/*
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;
}
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))
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);