- if (o->useriocb) {
- size_t size;
-
- ld->io_u_index = calloc(td->o.iodepth, sizeof(struct io_u *));
- size = td->o.iodepth * sizeof(struct iocb);
- ld->user_iocbs = fio_memalign(page_size, size, false);
- memset(ld->user_iocbs, 0, size);
- }
-
- /*
- * First try passing in 0 for queue depth, since we don't
- * care about the user ring. If that fails, the kernel is too old
- * and we need the right depth.
- */
- err = fio_libaio_queue_init(ld, td->o.iodepth, o->hipri, o->useriocb);
- if (err) {
- td_verror(td, -err, "io_queue_init");
- log_err("fio: check /proc/sys/fs/aio-max-nr\n");
- if (ld->user_iocbs) {
- size_t size = td->o.iodepth * sizeof(struct iocb);
- fio_memfree(ld->user_iocbs, size, false);
- }
- free(ld);
- return 1;
- }
-