summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-kernel/spl/files')
-rw-r--r--sys-kernel/spl/files/spl-0.6.0_rc14-fix-atomic64-checks.patch70
-rw-r--r--sys-kernel/spl/files/spl-0.6.0_rc14-fix-mutex-owner-check.patch33
2 files changed, 103 insertions, 0 deletions
diff --git a/sys-kernel/spl/files/spl-0.6.0_rc14-fix-atomic64-checks.patch b/sys-kernel/spl/files/spl-0.6.0_rc14-fix-atomic64-checks.patch
new file mode 100644
index 000000000000..9ac8a4308dd6
--- /dev/null
+++ b/sys-kernel/spl/files/spl-0.6.0_rc14-fix-atomic64-checks.patch
@@ -0,0 +1,70 @@
+From dd3678fc29d75286b57e705454bbd7e60e1b44e0 Mon Sep 17 00:00:00 2001
+From: Brian Behlendorf <behlendorf1@llnl.gov>
+Date: Tue, 5 Feb 2013 09:35:43 -0800
+Subject: [PATCH] Fix atomic64_* autoconf checks
+
+The SPL_AC_ATOMIC_SPINLOCK, SPL_AC_TYPE_ATOMIC64_CMPXCHG, and
+SPL_AC_TYPE_ATOMIC64_XCHG were all directly including the
+'asm/atomic.h' header. As of Linux 3.4 this header was removed
+which results in a build failure.
+
+The right thing to do is include 'linux/atomic.h' however we
+can't safely do this because it doesn't exist in 2.6.26 kernels.
+Therefore, we include 'linux/fs.h' which in turn includes the
+correct atomic header regardless of the kernel version.
+
+When these incorrect APIs are used in ZFS the following build
+failure results.
+
+ arc.c:791:80: warning: '__ret' may be used uninitialized
+ in this function [-Wuninitialized]
+ arc.c:791:1875: error: call to '__cmpxchg_wrong_size'
+ declared with attribute error: Bad argument size for cmpxchg
+
+Since this is all Linux 2.6.24 compatibility code there's
+an argument to be made that it should be removed because
+kernels this old are not supported. However, because we're
+so close to a release I'm going to leave it in place for now.
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Closes zfsonlinux/zfs#814
+Closes zfsonlinux/zfs#1254
+---
+ config/spl-build.m4 | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/config/spl-build.m4 b/config/spl-build.m4
+index e9695de..8518404 100644
+--- a/config/spl-build.m4
++++ b/config/spl-build.m4
+@@ -777,7 +777,7 @@ AC_DEFUN([SPL_AC_ATOMIC_SPINLOCK], [
+ [enable_atomic_spinlocks=check])
+
+ SPL_LINUX_TRY_COMPILE([
+- #include <asm/atomic.h>
++ #include <linux/fs.h>
+ ],[
+ atomic64_t *ptr __attribute__ ((unused));
+ ],[
+@@ -820,8 +820,7 @@ dnl #
+ AC_DEFUN([SPL_AC_TYPE_ATOMIC64_CMPXCHG],
+ [AC_MSG_CHECKING([whether kernel defines atomic64_cmpxchg])
+ SPL_LINUX_TRY_COMPILE([
+- #include <asm/atomic.h>
+- #include <asm/system.h>
++ #include <linux/fs.h>
+ ],[
+ atomic64_cmpxchg((atomic64_t *)NULL, 0, 0);
+ ],[
+@@ -840,7 +839,7 @@ dnl #
+ AC_DEFUN([SPL_AC_TYPE_ATOMIC64_XCHG],
+ [AC_MSG_CHECKING([whether kernel defines atomic64_xchg])
+ SPL_LINUX_TRY_COMPILE([
+- #include <asm/atomic.h>
++ #include <linux/fs.h>
+ ],[
+ atomic64_xchg((atomic64_t *)NULL, 0);
+ ],[
+--
+1.7.10
+
diff --git a/sys-kernel/spl/files/spl-0.6.0_rc14-fix-mutex-owner-check.patch b/sys-kernel/spl/files/spl-0.6.0_rc14-fix-mutex-owner-check.patch
new file mode 100644
index 000000000000..ee7314d3cf32
--- /dev/null
+++ b/sys-kernel/spl/files/spl-0.6.0_rc14-fix-mutex-owner-check.patch
@@ -0,0 +1,33 @@
+From a0625691b39468d04eb716919e237f96a3987b48 Mon Sep 17 00:00:00 2001
+From: Richard Yao <ryao@cs.stonybrook.edu>
+Date: Tue, 5 Feb 2013 16:42:29 -0500
+Subject: [PATCH] Fix HAVE_MUTEX_OWNER_TASK_STRUCT autotools check on PPC64
+
+The HAVE_MUTEX_OWNER_TASK_STRUCT fails on PPC64 with the following
+error:
+
+error: 'current' undeclared (first use in this function)
+
+We include linux/sched.h to ensure that current is available.
+
+Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+---
+ config/spl-build.m4 | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/config/spl-build.m4 b/config/spl-build.m4
+index 8518404..4cb7e1d 100644
+--- a/config/spl-build.m4
++++ b/config/spl-build.m4
+@@ -1269,6 +1269,7 @@ AC_DEFUN([SPL_AC_MUTEX_OWNER_TASK_STRUCT], [
+ EXTRA_KCFLAGS="-Werror"
+ SPL_LINUX_TRY_COMPILE([
+ #include <linux/mutex.h>
++ #include <linux/sched.h>
+ ],[
+ struct mutex mtx __attribute__ ((unused));
+ mtx.owner = current;
+--
+1.7.10
+