Introduce get_ioengine for external engines
[fio.git] / fifo.h
diff --git a/fifo.h b/fifo.h
index cfacea996f0309b323b93b67a79f1b89d555dd2b..749136530a2c5410867f10caf672c155949daa2f 100644 (file)
--- a/fifo.h
+++ b/fifo.h
@@ -35,15 +35,24 @@ 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;
+}
+
+#ifndef min
 #define min(x,y) ({ \
        typeof(x) _x = (x);     \
        typeof(y) _y = (y);     \
        (void) (&_x == &_y);            \
        _x < _y ? _x : _y; })
+#endif
 
+#ifndef max
 #define max(x,y) ({ \
        typeof(x) _x = (x);     \
        typeof(y) _y = (y);     \
        (void) (&_x == &_y);            \
        _x > _y ? _x : _y; })
 
+#endif