unsigned int blocks;
unsigned int nr_blocks;
- block = io_u->offset / (unsigned long long) min_bs;
+ block = (io_u->offset - f->file_offset) / (unsigned long long) min_bs;
blocks = 0;
nr_blocks = (io_u->buflen + min_bs - 1) / min_bs;
* If we have a mixed random workload, we may
* encounter blocks we already did IO to.
*/
- if (!td->o.ddir_nr == 1 && !random_map_free(td, f, block))
+ if ((td->o.ddir_nr == 1) && !random_map_free(td, f, block))
break;
idx = RAND_MAP_IDX(td, f, block);