From: Michael Jeanson Date: Fri, 18 Nov 2022 16:42:33 +0000 (-0500) Subject: Drop 'linux/atomic.h' wrapper X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=e481d68f7e5b3789926faba6473f15fc3081c6e3;p=lttng-modules.git Drop 'linux/atomic.h' wrapper Change-Id: Ia4341ded38739dbdd7db5fcd4b5bc192b2150c11 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/include/wrapper/atomic.h b/include/wrapper/atomic.h deleted file mode 100644 index 31bf3284..00000000 --- a/include/wrapper/atomic.h +++ /dev/null @@ -1,38 +0,0 @@ -/* SPDX-License-Identifier: (GPL-2.0-only OR LGPL-2.1-only) - * - * wrapper/atomic.h - * - * wrapper around linux/atomic.h. - * - * Copyright (C) 2014 Mathieu Desnoyers - */ - -#ifndef _LTTNG_WRAPPER_ATOMIC_H -#define _LTTNG_WRAPPER_ATOMIC_H - -#include -#include - -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,16,0)) -static inline void lttng_smp_mb__before_atomic(void) -{ - smp_mb__before_atomic(); -} - -static inline void lttng_smp_mb__after_atomic(void) -{ - smp_mb__after_atomic(); -} -#else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,16,0)) */ -static inline void lttng_smp_mb__before_atomic(void) -{ - smp_mb__before_atomic_inc(); -} - -static inline void lttng_smp_mb__after_atomic(void) -{ - smp_mb__after_atomic_inc(); -} -#endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,16,0)) */ - -#endif /* _LTTNG_WRAPPER_ATOMIC_H */ diff --git a/src/lib/ringbuffer/ring_buffer_frontend.c b/src/lib/ringbuffer/ring_buffer_frontend.c index 8a69e9ab..e12c7026 100644 --- a/src/lib/ringbuffer/ring_buffer_frontend.c +++ b/src/lib/ringbuffer/ring_buffer_frontend.c @@ -37,6 +37,7 @@ * - put_subbuf */ +#include #include #include #include @@ -47,7 +48,6 @@ #include #include #include -#include #include #include #include @@ -1047,7 +1047,7 @@ int lib_ring_buffer_open_read(struct lttng_kernel_ring_buffer *buf) atomic_long_dec(&buf->active_readers); return -EOVERFLOW; } - lttng_smp_mb__after_atomic(); + smp_mb__after_atomic(); return 0; } EXPORT_SYMBOL_GPL(lib_ring_buffer_open_read); @@ -1057,7 +1057,7 @@ void lib_ring_buffer_release_read(struct lttng_kernel_ring_buffer *buf) struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; CHAN_WARN_ON(chan, atomic_long_read(&buf->active_readers) != 1); - lttng_smp_mb__before_atomic(); + smp_mb__before_atomic(); atomic_long_dec(&buf->active_readers); kref_put(&chan->ref, channel_release); }