From b06b15ce7785fb59190a3d548079a73e5d1e269c Mon Sep 17 00:00:00 2001 From: Vladimir Sokolovsky Date: Wed, 16 Nov 2016 18:25:16 +0200 Subject: [PATCH] compat: Added macros and header fixes to support RHEL7.3 Signed-off-by: Vladimir Sokolovsky --- config/rdma.m4 | 44 +++++++++++++++++++++++++++++++++++++ include/linux/compat-3.11.h | 1 + include/linux/compat-4.0.h | 3 +++ 3 files changed, 48 insertions(+) diff --git a/config/rdma.m4 b/config/rdma.m4 index cc10449..cb97890 100644 --- a/config/rdma.m4 +++ b/config/rdma.m4 @@ -3415,6 +3415,7 @@ AC_DEFUN([LINUX_CONFIG_COMPAT], AC_MSG_CHECKING([if nelems is atomic_t in struct rhashtable]) LB_LINUX_TRY_COMPILE([ #include + #include #include ],[ struct rhashtable *ht; @@ -3452,6 +3453,49 @@ AC_DEFUN([LINUX_CONFIG_COMPAT], AC_MSG_RESULT(no) ]) + AC_MSG_CHECKING([if ethtool.h enum ethtool_link_mode_bit_indices has ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT]) + LB_LINUX_TRY_COMPILE([ + #include + ],[ + enum ethtool_link_mode_bit_indices x = ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT; + + return 0; + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT, 1, + [ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT is defined]) + ],[ + AC_MSG_RESULT(no) + ]) + + AC_MSG_CHECKING([if include/net/flow_dissector.h exists]) + LB_LINUX_TRY_COMPILE([ + #include + ],[ + return 0; + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_NET_FLOW_DISSECTOR_H, 1, + [include/net/flow_dissector.h exists]) + ],[ + AC_MSG_RESULT(no) + ]) + + AC_MSG_CHECKING([if include/linux/dcache.h has d_inode]) + LB_LINUX_TRY_COMPILE([ + #include + ],[ + struct inode *inode = d_inode(NULL); + + return 0; + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_D_INODE, 1, + [d_inode is defined in dcache.h]) + ],[ + AC_MSG_RESULT(no) + ]) + ]) # # COMPAT_CONFIG_HEADERS diff --git a/include/linux/compat-3.11.h b/include/linux/compat-3.11.h index 981ac86..18e3247 100644 --- a/include/linux/compat-3.11.h +++ b/include/linux/compat-3.11.h @@ -4,6 +4,7 @@ #include #if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0)) +#include #ifndef AF_IB #define AF_IB 27 /* Native InfiniBand address */ diff --git a/include/linux/compat-4.0.h b/include/linux/compat-4.0.h index 9aae4ad..50e13a3 100644 --- a/include/linux/compat-4.0.h +++ b/include/linux/compat-4.0.h @@ -5,6 +5,7 @@ #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)) +#include "../../compat/config.h" #include /** @@ -14,10 +15,12 @@ * This is the helper normal filesystems should use to get at their own inodes * in their own dentries and ignore the layering superimposed upon them. */ +#ifndef HAVE_D_INODE static inline struct inode *d_inode(const struct dentry *dentry) { return dentry->d_inode; } +#endif #define debugfs_create_file_size LINUX_BACKPORT(debugfs_create_file_size) -- 2.41.0