From: Jens Axboe Date: Tue, 14 Mar 2023 19:59:32 +0000 (-0600) Subject: t/io_uring: use the get_offset() code to retrieve pass-through offset X-Git-Tag: fio-3.35~55 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=bb2d963c60d906818a44cda7838d736860b45f79;p=fio.git t/io_uring: use the get_offset() code to retrieve pass-through offset No point in duplicating this code, use the helper. Signed-off-by: Jens Axboe --- diff --git a/t/io_uring.c b/t/io_uring.c index d39d7924..17d1d263 100644 --- a/t/io_uring.c +++ b/t/io_uring.c @@ -606,7 +606,6 @@ static void init_io_pt(struct submitter *s, unsigned index) struct nvme_uring_cmd *cmd; unsigned long long slba; unsigned long long nlb; - long r; if (s->nr_files == 1) { f = &s->files[0]; @@ -621,15 +620,7 @@ static void init_io_pt(struct submitter *s, unsigned index) } f->pending_ios++; - if (random_io) { - r = __rand64(&s->rand_state); - offset = (r % (f->max_blocks - 1)) * bs; - } else { - offset = f->cur_off; - f->cur_off += bs; - if (f->cur_off + bs > f->max_size) - f->cur_off = 0; - } + offset = get_offset(s, f); if (register_files) { sqe->fd = f->fixed_fd;