Signed-off-by: Jens Axboe <axboe@kernel.dk>
return 0;
return syscall(__NR_io_uring_register, s->ring_fd,
return 0;
return syscall(__NR_io_uring_register, s->ring_fd,
- IORING_REGISTER_BUFFERS, s->iovecs, depth);
+ IORING_REGISTER_BUFFERS, s->iovecs, roundup_pow2(depth));
}
static int io_uring_register_files(struct submitter *s)
}
static int io_uring_register_files(struct submitter *s)
fixedbufs = register_files = 0;
}
fixedbufs = register_files = 0;
}
- return io_queue_init(depth, &s->aio_ctx);
+ return io_queue_init(roundup_pow2(depth), &s->aio_ctx);
#else
fprintf(stderr, "Legacy AIO not available on this system/build\n");
errno = EINVAL;
#else
fprintf(stderr, "Legacy AIO not available on this system/build\n");
errno = EINVAL;
dma_map = 0;
submitter = calloc(nthreads, sizeof(*submitter) +
dma_map = 0;
submitter = calloc(nthreads, sizeof(*submitter) +
- depth * sizeof(struct iovec));
+ roundup_pow2(depth) * sizeof(struct iovec));
for (j = 0; j < nthreads; j++) {
s = get_submitter(j);
s->index = j;
for (j = 0; j < nthreads; j++) {
s = get_submitter(j);
s->index = j;
for (j = 0; j < nthreads; j++) {
s = get_submitter(j);
for (j = 0; j < nthreads; j++) {
s = get_submitter(j);
- for (i = 0; i < depth; i++) {
+ for (i = 0; i < roundup_pow2(depth); i++) {
void *buf;
if (posix_memalign(&buf, bs, bs)) {
void *buf;
if (posix_memalign(&buf, bs, bs)) {