X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=filesetup.c;h=4e828542e97535b6606d966cd9c08711f88f4639;hp=5aadf126311b9322668c3e835b673126949fa4d5;hb=29df29eaf88958c8741103d2056a4773d4959d9d;hpb=98ffb8f3ecebed9984d1744f142eb8be10c14dbd diff --git a/filesetup.c b/filesetup.c index 5aadf126..4e828542 100644 --- a/filesetup.c +++ b/filesetup.c @@ -96,9 +96,9 @@ static int extend_file(struct thread_data *td, struct fio_file *f) r = fallocate(f->fd, FALLOC_FL_KEEP_SIZE, 0, f->real_file_size); - if (r != 0) { + if (r != 0) td_verror(td, errno, "fallocate"); - } + break; #endif /* CONFIG_LINUX_FALLOCATE */ default: @@ -919,9 +919,9 @@ static int __init_rand_distribution(struct thread_data *td, struct fio_file *f) seed = td->rand_seeds[4]; if (td->o.random_distribution == FIO_RAND_DIST_ZIPF) - zipf_init(&f->zipf, nranges, td->o.zipf_theta, seed); + zipf_init(&f->zipf, nranges, td->o.zipf_theta.u.f, seed); else - pareto_init(&f->zipf, nranges, td->o.pareto_h, seed); + pareto_init(&f->zipf, nranges, td->o.pareto_h.u.f, seed); return 1; } @@ -958,8 +958,8 @@ int init_random_map(struct thread_data *td) for_each_file(td, f, i) { uint64_t file_size = min(f->real_file_size, f->io_size); - blocks = (file_size + td->o.rw_min_bs - 1) / - (unsigned long long) td->o.rw_min_bs; + blocks = file_size / (unsigned long long) td->o.rw_min_bs; + if (td->o.random_generator == FIO_RAND_GEN_LFSR) { unsigned long seed;