X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=fifo.h;h=8e34fb61f3675fa250696e5bf92348dfe531b2bc;hp=cfacea996f0309b323b93b67a79f1b89d555dd2b;hb=e4dad9c614d7f6842b0efefbae3ca0fa540cad0a;hpb=38470f85fa4acddab4339db9c8805a19bc87578e;ds=sidebyside 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); \