summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWendell Thompson <wthompson@digium.com>2009-03-06 21:43:34 +0000
committerWendell Thompson <wthompson@digium.com>2009-03-06 21:43:34 +0000
commitaf35b946d5d6b1f33223aa2494cc7f44f649c112 (patch)
tree176f35dd9607aef96de81ddf6bfe6adc0047c50c
parent842e606515435731ce441233978b5589ba526c93 (diff)
Workarounds for SLUB sysfs problems in kernel 2.6.22 with CONFIG_SLUB and CONFIG_SLUB_DEBUG, as in Fedora Core 6.
Fixes kernel oops when loading/unloading dahdi modules. DAHDI-226 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6096 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/voicebus.c4
-rw-r--r--drivers/dahdi/wctc4xxp/base.c10
-rw-r--r--drivers/dahdi/xpp/xpp_usb.c4
3 files changed, 15 insertions, 3 deletions
diff --git a/drivers/dahdi/voicebus.c b/drivers/dahdi/voicebus.c
index 85ba799..6e8187b 100644
--- a/drivers/dahdi/voicebus.c
+++ b/drivers/dahdi/voicebus.c
@@ -1385,7 +1385,11 @@ voicebus_init(struct pci_dev *pdev, u32 framesize,
* this driver. */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
vb->buffer_cache = kmem_cache_create(board_name, vb->framesize, 0,
+#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,22)
+ SLAB_HWCACHE_ALIGN | SLAB_STORE_USER, NULL, NULL);
+#else
SLAB_HWCACHE_ALIGN, NULL, NULL);
+#endif
#else
vb->buffer_cache = kmem_cache_create(board_name, vb->framesize, 0,
SLAB_HWCACHE_ALIGN, NULL);
diff --git a/drivers/dahdi/wctc4xxp/base.c b/drivers/dahdi/wctc4xxp/base.c
index 757d09d..5fcdabe 100644
--- a/drivers/dahdi/wctc4xxp/base.c
+++ b/drivers/dahdi/wctc4xxp/base.c
@@ -3375,13 +3375,17 @@ static struct pci_driver wctc4xxp_driver = {
static int __init wctc4xxp_init(void)
{
int res;
-# if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
cmd_cache = kmem_cache_create(THIS_MODULE->name, sizeof(struct tcb), 0,
+#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,22)
+ SLAB_HWCACHE_ALIGN | SLAB_STORE_USER, NULL, NULL);
+#else
SLAB_HWCACHE_ALIGN, NULL, NULL);
-# else
+#endif
+#else
cmd_cache = kmem_cache_create(THIS_MODULE->name, sizeof(struct tcb), 0,
SLAB_HWCACHE_ALIGN, NULL);
-# endif
+#endif
if (!cmd_cache) {
return -ENOMEM;
diff --git a/drivers/dahdi/xpp/xpp_usb.c b/drivers/dahdi/xpp/xpp_usb.c
index 2edec52..ff17e73 100644
--- a/drivers/dahdi/xpp/xpp_usb.c
+++ b/drivers/dahdi/xpp/xpp_usb.c
@@ -975,7 +975,11 @@ static int __init xpp_usb_init(void)
INFO("revision %s\n", XPP_VERSION);
xusb_cache = kmem_cache_create("xusb_cache",
sizeof(xframe_t) + XFRAME_DATASIZE,
+#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,22)
+ 0, SLAB_STORE_USER,
+#else
0, 0,
+#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
NULL,
#endif