From d7c35b6823ad351e55d72d0190ed1589a48cebb3 Mon Sep 17 00:00:00 2001 From: jacob Date: Thu, 24 Jun 2004 19:46:57 +0000 Subject: [PATCH] Correct fix for 2.6 cpu affinity support --- lnet/archdep.m4 | 12 ++++++++++++ lnet/include/linux/portals_compat25.h | 2 ++ lustre/portals/archdep.m4 | 12 ++++++++++++ lustre/portals/include/linux/portals_compat25.h | 2 ++ 4 files changed, 28 insertions(+) diff --git a/lnet/archdep.m4 b/lnet/archdep.m4 index a550a4c..c705006 100644 --- a/lnet/archdep.m4 +++ b/lnet/archdep.m4 @@ -530,6 +530,18 @@ if test x$enable_modules != xno ; then ],[ AC_MSG_RESULT([no]) ]) + AC_MSG_CHECKING([if kernel defines cpumask_t]) + LUSTRE_MODULE_TRY_COMPILE( + [ + #include + ],[ + return sizeof (cpumask_t); + ],[ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_CPUMASK_T, 1, [cpumask_t found]) + ],[ + AC_MSG_RESULT([no]) + ]) # ---------- modules? ------------------------ diff --git a/lnet/include/linux/portals_compat25.h b/lnet/include/linux/portals_compat25.h index a9dae01..7fe6dfc 100644 --- a/lnet/include/linux/portals_compat25.h +++ b/lnet/include/linux/portals_compat25.h @@ -82,6 +82,8 @@ extern int is_kernel_text_address(unsigned long addr); #ifndef HAVE_CPU_ONLINE #define cpu_online(cpu) (test_bit(cpu_online_map, &(cpu))) +#endif +#ifndef HAVE_CPUMASK_T #define cpu_set(cpu, map) (set_bit(cpu, &(map))) typedef unsigned long cpumask_t; #endif diff --git a/lustre/portals/archdep.m4 b/lustre/portals/archdep.m4 index a550a4c..c705006 100644 --- a/lustre/portals/archdep.m4 +++ b/lustre/portals/archdep.m4 @@ -530,6 +530,18 @@ if test x$enable_modules != xno ; then ],[ AC_MSG_RESULT([no]) ]) + AC_MSG_CHECKING([if kernel defines cpumask_t]) + LUSTRE_MODULE_TRY_COMPILE( + [ + #include + ],[ + return sizeof (cpumask_t); + ],[ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_CPUMASK_T, 1, [cpumask_t found]) + ],[ + AC_MSG_RESULT([no]) + ]) # ---------- modules? ------------------------ diff --git a/lustre/portals/include/linux/portals_compat25.h b/lustre/portals/include/linux/portals_compat25.h index a9dae01..7fe6dfc 100644 --- a/lustre/portals/include/linux/portals_compat25.h +++ b/lustre/portals/include/linux/portals_compat25.h @@ -82,6 +82,8 @@ extern int is_kernel_text_address(unsigned long addr); #ifndef HAVE_CPU_ONLINE #define cpu_online(cpu) (test_bit(cpu_online_map, &(cpu))) +#endif +#ifndef HAVE_CPUMASK_T #define cpu_set(cpu, map) (set_bit(cpu, &(map))) typedef unsigned long cpumask_t; #endif -- 1.8.3.1