compat: Avoid kthread compilation on kernels that include kthread ofed_3_12_1 vofed-3.12-1-rc3
authorVladimir Sokolovsky <vlad@mellanox.com>
Mon, 29 Sep 2014 12:00:16 +0000 (15:00 +0300)
committerVladimir Sokolovsky <vlad@mellanox.com>
Mon, 29 Sep 2014 12:00:16 +0000 (15:00 +0300)
This is required to support RHEL6.6

Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
compat/Makefile
include/linux/kthread.h

index c50562f..b9b0930 100644 (file)
@@ -26,9 +26,11 @@ compat-$(CONFIG_COMPAT_KERNEL_2_6_32) += compat-2.6.32.o
 
 compat-$(CONFIG_COMPAT_KERNEL_2_6_33) += compat-2.6.33.o
 compat-$(CONFIG_COMPAT_KERNEL_2_6_34) += compat-2.6.34.o
-compat-$(CONFIG_COMPAT_KERNEL_2_6_35) += \
-       compat-2.6.35.o \
-       kthread.o
+compat-$(CONFIG_COMPAT_KERNEL_2_6_35) += compat-2.6.35.o
+
+ifeq ($(CONFIG_COMPAT_IS_KTHREAD),)
+compat-$(CONFIG_COMPAT_KERNEL_2_6_35) += kthread.o
+endif
 
 compat-$(CONFIG_COMPAT_KERNEL_2_6_36) += compat-2.6.36.o
 
index b9c7efa..0c03279 100644 (file)
@@ -15,7 +15,7 @@
 
 #include_next <linux/kthread.h>
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
+#ifndef CONFIG_COMPAT_IS_KTHREAD
 
 struct kthread_work;
 typedef void (*kthread_work_func_t)(struct kthread_work *work);
@@ -106,7 +106,7 @@ void flush_kthread_worker(struct kthread_worker *worker);
 #define kthread_create_on_node(threadfn, data, node, namefmt, arg...) \
        kthread_create(threadfn, data, namefmt, ##arg)
 
-#endif /* LINUX_VERSION_CODE < 2.6.38 */
+#endif /* CONFIG_COMPAT_IS_KTHREAD */
 
 #endif /* _LINUX_KTHREAD_H */