X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=wrapper%2Fkref.h;h=3f3be7a42d27c0445d7273fc771b5d55dd120248;hb=77932315cd23b50c88462872a3b86ad5997e5b47;hp=f30a9aed515db306a1803ff5e4bcc2612a75801b;hpb=4c4d77dacf277775cb395190cf827c7f0c226a99;p=lttng-modules.git diff --git a/wrapper/kref.h b/wrapper/kref.h index f30a9aed..3f3be7a4 100644 --- a/wrapper/kref.h +++ b/wrapper/kref.h @@ -28,15 +28,24 @@ #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)) +static inline int lttng_kref_get(struct kref *kref) +{ + kref_get(kref); + return 1; +} +#else /* #if (LINUX_VERSION_CODE >= 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 /* _LTTNG_WRAPPER_KREF_H */