X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lib%2Fringbuffer%2Ffrontend_api.h;h=21e53ea2b49e6a4812557e4c0b11c5018ee2914d;hb=80bb26003945e96a8ade9c8788dab9b2e08cbc08;hp=23118c46d98d8cbfa424131e4ca9454ab2e89254;hpb=cc62f29ec5d5149ae6dba1a9acb538e06da07a94;p=lttng-modules.git diff --git a/lib/ringbuffer/frontend_api.h b/lib/ringbuffer/frontend_api.h index 23118c46..21e53ea2 100644 --- a/lib/ringbuffer/frontend_api.h +++ b/lib/ringbuffer/frontend_api.h @@ -1,34 +1,18 @@ -#ifndef _LIB_RING_BUFFER_FRONTEND_API_H -#define _LIB_RING_BUFFER_FRONTEND_API_H - -/* +/* SPDX-License-Identifier: (GPL-2.0 OR LGPL-2.1) + * * lib/ringbuffer/frontend_api.h * * Ring Buffer Library Synchronization Header (buffer write API). * * Copyright (C) 2005-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 - * - * Author: - * Mathieu Desnoyers - * * See ring_buffer_frontend.c for more information on wait-free algorithms. * See linux/ringbuffer/frontend.h for channel allocation and read-side API. */ +#ifndef _LIB_RING_BUFFER_FRONTEND_API_H +#define _LIB_RING_BUFFER_FRONTEND_API_H + #include #include #include @@ -58,7 +42,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();