From 8e8f75857b5cd53b87967221be0b7d5266d3e178 Mon Sep 17 00:00:00 2001 From: Shuichi Ihara Date: Thu, 17 Jan 2013 20:16:16 +0900 Subject: [PATCH] LU-2631 build: fix o2ib build for 2.6.18-348.el5 kernel Adding scsi/fc_compat.h to lustre-lnet.m4 and o2iblnd.h to build o2ib modules for 2.6.18-348.el5 kernel. Signed-off-by: Shuichi Ihara Change-Id: I496eaf9977f44e90bfde7ff68215da8e651688dd Reviewed-on: http://review.whamcloud.com/5051 Tested-by: Hudson Reviewed-by: Yang Sheng Tested-by: Maloo Reviewed-by: Liang Zhen Reviewed-by: Johann Lombardi --- build/autoconf/lustre-build-linux.m4 | 1 + lnet/autoconf/lustre-lnet.m4 | 11 +++++++++++ lnet/klnds/o2iblnd/o2iblnd.h | 3 +++ 3 files changed, 15 insertions(+) diff --git a/build/autoconf/lustre-build-linux.m4 b/build/autoconf/lustre-build-linux.m4 index e15d9ec..519ca94 100644 --- a/build/autoconf/lustre-build-linux.m4 +++ b/build/autoconf/lustre-build-linux.m4 @@ -558,6 +558,7 @@ else if test -n "$BACKPORT_INCLUDES"; then OFED_BACKPORT_PATH="$O2IBPATH/${BACKPORT_INCLUDES/*\/kernel_addons/kernel_addons}/" EXTRA_LNET_INCLUDE="-I$OFED_BACKPORT_PATH $EXTRA_LNET_INCLUDE" + AC_DEFINE(HAVE_OFED_BACKPORT_H, 1, [found OFED backport headers]) AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index a2cfd57..dfc8ade 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -494,6 +494,13 @@ AC_SUBST(MXLND) ]) +# check if kenrel has scsi/fc_compat.h +AC_DEFUN([LN_HAVE_SCSI_FC_COMPAT_H], +[LB_CHECK_FILE([$LINUX/include/scsi/fc_compat.h], [ + AC_DEFINE(HAVE_SCSI_FC_COMPAT_H, 1, + [kernel has include/scsi/fc_compat.h]) +]) +]) # # LN_CONFIG_O2IB @@ -560,6 +567,9 @@ else #if !HAVE_GFP_T typedef int gfp_t; #endif + #if !defined(HAVE_OFED_BACKPORT_H) && defined(HAVE_SCSI_FC_COMPAT_H) + #include + #endif #include #include #include @@ -1548,6 +1558,7 @@ LB_LINUX_TRY_COMPILE([ # AC_DEFUN([LN_PROG_LINUX], [ +LN_HAVE_SCSI_FC_COMPAT_H LN_FUNC_CPU_ONLINE LN_TYPE_GFP_T LN_TYPE_CPUMASK_T diff --git a/lnet/klnds/o2iblnd/o2iblnd.h b/lnet/klnds/o2iblnd/o2iblnd.h index d722baf..2697fde 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.h +++ b/lnet/klnds/o2iblnd/o2iblnd.h @@ -87,6 +87,9 @@ typedef int gfp_t; #endif +#if !defined(HAVE_OFED_BACKPORT_H) && defined(HAVE_SCSI_FC_COMPAT_H) +#include +#endif #include #include #include -- 1.8.3.1