fifo updates
[fio.git] / fifo.h
diff --git a/fifo.h b/fifo.h
index 6a9115d48e4561702325b1921da191444b95f9eb..8e34fb61f3675fa250696e5bf92348dfe531b2bc 100644 (file)
--- a/fifo.h
+++ b/fifo.h
@@ -28,12 +28,18 @@ struct fifo {
 struct fifo *fifo_alloc(unsigned int);
 unsigned int fifo_put(struct fifo *, void *, unsigned int);
 unsigned int fifo_get(struct fifo *, void *, unsigned int);
+void fifo_free(struct fifo *);
 
 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);     \