From cae078e44699bb2e3422894e7328fdf880816988 Mon Sep 17 00:00:00 2001 From: vlnb Date: Tue, 5 May 2009 18:58:06 +0000 Subject: [PATCH] Unfortunately the latest InfiniBand software is not included in Linux distributions but must be installed separately via the OFED package. The patch below makes it easier to compile SCST-SRPT with the OFED kernel headers by disabling the backported macro's when compiling with OFED kernel headers. OFED namely has its own set of backported macro's. OFED kernel headers are detected via the preprocessor symbol __BACKPORT_LINUX_SCATTERLIST_H_TO_2_6_23__, which is defined in the OFED header file only. This patch does not have any effect when compiling SCST on a system where OFED has not been installed. Signed-off-by: Bart Van Assche git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@824 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/scst.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scst/include/scst.h b/scst/include/scst.h index f6af5fe..16424e6 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -2657,6 +2657,17 @@ void scst_aen_done(struct scst_aen *aen); #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) +/* + * The macro's sg_page(), sg_virt(), sg_init_table(), sg_assign_page() and + * sg_set_page() have been introduced in the 2.6.24 kernel. The definitions + * below are backports of the 2.6.24 macro's for older kernels. There is one + * exception however: when compiling SCST on a system with a pre-2.6.24 kernel + * (e.g. RHEL 5.x) where the OFED kernel headers have been installed, do not + * define the backported macro's because OFED has already defined these. + */ + +#ifndef __BACKPORT_LINUX_SCATTERLIST_H_TO_2_6_23__ + static inline struct page *sg_page(struct scatterlist *sg) { return sg->page; @@ -2685,6 +2696,8 @@ static inline void sg_set_page(struct scatterlist *sg, struct page *page, sg->length = len; } +#endif + #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) */ static inline void sg_clear(struct scatterlist *sg) -- 2.17.1