CLEANUP: ring: remove the now unused ring's offset
Since the previous patch, the ring's offset is not used anymore. The
haring utility remains backward-compatible since it can trust the
buffer element that's at the beginning of the map and which still
contains all the valid data.
diff --git a/include/haproxy/ring-t.h b/include/haproxy/ring-t.h
index 7e4d518..b89c886 100644
--- a/include/haproxy/ring-t.h
+++ b/include/haproxy/ring-t.h
@@ -98,7 +98,6 @@
struct ring {
struct buffer buf; // storage area
- size_t ofs; // absolute offset in history of the buffer's head
struct list waiters; // list of waiters, for now, CLI "show event"
__decl_thread(HA_RWLOCK_T lock);
int readers_count;
diff --git a/src/ring.c b/src/ring.c
index b246694..c3baf88 100644
--- a/src/ring.c
+++ b/src/ring.c
@@ -42,7 +42,6 @@
HA_RWLOCK_INIT(&ring->lock);
LIST_INIT(&ring->waiters);
ring->readers_count = 0;
- ring->ofs = 0;
ring->buf = b_make(area, size, 0, 0);
/* write the initial RC byte */
b_putchr(&ring->buf, 0);
@@ -221,7 +220,6 @@
BUG_ON(b_data(buf) < 1 + dellenlen + dellen);
b_del(buf, 1 + dellenlen + dellen);
- ring->ofs += 1 + dellenlen + dellen;
}
/* OK now we do have room */