diff mbox

[3/9] kvm_vma_kernel_pagesize support

Message ID 20090925161801.3328.96058.stgit@mchn012c.ww002.siemens.net (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Kiszka Sept. 25, 2009, 4:18 p.m. UTC
It was broken for !CONFIG_HUGETLB_PAGE and for kernel 2.6.31.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

 external-module-compat-comm.h |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)


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

Patch

diff --git a/external-module-compat-comm.h b/external-module-compat-comm.h
index c72fb86..47fdc86 100644
--- a/external-module-compat-comm.h
+++ b/external-module-compat-comm.h
@@ -954,9 +954,10 @@  static inline int kvm_eventfd_signal(struct eventfd_ctx *ctx, int n)
 
 #include <linux/hugetlb.h>
 
-/* vma_kernel_pagesize, 2.6.29 */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
+/* vma_kernel_pagesize, exported since 2.6.32 */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
 
+#ifdef CONFIG_HUGETLB_PAGE
 static inline
 unsigned long kvm_vma_kernel_pagesize(struct vm_area_struct *vma)
 {
@@ -969,8 +970,11 @@  unsigned long kvm_vma_kernel_pagesize(struct vm_area_struct *vma)
 
 	return 1UL << (hstate->order + PAGE_SHIFT);
 }
+#else /* !CONFIG_HUGETLB_SIZE */
+#define kvm_vma_kernel_pagesize(v) PAGE_SIZE
+#endif
 
-#else
+#else /* >= 2.6.32 */
 
 #define kvm_vma_kernel_pagesize vma_kernel_pagesize