Add two assert statements that verify whether mark_random_map() is
used correctly.
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block = (offset - f->file_offset) / (uint64_t) min_bs;
nr_blocks = (buflen + min_bs - 1) / min_bs;
block = (offset - f->file_offset) / (uint64_t) min_bs;
nr_blocks = (buflen + min_bs - 1) / min_bs;
- if (!(io_u->flags & IO_U_F_BUSY_OK))
+ if (!(io_u->flags & IO_U_F_BUSY_OK)) {
nr_blocks = axmap_set_nr(f->io_axmap, block, nr_blocks);
nr_blocks = axmap_set_nr(f->io_axmap, block, nr_blocks);
+ assert(nr_blocks > 0);
+ }
if ((nr_blocks * min_bs) < buflen)
buflen = nr_blocks * min_bs;
if ((nr_blocks * min_bs) < buflen)
buflen = nr_blocks * min_bs;