projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add the 'zbd' debug level
[fio.git]
/
io_u_queue.c
diff --git
a/io_u_queue.c
b/io_u_queue.c
index 80a32ba3afd20d4a8b3669935ca10d035720a554..8cf4c8c3d702234a1cc0b0ba5ffee83ef3a4687a 100644
(file)
--- a/
io_u_queue.c
+++ b/
io_u_queue.c
@@
-1,14
+1,15
@@
#include <stdlib.h>
#include "io_u_queue.h"
#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)
{
q->io_us = calloc(nr, sizeof(struct io_u *));
if (!q->io_us)
- return
1
;
+ return
false
;
q->nr = 0;
q->nr = 0;
- return 0;
+ q->max = nr;
+ return true;
}
void io_u_qexit(struct io_u_queue *q)
}
void io_u_qexit(struct io_u_queue *q)
@@
-16,7
+17,7
@@
void io_u_qexit(struct io_u_queue *q)
free(q->io_us);
}
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)) {
{
ring->max = nr + 1;
if (ring->max & (ring->max - 1)) {
@@
-31,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)
ring->ring = calloc(ring->max, sizeof(struct io_u *));
if (!ring->ring)
- return
1
;
+ return
false
;
ring->head = ring->tail = 0;
ring->head = ring->tail = 0;
- return
0
;
+ return
true
;
}
void io_u_rexit(struct io_u_ring *ring)
}
void io_u_rexit(struct io_u_ring *ring)