Lines Matching defs:ring
19 int io_u_rinit(struct io_u_ring *ring, unsigned int nr)
21 ring->max = nr + 1;
22 if (ring->max & (ring->max - 1)) {
23 ring->max--;
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;
29 ring->max++;
32 ring->ring = calloc(ring->max, sizeof(struct io_u *));
33 if (!ring->ring)
36 ring->head = ring->tail = 0;
40 void io_u_rexit(struct io_u_ring *ring)
42 free(ring->ring);