2 #include "io_u_queue.h"
4 int io_u_qinit(struct io_u_queue *q, unsigned int nr)
6 q->io_us = calloc(sizeof(struct io_u *), nr);
14 void io_u_qexit(struct io_u_queue *q)
19 int io_u_rinit(struct io_u_ring *ring, unsigned int nr)
22 if (ring->max & (ring->max - 1)) {
24 ring->max |= ring->max >> 1;
25 ring->max |= ring->max >> 2;
26 ring->max |= ring->max >> 4;
27 ring->max |= ring->max >> 8;
28 ring->max |= ring->max >> 16;
32 ring->ring = calloc(sizeof(struct io_u *), ring->max);
36 ring->head = ring->tail = 0;
40 void io_u_rexit(struct io_u_ring *ring)