diff mbox

[3/3] compat code fixes for RHEL5 kernels

Message ID 1232736095-26244-4-git-send-email-ehabkost@redhat.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Eduardo Habkost Jan. 23, 2009, 6:41 p.m. UTC
From: Andrea Arcangeli <aarcange@redhat.com>

Compat code for some RHEL5 kernel versions.

This patch also applies to the maint/2.6.29 branch.

[ehabkost: changed pagefault_* to check for RHEL < 5.2 instead of RHEL <= 5.2]
[ehabkost: changed __aligned to check for RHEL <= 5.2 && !defined(__aligned)]

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 kernel/external-module-compat-comm.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/kernel/external-module-compat-comm.h b/kernel/external-module-compat-comm.h
index 981dc96..7f4d591 100644
--- a/kernel/external-module-compat-comm.h
+++ b/kernel/external-module-compat-comm.h
@@ -250,6 +250,7 @@  static inline void blahblah(void)
 
 /* pagefault_enable(), page_fault_disable() - 2.6.20 */
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
+#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5,2)
 
 static inline void pagefault_disable(void)
 {
@@ -276,6 +277,9 @@  static inline void pagefault_enable(void)
 	preempt_check_resched();
 }
 
+#else
+#include <linux/uaccess.h>
+#endif
 #endif
 
 /* vm ops ->fault() was introduced in 2.6.23. */
@@ -405,8 +409,10 @@  static inline ktime_t ktime_get(void)
 
 /* __aligned arrived in 2.6.21 */
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)
+#if !defined(RHEL_RELEASE_CODE) || (RHEL_RELEASE_CODE <= RHEL_RELEASE_VERSION(5,2) && !defined(__aligned))
 #define __aligned(x) __attribute__((__aligned__(x)))
 #endif
+#endif
 
 #include <linux/mm.h>