Lines Matching refs:brb
101 static void brb_init(struct bop_ring_buffer *brb) in brb_init() argument
103 brb->begin = 0; in brb_init()
104 brb->end = 0; in brb_init()
107 static bool brb_empty(struct bop_ring_buffer *brb) in brb_empty() argument
109 return brb->begin == brb->end; in brb_empty()
112 static unsigned brb_next(struct bop_ring_buffer *brb, unsigned old) in brb_next() argument
115 return r >= ARRAY_SIZE(brb->bops) ? 0 : r; in brb_next()
118 static int brb_push(struct bop_ring_buffer *brb, in brb_push() argument
122 unsigned next = brb_next(brb, brb->end); in brb_push()
128 if (next == brb->begin) in brb_push()
131 bop = brb->bops + brb->end; in brb_push()
135 brb->end = next; in brb_push()
140 static int brb_peek(struct bop_ring_buffer *brb, struct block_op *result) in brb_peek() argument
144 if (brb_empty(brb)) in brb_peek()
147 bop = brb->bops + brb->begin; in brb_peek()
154 static int brb_pop(struct bop_ring_buffer *brb) in brb_pop() argument
156 if (brb_empty(brb)) in brb_pop()
159 brb->begin = brb_next(brb, brb->begin); in brb_pop()