X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=lib%2Fringbuffer%2Ffrontend_types.h;h=e8c4c5ce8a4f5dd89da66cce76d5c8af7e66e356;hb=9115fbdc0d5b0d69b32d3d4d924624fbbe22638e;hp=d269c00a685221086448b249724326f6acc5b81f;hpb=f3bc08c50e1b302bceea699027d889fd6d9af525;p=lttng-modules.git diff --git a/lib/ringbuffer/frontend_types.h b/lib/ringbuffer/frontend_types.h index d269c00a..e8c4c5ce 100644 --- a/lib/ringbuffer/frontend_types.h +++ b/lib/ringbuffer/frontend_types.h @@ -16,6 +16,7 @@ * Dual LGPL v2.1/GPL v2 license. */ +#include #include "../../wrapper/ringbuffer/config.h" #include "../../wrapper/ringbuffer/backend_types.h" #include "../../wrapper/prio_heap.h" /* For per-CPU read-side iterator */ @@ -62,7 +63,7 @@ struct channel { int hp_iter_enable:1; /* Enable hp iter notif. */ wait_queue_head_t read_wait; /* reader wait queue */ struct channel_iter iter; /* Channel read-side iterator */ - atomic_long_t read_ref; /* Reader reference count */ + struct kref ref; /* Reference count */ }; /* Per-subbuffer commit counters used on the hot path */ @@ -138,6 +139,12 @@ struct lib_ring_buffer { int read_timer_enabled:1; /* Protected by ring_buffer_nohz_lock */ }; +static inline +void *channel_get_private(struct channel *chan) +{ + return chan->backend.priv; +} + /* * Issue warnings and disable channels upon internal error. * Can receive struct lib_ring_buffer or struct lib_ring_buffer_backend