X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=init.c;h=3532c49d968a7436699b8c9a3e75d9d5ed0d2a2e;hp=b004d89012bc44156ef28f1affc2d5329af8e999;hb=c7c280ed2e4f836bd8e9e125d55d097539b70e21;hpb=6abd53b5bb7755f1031b43eec2716cf044ccc654 diff --git a/init.c b/init.c index b004d890..3532c49d 100644 --- a/init.c +++ b/init.c @@ -695,7 +695,7 @@ int init_random_state(struct thread_data *td) if (!td->norandommap) { for_each_file(td, f, i) { blocks = (f->file_size + td->min_bs - 1) / td->min_bs; - num_maps = blocks / BLOCKS_PER_MAP; + num_maps = (blocks + BLOCKS_PER_MAP-1)/ BLOCKS_PER_MAP; f->file_map = malloc(num_maps * sizeof(long)); f->num_maps = num_maps; memset(f->file_map, 0, num_maps * sizeof(long));