From: Avi Kivity <[email protected]>
Signed-off-by: Avi Kivity <[email protected]>
diff --git a/external-module-compat-comm.h b/external-module-compat-comm.h
index 8a2f902..3a31d51 100644
--- a/external-module-compat-comm.h
+++ b/external-module-compat-comm.h
@@ -951,3 +951,23 @@ static inline int kvm_eventfd_signal(struct eventfd_ctx
*ctx, int n)
#define kvm_eventfd_signal eventfd_signal
#endif
+
+#include <linux/hugetlb.h>
+
+/* vma_kernel_pagesize, 2.6.29 */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
+
+static inline
+unsigned long vma_kernel_pagesize(struct vm_area_struct *vma)
+{
+ struct hstate *hstate;
+
+ if (!is_vm_hugetlb_page(vma))
+ return PAGE_SIZE;
+
+ hstate = hstate_vma(vma);
+
+ return 1UL << (hstate->order + PAGE_SHIFT);
+}
+
+#endif
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html