X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lib%2Fringbuffer%2Fbackend.h;h=da937f29d6f8cc3c8954ca4be7361e9f7e003139;hb=80bb26003945e96a8ade9c8788dab9b2e08cbc08;hp=9db0095638973a2e0fb6da77affde9fb30bed8f5;hpb=85a07c33f3b180d9c1be38832961d0feef66be66;p=lttng-modules.git diff --git a/lib/ringbuffer/backend.h b/lib/ringbuffer/backend.h index 9db00956..da937f29 100644 --- a/lib/ringbuffer/backend.h +++ b/lib/ringbuffer/backend.h @@ -1,31 +1,18 @@ -#ifndef _LIB_RING_BUFFER_BACKEND_H -#define _LIB_RING_BUFFER_BACKEND_H - -/* +/* SPDX-License-Identifier: (GPL-2.0 OR LGPL-2.1) + * * lib/ringbuffer/backend.h * * Ring buffer backend (API). * * Copyright (C) 2010-2012 Mathieu Desnoyers * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; only - * version 2.1 of the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * * Credits to Steven Rostedt for proposing to use an extra-subbuffer owned by * the reader in flight recorder mode. */ +#ifndef _LIB_RING_BUFFER_BACKEND_H +#define _LIB_RING_BUFFER_BACKEND_H + #include #include #include @@ -34,7 +21,7 @@ #include #include #include -#include +#include /* Internal helpers */ #include @@ -169,7 +156,7 @@ size_t lib_ring_buffer_do_strcpy(const struct lib_ring_buffer_config *config, * Only read source character once, in case it is * modified concurrently. */ - c = ACCESS_ONCE(src[count]); + c = READ_ONCE(src[count]); if (!c) break; lib_ring_buffer_do_copy(config, &dest[count], &c, 1); @@ -302,7 +289,7 @@ void lib_ring_buffer_copy_from_user_inatomic(const struct lib_ring_buffer_config set_fs(KERNEL_DS); pagefault_disable(); - if (unlikely(!access_ok(VERIFY_READ, src, len))) + if (unlikely(!lttng_access_ok(VERIFY_READ, src, len))) goto fill_buffer; if (likely(pagecpy == len)) { @@ -372,7 +359,7 @@ void lib_ring_buffer_strcpy_from_user_inatomic(const struct lib_ring_buffer_conf set_fs(KERNEL_DS); pagefault_disable(); - if (unlikely(!access_ok(VERIFY_READ, src, len))) + if (unlikely(!lttng_access_ok(VERIFY_READ, src, len))) goto fill_buffer; if (likely(pagecpy == len)) { @@ -462,7 +449,7 @@ unsigned long lib_ring_buffer_copy_from_user_check_nofault(void *dest, unsigned long ret; mm_segment_t old_fs; - if (!access_ok(VERIFY_READ, src, len)) + if (!lttng_access_ok(VERIFY_READ, src, len)) return 1; old_fs = get_fs(); set_fs(KERNEL_DS);