X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=filesetup.c;h=012773b95eba7ff27c714e7a5085f15a939c0fb7;hp=3fc14641ed7d34380d5f735006eb129ab0b7faf0;hb=11822c0bcc03ebcb893bfcb6490c8a1422fcd28e;hpb=3bf80dad77448afcb18148e72dc6cfe04bcf7e57 diff --git a/filesetup.c b/filesetup.c index 3fc14641..012773b9 100644 --- a/filesetup.c +++ b/filesetup.c @@ -761,12 +761,16 @@ static unsigned long long get_fs_free_counts(struct thread_data *td) 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; - return td->o.start_offset + - td->subjob_number * td->o.offset_increment; + 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; } /* @@ -890,8 +894,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; } @@ -1329,7 +1335,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);