Lines Matching refs:head_offset
33 uint64_t head_offset; member
51 r->head_offset = r->ctail_offset = 0; in OSSL_SAFE_MATH_UNSIGNED()
67 return (size_t)(r->head_offset - r->ctail_offset); in ring_buf_used()
87 > safe_add_u64(r->head_offset, avail, &err) in ring_buf_write_at()
88 || safe_add_u64(r->head_offset, buf_len, &err) in ring_buf_write_at()
100 if (r->head_offset < logical_offset + l) in ring_buf_write_at()
101 r->head_offset = logical_offset + l; in ring_buf_write_at()
125 if (buf_len > MAX_OFFSET - r->head_offset) in ring_buf_push()
126 buf_len = (size_t)(MAX_OFFSET - r->head_offset); in ring_buf_push()
131 idx = r->head_offset % r->alloc; in ring_buf_push()
137 r->head_offset += l; in ring_buf_push()
153 if (logical_offset >= r->head_offset || logical_offset < r->ctail_offset) in ring_buf_get_ptr()
180 if (logical_offset > r->head_offset || logical_offset < r->ctail_offset) in ring_buf_get_buf_at()
190 l = (size_t)(r->head_offset - logical_offset); in ring_buf_get_buf_at()
213 if (cleanse_end > r->head_offset) in ring_buf_cpop_range()
214 cleanse_end = r->head_offset; in ring_buf_cpop_range()
227 if (r->head_offset < r->ctail_offset) in ring_buf_cpop_range()
228 r->head_offset = r->ctail_offset; in ring_buf_cpop_range()
249 rnew.head_offset = r->head_offset - ring_buf_used(r); in ring_buf_resize()
250 rnew.ctail_offset = rnew.head_offset; in ring_buf_resize()
269 assert(rnew.head_offset == r->head_offset); in ring_buf_resize()