- return syscall(__NR_sys_io_setup2, depth, flags, ld->user_iocbs, &ld->aio_ctx);
-#else
- if (hipri) {
- log_err("fio: polled aio not available on your platform\n");
- return 1;
+ ret = syscall(__NR_sys_io_setup2, depth, flags, ld->user_iocbs,
+ &ld->aio_ctx);
+ if (!ret)
+ return 0;
+ /* fall through to old syscall */
+#endif
+ return fio_libaio_old_queue_init(ld, depth, hipri, useriocb, fixedbufs);
+}
+
+static int fio_libaio_post_init(struct thread_data *td)
+{
+ struct libaio_data *ld = td->io_ops_data;
+ struct libaio_options *o = td->eo;
+ struct io_u *io_u;
+ struct iocb *iocb;
+ int err = 0;
+
+ if (o->fixedbufs) {
+ int i;
+
+ for (i = 0; i < td->o.iodepth; i++) {
+ io_u = ld->io_u_index[i];
+ iocb = &ld->user_iocbs[i];
+ iocb->u.c.buf = io_u->buf;
+ iocb->u.c.nbytes = io_u->buflen;
+ }