aboutsummaryrefslogtreecommitdiff
path: root/kvm/kernel/external-module-compat.h
diff options
context:
space:
mode:
Diffstat (limited to 'kvm/kernel/external-module-compat.h')
-rw-r--r--kvm/kernel/external-module-compat.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/kvm/kernel/external-module-compat.h b/kvm/kernel/external-module-compat.h
index e164eec75..98ed13f26 100644
--- a/kvm/kernel/external-module-compat.h
+++ b/kvm/kernel/external-module-compat.h
@@ -534,6 +534,20 @@ static inline void blahblah(void)
(void)empty_zero_page[0];
}
+/* __mmdrop() is not exported before 2.6.25 */
+#include <linux/sched.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
+
+#define mmdrop(x) do { (void)(x); } while (0)
+#define mmget(x) do { (void)(x); } while (0)
+
+#else
+
+#define mmget(x) do { atomic_inc(x); } while (0)
+
+#endif
+
/* X86_FEATURE_NX is missing in some x86_64 kernels */
#include <asm/cpufeature.h>