3 #include "io_u_queue.h"
6 bool io_u_qinit(struct io_u_queue *q, unsigned int nr, bool shared)
9 q->io_us = smalloc(nr * sizeof(struct io_u *));
11 q->io_us = calloc(nr, sizeof(struct io_u *));
21 void io_u_qexit(struct io_u_queue *q, bool shared)
29 bool io_u_rinit(struct io_u_ring *ring, unsigned int nr)
32 if (ring->max & (ring->max - 1)) {
34 ring->max |= ring->max >> 1;
35 ring->max |= ring->max >> 2;
36 ring->max |= ring->max >> 4;
37 ring->max |= ring->max >> 8;
38 ring->max |= ring->max >> 16;
42 ring->ring = calloc(ring->max, sizeof(struct io_u *));
46 ring->head = ring->tail = 0;
50 void io_u_rexit(struct io_u_ring *ring)