]> git.openfabrics.org - ~tnikolova/compat/.git/commitdiff
compat: Added macros and header fixes to support RHEL7.3
authorVladimir Sokolovsky <vlad@mellanox.com>
Wed, 16 Nov 2016 16:25:16 +0000 (18:25 +0200)
committerVladimir Sokolovsky <vlad@mellanox.com>
Wed, 16 Nov 2016 16:25:16 +0000 (18:25 +0200)
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
config/rdma.m4
include/linux/compat-3.11.h
include/linux/compat-4.0.h

index cc104499bceafa4308149990976f91a8ff31139f..cb9789027c4513d9f2e119408670bc089e74e651 100644 (file)
@@ -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 <linux/atomic.h>
+               #include <linux/poison.h>
                #include <linux/rhashtable.h>
        ],[
                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 <uapi/linux/ethtool.h>
+       ],[
+               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 <net/flow_dissector.h>
+       ],[
+               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 <linux/dcache.h>
+       ],[
+               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
index 981ac86d71457cff9c06e19977e8eda52c50aa02..18e324768a9558b5506fe89c4f075af0b44a9635 100644 (file)
@@ -4,6 +4,7 @@
 #include <linux/version.h>
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0))
+#include <linux/netdevice.h>
 
 #ifndef AF_IB
 #define AF_IB          27      /* Native InfiniBand address    */
index 9aae4adbc20487b8008ab1563d25050d3148c4d3..50e13a3a10d1ab24a59891584ca4a10ece19eb28 100644 (file)
@@ -5,6 +5,7 @@
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0))
 
+#include "../../compat/config.h"
 #include <linux/dcache.h>
 
 /**
  * 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)