Remove atomic64_xchg() wrappers

The atomic64_xchg() and atomic64_cmpxchg() functions have been
available since Linux 2.6.24.  There is no longer a need to
maintain this compatibility code.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
Brian Behlendorf 2014-10-01 16:31:11 -04:00
parent 82f2f1a3af
commit ff0582cb39
2 changed files with 0 additions and 48 deletions

View File

@ -23,8 +23,6 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
SPL_AC_DEBUG_KMEM_TRACKING SPL_AC_DEBUG_KMEM_TRACKING
SPL_AC_TEST_MODULE SPL_AC_TEST_MODULE
SPL_AC_ATOMIC_SPINLOCK SPL_AC_ATOMIC_SPINLOCK
SPL_AC_TYPE_ATOMIC64_CMPXCHG
SPL_AC_TYPE_ATOMIC64_XCHG
SPL_AC_TYPE_UINTPTR_T SPL_AC_TYPE_UINTPTR_T
SPL_AC_SHRINKER_CALLBACK SPL_AC_SHRINKER_CALLBACK
SPL_AC_CTL_NAME SPL_AC_CTL_NAME
@ -808,44 +806,6 @@ AC_DEFUN([SPL_AC_ATOMIC_SPINLOCK], [
AC_MSG_RESULT([$have_atomic64_t]) AC_MSG_RESULT([$have_atomic64_t])
]) ])
dnl #
dnl # 2.6.24 API change,
dnl # check if atomic64_cmpxchg is defined
dnl #
AC_DEFUN([SPL_AC_TYPE_ATOMIC64_CMPXCHG],
[AC_MSG_CHECKING([whether kernel defines atomic64_cmpxchg])
SPL_LINUX_TRY_COMPILE([
#include <linux/fs.h>
],[
atomic64_cmpxchg((atomic64_t *)NULL, 0, 0);
],[
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_ATOMIC64_CMPXCHG, 1,
[kernel defines atomic64_cmpxchg])
],[
AC_MSG_RESULT([no])
])
])
dnl #
dnl # 2.6.24 API change,
dnl # check if atomic64_xchg is defined
dnl #
AC_DEFUN([SPL_AC_TYPE_ATOMIC64_XCHG],
[AC_MSG_CHECKING([whether kernel defines atomic64_xchg])
SPL_LINUX_TRY_COMPILE([
#include <linux/fs.h>
],[
atomic64_xchg((atomic64_t *)NULL, 0);
],[
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_ATOMIC64_XCHG, 1,
[kernel defines atomic64_xchg])
],[
AC_MSG_RESULT([no])
])
])
dnl # dnl #
dnl # 2.6.24 API change, dnl # 2.6.24 API change,
dnl # check if uintptr_t typedef is defined dnl # check if uintptr_t typedef is defined

View File

@ -29,14 +29,6 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <sys/types.h> #include <sys/types.h>
#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
/* /*
* Two approaches to atomic operations are implemented each with its * Two approaches to atomic operations are implemented each with its
* own benefits are drawbacks imposed by the Solaris API. Neither * own benefits are drawbacks imposed by the Solaris API. Neither