From: Francis Giraldeau Date: Wed, 3 Sep 2014 19:47:21 +0000 (-0400) Subject: Define max nesting count constant X-Git-Tag: v2.11.0-rc1~34 X-Git-Url: http://git.lttng.org/?p=lttng-modules.git;a=commitdiff_plain;h=b055caba03c71b621bff8ec9caa0e041ac6489a9 Define max nesting count constant Extract the constant within the code as #define. The define is added to frontend.h in order to be included in other source files. Signed-off-by: Francis Giraldeau Signed-off-by: Mathieu Desnoyers --- diff --git a/lib/ringbuffer/frontend.h b/lib/ringbuffer/frontend.h index 1450cb7f..ba96d9a6 100644 --- a/lib/ringbuffer/frontend.h +++ b/lib/ringbuffer/frontend.h @@ -51,6 +51,9 @@ /* Internal helpers */ #include +/* Max ring buffer nesting count, see lib_ring_buffer_get_cpu(). */ +#define RING_BUFFER_MAX_NESTING 4 + /* Buffer creation/removal and setup operations */ /* diff --git a/lib/ringbuffer/frontend_api.h b/lib/ringbuffer/frontend_api.h index 23118c46..b4a8db89 100644 --- a/lib/ringbuffer/frontend_api.h +++ b/lib/ringbuffer/frontend_api.h @@ -58,7 +58,7 @@ int lib_ring_buffer_get_cpu(const struct lib_ring_buffer_config *config) nesting = ++per_cpu(lib_ring_buffer_nesting, cpu); barrier(); - if (unlikely(nesting > 4)) { + if (unlikely(nesting > RING_BUFFER_MAX_NESTING)) { WARN_ON_ONCE(1); per_cpu(lib_ring_buffer_nesting, cpu)--; rcu_read_unlock_sched_notrace();