2 #include "io_u_queue.h"
4 bool io_u_qinit(struct io_u_queue *q, unsigned int nr)
6 q->io_us = calloc(nr, sizeof(struct io_u *));
15 void io_u_qexit(struct io_u_queue *q)
20 bool io_u_rinit(struct io_u_ring *ring, unsigned int nr)
23 if (ring->max & (ring->max - 1)) {
25 ring->max |= ring->max >> 1;
26 ring->max |= ring->max >> 2;
27 ring->max |= ring->max >> 4;
28 ring->max |= ring->max >> 8;
29 ring->max |= ring->max >> 16;
33 ring->ring = calloc(ring->max, sizeof(struct io_u *));
37 ring->head = ring->tail = 0;
41 void io_u_rexit(struct io_u_ring *ring)