X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=wrapper%2Fkref.h;h=7bae66064a741748fd5947450127509976a82f10;hb=0d8e4ab93e6b70598e1e54dd1605aab3bb2ce0e1;hp=3f3be7a42d27c0445d7273fc771b5d55dd120248;hpb=77932315cd23b50c88462872a3b86ad5997e5b47;p=lttng-modules.git diff --git a/wrapper/kref.h b/wrapper/kref.h index 3f3be7a4..7bae6606 100644 --- a/wrapper/kref.h +++ b/wrapper/kref.h @@ -1,51 +1,39 @@ -#ifndef _LTTNG_WRAPPER_KREF_H -#define _LTTNG_WRAPPER_KREF_H - -/* +/* SPDX-License-Identifier: GPL-2.0 + * * wrapper/kref.h * * wrapper around linux/kref.h. * * Copyright (C) 2016 Mathieu Desnoyers * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; only version 2 of the License. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * * This wrapper code is derived from Linux 3.19.2 include/linux/list.h * and include/linux/rculist.h, hence the GPLv2 license applied to this * file. */ +#ifndef _LTTNG_WRAPPER_KREF_H +#define _LTTNG_WRAPPER_KREF_H + #include #include -#include +#include /* * lttng_kref_get: get reference count, checking for overflow. * * Return 1 if reference is taken, 0 otherwise (overflow). */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) static inline int lttng_kref_get(struct kref *kref) { kref_get(kref); return 1; } -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ +#else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) */ static inline int lttng_kref_get(struct kref *kref) { return atomic_add_unless(&kref->refcount, 1, INT_MAX); } -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ +#endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) */ #endif /* _LTTNG_WRAPPER_KREF_H */