mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Add autoconf checks for atomic64_cmpxchg + atomic64_xchg
These functions didn't exist for all archs prior to 2.6.24. This
patch addes an autoconf test to detect this and add them when needed.
The autoconf check is needed instead of just an #ifndef because in
the most modern kernels atomic64_{cmp}xchg are implemented as in
inline function and not a #define.
This commit is contained in:
@@ -55,5 +55,13 @@ static inline void atomic64_set(atomic64_t *v, __s64 i)
|
||||
|
||||
#endif /* HAVE_ATOMIC64_T */
|
||||
|
||||
#ifndef HAVE_ATOMIC64_CMPXCHG
|
||||
#define atomic64_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n)))
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ATOMIC64_XCHG
|
||||
#define atomic64_xchg(v, n) (xchg(&((v)->counter), n))
|
||||
#endif
|
||||
|
||||
#endif /* _SPL_ATOMIC_COMPAT_H */
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <sys/types.h>
|
||||
#include <asm/atomic_compat.h>
|
||||
|
||||
/*
|
||||
* Two approaches to atomic operations are implemented each with its
|
||||
|
||||
Reference in New Issue
Block a user