summaryrefslogtreecommitdiff
path: root/io_u_queue.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2017-11-02 12:26:39 -0600
committerJens Axboe <axboe@kernel.dk>2017-11-02 12:26:39 -0600
commit34851ad5ffacf9f4f8a7f23ee2edb17281b917a0 (patch)
tree5f59e1b14724a6fd96411e2bee870605fc7902cd /io_u_queue.c
parent52db2dac09ed4f37273e471db062c8aae96a0b50 (diff)
downloadfio-34851ad5ffacf9f4f8a7f23ee2edb17281b917a0.tar.gz
fio-34851ad5ffacf9f4f8a7f23ee2edb17281b917a0.tar.bz2
io_u_queue: convert rings to bool
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_u_queue.c')
-rw-r--r--io_u_queue.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/io_u_queue.c b/io_u_queue.c
index 9994c787..8cf4c8c3 100644
--- a/io_u_queue.c
+++ b/io_u_queue.c
@@ -1,15 +1,15 @@
#include <stdlib.h>
#include "io_u_queue.h"
-int io_u_qinit(struct io_u_queue *q, unsigned int nr)
+bool io_u_qinit(struct io_u_queue *q, unsigned int nr)
{
q->io_us = calloc(nr, sizeof(struct io_u *));
if (!q->io_us)
- return 1;
+ return false;
q->nr = 0;
q->max = nr;
- return 0;
+ return true;
}
void io_u_qexit(struct io_u_queue *q)
@@ -17,7 +17,7 @@ void io_u_qexit(struct io_u_queue *q)
free(q->io_us);
}
-int io_u_rinit(struct io_u_ring *ring, unsigned int nr)
+bool io_u_rinit(struct io_u_ring *ring, unsigned int nr)
{
ring->max = nr + 1;
if (ring->max & (ring->max - 1)) {
@@ -32,10 +32,10 @@ int io_u_rinit(struct io_u_ring *ring, unsigned int nr)
ring->ring = calloc(ring->max, sizeof(struct io_u *));
if (!ring->ring)
- return 1;
+ return false;
ring->head = ring->tail = 0;
- return 0;
+ return true;
}
void io_u_rexit(struct io_u_ring *ring)