mirror of
https://salsa.debian.org/ha-team/libqb
synced 2026-08-12 22:17:34 +00:00
RB: use the same mechanism in reclaim as read/peek to detect end-of-ring
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
This commit is contained in:
parent
cec82e0117
commit
3369581066
@ -513,9 +513,13 @@ static void
|
||||
_rb_chunk_reclaim(struct qb_ringbuffer_s * rb)
|
||||
{
|
||||
uint32_t old_read_pt;
|
||||
uint32_t chunk_magic;
|
||||
|
||||
old_read_pt = rb->shared_hdr->read_pt;
|
||||
QB_MAGIC_ASSERT(old_read_pt);
|
||||
chunk_magic = QB_RB_CHUNK_MAGIC_GET(rb, old_read_pt);
|
||||
if (chunk_magic != QB_RB_CHUNK_MAGIC) {
|
||||
return;
|
||||
}
|
||||
|
||||
rb->shared_hdr->read_pt = qb_rb_chunk_step(rb, old_read_pt);
|
||||
|
||||
@ -533,7 +537,7 @@ _rb_chunk_reclaim(struct qb_ringbuffer_s * rb)
|
||||
void
|
||||
qb_rb_chunk_reclaim(struct qb_ringbuffer_s * rb)
|
||||
{
|
||||
if (rb == NULL || qb_rb_space_used(rb) == 0) {
|
||||
if (rb == NULL) {
|
||||
return;
|
||||
}
|
||||
_rb_chunk_reclaim(rb);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user