From 26dbe2673ea74e7ebf63c5a746bfea6404df8868 Mon Sep 17 00:00:00 2001 From: Vladimir Sokolovsky Date: Mon, 29 Sep 2014 15:00:16 +0300 Subject: [PATCH] compat: Avoid kthread compilation on kernels that include kthread This is required to support RHEL6.6 Signed-off-by: Vladimir Sokolovsky --- compat/Makefile | 8 +++++--- include/linux/kthread.h | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/compat/Makefile b/compat/Makefile index c50562f..b9b0930 100644 --- a/compat/Makefile +++ b/compat/Makefile @@ -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 diff --git a/include/linux/kthread.h b/include/linux/kthread.h index b9c7efa..0c03279 100644 --- a/include/linux/kthread.h +++ b/include/linux/kthread.h @@ -15,7 +15,7 @@ #include_next -#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 */ -- 2.41.0