diff options
author | Shaun Ruffell <sruffell@digium.com> | 2009-03-24 15:59:55 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2009-03-24 15:59:55 +0000 |
commit | 33443f6177621ad667dde7954b16e2dc3377ba0f (patch) | |
tree | 9a9a46ceb627034b594ece538c99af3efa1a74ea /drivers | |
parent | e0b2ba2d3d6419eaf0e9cc17db2bb41ef6fd8d65 (diff) |
Do not define the debug flags if CONFIG_SLUB is not set.
Some versions of the kernel (2.6.18-92.1.22.el5) have patches in them to panic
if a slab cache is created with unsupported flags.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6237 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dahdi/wctc4xxp/base.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/dahdi/wctc4xxp/base.c b/drivers/dahdi/wctc4xxp/base.c index 103d479..17d124f 100644 --- a/drivers/dahdi/wctc4xxp/base.c +++ b/drivers/dahdi/wctc4xxp/base.c @@ -3717,15 +3717,23 @@ static struct pci_driver wctc4xxp_driver = { static int __init wctc4xxp_init(void) { int res; + unsigned long cache_flags; + +#if defined(CONFIG_SLUB) && (LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 22)) + cache_flags = SLAB_HWCACHE_ALIGN | SLAB_STORE_USER | SLAB_DEBUG_FREE; +#else + cache_flags = SLAB_HWCACHE_ALIGN; +#endif + #ifdef USE_CUSTOM_MEMCACHE cmd_cache = my_cache_create(); #else # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23) cmd_cache = kmem_cache_create(THIS_MODULE->name, sizeof(struct tcb), - 0, SLAB_HWCACHE_ALIGN | SLAB_STORE_USER | SLAB_DEBUG_FREE, NULL, NULL); + 0, cache_flags, NULL, NULL); # else cmd_cache = kmem_cache_create(THIS_MODULE->name, sizeof(struct tcb), - 0, SLAB_HWCACHE_ALIGN, NULL); + 0, cache_flags, NULL); # endif #endif |