[PATCH 3/3] compat code fixes for RHEL5 kernels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Andrea Arcangeli <aarcange@xxxxxxxxxx>

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@xxxxxxxxxx>
Signed-off-by: Eduardo Habkost <ehabkost@xxxxxxxxxx>
---
 kernel/external-module-compat-comm.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

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>
 
-- 
1.6.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux