Added headers and macros to support IB core on RHEL7.4
[compat-rdma/compat.git] / include / linux / refcount.h
1 #ifndef _MLNX_LINUX_REFCOUNT_H
2 #define _MLNX_LINUX_REFCOUNT_H
3
4 #include "../../compat/config.h"
5
6 #ifdef HAVE_REFCOUNT
7 #include_next <linux/refcount.h>
8 #else /* HAVE_REFCOUNT */
9
10 /* simply map back to atomic interface */
11
12 #include <linux/atomic.h>
13
14 #define refcount_t              atomic_t
15 #define refcount_set            atomic_set
16 #define refcount_inc            atomic_inc
17 #define refcount_dec            atomic_dec
18 #define refcount_read           atomic_read
19 #define refcount_inc_not_zero   atomic_inc_not_zero
20 #define refcount_dec_and_test   atomic_dec_and_test
21
22 #endif /* HAVE_REFCOUNT */
23
24
25 #endif /* _MLNX_LINUX_REFCOUNT_H */