Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > media > main-src > by-pkgid > aadbe78a25743146bb784eee19f007c5 > files > 44

kvm-83-164.el5_5.9.src.rpm

From a8dadce352754291d78a3fb23fea753b4b4f0cd4 Mon Sep 17 00:00:00 2001
From: Andrea Arcangeli <aarcange@redhat.com>
Date: Tue, 20 Jan 2009 22:26:09 +0100
Subject: [PATCH 43/54] kmem-cache

Add kmem-cache compat code for ksm.c.

Signed-off-by: Izik Eidus <ieidus@redhat.com>
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
RH-Upstream-status: pending
---
 kernel/external-module-compat-comm.h |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/kernel/external-module-compat-comm.h b/kernel/external-module-compat-comm.h
index 22b3613..0b50e1e 100644
--- a/kernel/external-module-compat-comm.h
+++ b/kernel/external-module-compat-comm.h
@@ -628,6 +628,20 @@ static inline int pci_reset_function(struct pci_dev *dev)
 
 #endif
 
+#ifndef KMEM_CACHE
+/*
+ * Please use this macro to create slab caches. Simply specify the
+ * name of the structure and maybe some flags that are listed above.
+ *
+ * The alignment of the struct determines object alignment. If you
+ * f.e. add ____cacheline_aligned_in_smp to the struct declaration
+ * then the objects will be properly aligned in SMP configurations.
+ */
+#define KMEM_CACHE(__struct, __flags) kmem_cache_create(#__struct,\
+		sizeof(struct __struct), __alignof__(struct __struct),\
+		(__flags), NULL)
+#endif
+
 #include <linux/interrupt.h>
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
 
-- 
1.6.1