summaryrefslogtreecommitdiff
path: root/fifo.h
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2007-05-16 11:54:43 +0200
committerJens Axboe <jens.axboe@oracle.com>2007-05-16 11:54:43 +0200
commit104bc4bdf55bd79c2b3f9087601c3df4aa884b2a (patch)
tree1b08b9baf6630ce61ce615d35fe2d1ee2ded865a /fifo.h
parent0db2679750e4cc8f38af7af135f1ba8481d6def6 (diff)
downloadfio-104bc4bdf55bd79c2b3f9087601c3df4aa884b2a.tar.gz
fio-104bc4bdf55bd79c2b3f9087601c3df4aa884b2a.tar.bz2
fifo updates
Diffstat (limited to 'fifo.h')
-rw-r--r--fifo.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/fifo.h b/fifo.h
index cfacea99..8e34fb61 100644
--- a/fifo.h
+++ b/fifo.h
@@ -35,6 +35,11 @@ static inline unsigned int fifo_len(struct fifo *fifo)
return fifo->in - fifo->out;
}
+static inline unsigned int fifo_room(struct fifo *fifo)
+{
+ return fifo->size - fifo->in + fifo->out;
+}
+
#define min(x,y) ({ \
typeof(x) _x = (x); \
typeof(y) _y = (y); \