From e93e3cd2fb3da6c18d741cab19ff72f1c8537fa7 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 23 Nov 2020 15:59:23 +0000 Subject: [PATCH] scst/include/backport.h: Port READ_REF_COUNT() to Linux kernel v5.10 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9190 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scst/include/backport.h b/scst/include/backport.h index 508fcf011..52e38e693 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -1184,7 +1184,11 @@ typedef unsigned percpu_count_t; #define READ_REF_COUNT(ref) atomic_read(&(ref)->count) #else typedef unsigned long percpu_count_t; +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0) #define READ_REF_COUNT(ref) atomic_long_read(&(ref)->count) +#else +#define READ_REF_COUNT(ref) atomic_long_read(&(ref)->data->count) +#endif #endif /*