libbpf: Add ring__size

Add ring__size to get the total size of a given ringbuffer.

Signed-off-by: Martin Kelly <martin.kelly@crowdstrike.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20230925215045.2375758-10-martin.kelly@crowdstrike.com
This commit is contained in:
Martin Kelly authored and Andrii Nakryiko committed 2023-10-02 11:17:48 -07:00
1 parent 3e675ed6ab
commit cd3fe56c75
3 files changed
+16

No files matched your search

+5
View File
@@ -361,6 +361,11 @@ size_t ring__avail_data_size(const struct ring *r)
return prod_pos - cons_pos;
}
size_t ring__size(const struct ring *r)
{
return r->mask + 1;
}
static void user_ringbuf_unmap_ring(struct user_ring_buffer *rb)
{
if (rb->consumer_pos) {