X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=filesetup.c;h=ad7fb8551da7b87889e3e0ec5d087089e918b5fd;hp=60e79474d2cba91b465c4aca3c34749096c2fbce;hb=9c0f3f3279985b724c2f1358bb05cc2c795f2265;hpb=3660ceae229f08b4086279be7c82e86926f0304b diff --git a/filesetup.c b/filesetup.c index 60e79474..ad7fb855 100644 --- a/filesetup.c +++ b/filesetup.c @@ -69,6 +69,10 @@ static int extend_file(struct thread_data *td, struct fio_file *f) if (new_layout) flags |= O_TRUNC; +#ifdef WIN32 + flags |= _O_BINARY; +#endif + dprint(FD_FILE, "open file %s, flags %x\n", f->file_name, flags); f->fd = open(f->file_name, flags, 0644); if (f->fd < 0) { @@ -481,6 +485,10 @@ int file_lookup_open(struct fio_file *f, int flags) from_hash = 0; } +#ifdef WIN32 + flags |= _O_BINARY; +#endif + f->fd = open(f->file_name, flags, 0600); return from_hash; } @@ -885,6 +893,11 @@ int setup_files(struct thread_data *td) if (!o->size || o->size > total_size) o->size = total_size; + if (o->size < td_min_bs(td)) { + log_err("fio: blocksize too large for data set\n"); + goto err_out; + } + /* * See if we need to extend some files */ @@ -939,8 +952,12 @@ int setup_files(struct thread_data *td) * iolog already set the total io size, if we read back * stored entries. */ - if (!o->read_iolog_file) - td->total_io_size = o->size * o->loops; + if (!o->read_iolog_file) { + if (o->io_limit) + td->total_io_size = o->io_limit * o->loops; + else + td->total_io_size = o->size * o->loops; + } done: if (o->create_only) @@ -1031,7 +1048,7 @@ int init_random_map(struct thread_data *td) unsigned long seed; seed = td->rand_seeds[FIO_RAND_BLOCK_OFF]; - + if (!lfsr_init(&f->lfsr, blocks, seed, 0)) continue; } else if (!td->o.norandommap) {