]> git.proxmox.com Git - mirror_spl-debian.git/commitdiff
Linux compat 3.7.1, on_each_cpu()
authorBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 7 Jan 2013 22:09:09 +0000 (14:09 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 9 Jan 2013 18:28:28 +0000 (10:28 -0800)
Some kernels require that we include the 'linux/irqflags.h'
header for the SPL_AC_3ARGS_ON_EACH_CPU check.  Otherwise,
the functions local_irq_enable()/local_irq_disable() will not
be defined and the prototype will be misdetected as the four
argument version.

This change actually include 'linux/interrupt.h' which in turn
includes 'linux/irqflags.h' to be as generic as possible.

Additionally, passing NULL as the function can result in a
gcc error because the on_each_cpu() macro executes it
unconditionally.  To make the test more robust we pass the
dummy function on_each_cpu_func().

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #204

config/spl-build.m4

index f710d8e953b6b93537d4f49f6da0922f73e869b8..6e4afedbabb820aed82dfc5a0d563b9526fedc09 100644 (file)
@@ -1312,9 +1312,12 @@ dnl #
 AC_DEFUN([SPL_AC_3ARGS_ON_EACH_CPU], [
        AC_MSG_CHECKING([whether on_each_cpu() wants 3 args])
        SPL_LINUX_TRY_COMPILE([
+               #include <linux/interrupt.h>
                #include <linux/smp.h>
+
+               void on_each_cpu_func(void *data) { return; }
        ],[
-               on_each_cpu(NULL, NULL, 0);
+               on_each_cpu(on_each_cpu_func, NULL, 0);
        ],[
                AC_MSG_RESULT(yes)
                AC_DEFINE(HAVE_3ARGS_ON_EACH_CPU, 1,