]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MAJOR: ring: insert an intermediary ring_storage level
authorWilly Tarreau <w@1wt.eu>
Sun, 3 Mar 2024 16:20:10 +0000 (17:20 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 25 Mar 2024 17:34:19 +0000 (17:34 +0000)
commit03816ccfa94a138fccbbb031efda08bcb8e0caaa
tree445f23d21fd4e9cfd5c784c656346b9c5d50e6e3
parent01abdcb307e618ecbb04c64a730f62a2c9d4932c
MAJOR: ring: insert an intermediary ring_storage level

We'll need to add more complex structures in the ring, such as wait
queues. That's far too much to be stored into the area in case of
file-backed contents, so let's split the ring definition and its
storage once for all.

This patch introduces a struct ring_storage which is assigned to
ring->storage, which contains minimal information to represent the
storage layout, i.e. for now only the buffer, and all the rest
remains in the ring itself. The storage is appended immediately after
it and the buffer's pointer always points to that area. It has the
benefit of remaining 100% compatible with the existing file-backed
layout. In memory, the allocation loses the size of a struct buffer.

It's not even certain it's worth placing the size there, given that it's
constant and that a dump of a ring wouldn't really need it (the file size
is sufficient). But for now everything comes with the struct buffer, and
later this will change once split into head and tail. Also this area may
be completed with more information in the future (e.g. storage version,
format, endianness, word size etc).
include/haproxy/ring-t.h
include/haproxy/ring.h
src/errors.c
src/ring.c
src/sink.c