Skip to content
Snippets Groups Projects
Commit 20c2df83 authored by Paul Mundt's avatar Paul Mundt
Browse files

mm: Remove slab destructors from kmem_cache_create().


Slab destructors were no longer supported after Christoph's
c59def9f change. They've been
BUGs for both slab and slub, and slob never supported them
either.

This rips out support for the dtor pointer from kmem_cache_create()
completely and fixes up every single callsite in the kernel (there were
about 224, not including the slab allocator definitions themselves,
or the documentation references).

Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 64fb98fc
No related merge requests found
Showing
with 23 additions and 28 deletions
...@@ -1333,7 +1333,7 @@ int __init s3c24xx_dma_init(unsigned int channels, unsigned int irq, ...@@ -1333,7 +1333,7 @@ int __init s3c24xx_dma_init(unsigned int channels, unsigned int irq,
dma_kmem = kmem_cache_create("dma_desc", dma_kmem = kmem_cache_create("dma_desc",
sizeof(struct s3c2410_dma_buf), 0, sizeof(struct s3c2410_dma_buf), 0,
SLAB_HWCACHE_ALIGN, SLAB_HWCACHE_ALIGN,
s3c2410_dma_cache_ctor, NULL); s3c2410_dma_cache_ctor);
if (dma_kmem == NULL) { if (dma_kmem == NULL) {
printk(KERN_ERR "dma failed to make kmem cache\n"); printk(KERN_ERR "dma failed to make kmem cache\n");
......
...@@ -176,9 +176,9 @@ void __init pgtable_cache_init(void) ...@@ -176,9 +176,9 @@ void __init pgtable_cache_init(void)
{ {
pte_cache = kmem_cache_create("pte-cache", pte_cache = kmem_cache_create("pte-cache",
sizeof(pte_t) * PTRS_PER_PTE, sizeof(pte_t) * PTRS_PER_PTE,
0, SLAB_PANIC, pte_cache_ctor, NULL); 0, SLAB_PANIC, pte_cache_ctor);
pgd_cache = kmem_cache_create("pgd-cache", MEMC_TABLE_SIZE + pgd_cache = kmem_cache_create("pgd-cache", MEMC_TABLE_SIZE +
sizeof(pgd_t) * PTRS_PER_PGD, sizeof(pgd_t) * PTRS_PER_PGD,
0, SLAB_PANIC, pgd_cache_ctor, NULL); 0, SLAB_PANIC, pgd_cache_ctor);
} }
...@@ -752,8 +752,7 @@ void __init pgtable_cache_init(void) ...@@ -752,8 +752,7 @@ void __init pgtable_cache_init(void)
PTRS_PER_PMD*sizeof(pmd_t), PTRS_PER_PMD*sizeof(pmd_t),
PTRS_PER_PMD*sizeof(pmd_t), PTRS_PER_PMD*sizeof(pmd_t),
SLAB_PANIC, SLAB_PANIC,
pmd_ctor, pmd_ctor);
NULL);
if (!SHARED_KERNEL_PMD) { if (!SHARED_KERNEL_PMD) {
/* If we're in PAE mode and have a non-shared /* If we're in PAE mode and have a non-shared
kernel pmd, then the pgd size must be a kernel pmd, then the pgd size must be a
......
...@@ -253,7 +253,7 @@ ia32_init (void) ...@@ -253,7 +253,7 @@ ia32_init (void)
partial_page_cachep = kmem_cache_create("partial_page_cache", partial_page_cachep = kmem_cache_create("partial_page_cache",
sizeof(struct partial_page), sizeof(struct partial_page),
0, SLAB_PANIC, NULL, NULL); 0, SLAB_PANIC, NULL);
} }
#endif #endif
return 0; return 0;
......
...@@ -804,7 +804,7 @@ int __init rtas_flash_init(void) ...@@ -804,7 +804,7 @@ int __init rtas_flash_init(void)
flash_block_cache = kmem_cache_create("rtas_flash_cache", flash_block_cache = kmem_cache_create("rtas_flash_cache",
RTAS_BLK_SIZE, RTAS_BLK_SIZE, 0, RTAS_BLK_SIZE, RTAS_BLK_SIZE, 0,
rtas_block_ctor, NULL); rtas_block_ctor);
if (!flash_block_cache) { if (!flash_block_cache) {
printk(KERN_ERR "%s: failed to create block cache\n", printk(KERN_ERR "%s: failed to create block cache\n",
__FUNCTION__); __FUNCTION__);
......
...@@ -542,7 +542,7 @@ static int __init hugetlbpage_init(void) ...@@ -542,7 +542,7 @@ static int __init hugetlbpage_init(void)
HUGEPTE_TABLE_SIZE, HUGEPTE_TABLE_SIZE,
HUGEPTE_TABLE_SIZE, HUGEPTE_TABLE_SIZE,
0, 0,
zero_ctor, NULL); zero_ctor);
if (! huge_pgtable_cache) if (! huge_pgtable_cache)
panic("hugetlbpage_init(): could not create hugepte cache\n"); panic("hugetlbpage_init(): could not create hugepte cache\n");
......
...@@ -178,7 +178,6 @@ void pgtable_cache_init(void) ...@@ -178,7 +178,6 @@ void pgtable_cache_init(void)
pgtable_cache[i] = kmem_cache_create(name, pgtable_cache[i] = kmem_cache_create(name,
size, size, size, size,
SLAB_PANIC, SLAB_PANIC,
zero_ctor, zero_ctor);
NULL);
} }
} }
...@@ -654,7 +654,7 @@ static int __init spufs_init(void) ...@@ -654,7 +654,7 @@ static int __init spufs_init(void)
ret = -ENOMEM; ret = -ENOMEM;
spufs_inode_cache = kmem_cache_create("spufs_inode_cache", spufs_inode_cache = kmem_cache_create("spufs_inode_cache",
sizeof(struct spufs_inode_info), 0, sizeof(struct spufs_inode_info), 0,
SLAB_HWCACHE_ALIGN, spufs_init_once, NULL); SLAB_HWCACHE_ALIGN, spufs_init_once);
if (!spufs_inode_cache) if (!spufs_inode_cache)
goto out; goto out;
......
...@@ -371,8 +371,7 @@ static int __init sq_api_init(void) ...@@ -371,8 +371,7 @@ static int __init sq_api_init(void)
printk(KERN_NOTICE "sq: Registering store queue API.\n"); printk(KERN_NOTICE "sq: Registering store queue API.\n");
sq_cache = kmem_cache_create("store_queue_cache", sq_cache = kmem_cache_create("store_queue_cache",
sizeof(struct sq_mapping), 0, 0, sizeof(struct sq_mapping), 0, 0, NULL);
NULL, NULL);
if (unlikely(!sq_cache)) if (unlikely(!sq_cache))
return ret; return ret;
......
...@@ -310,7 +310,7 @@ static int __init pmb_init(void) ...@@ -310,7 +310,7 @@ static int __init pmb_init(void)
BUG_ON(unlikely(nr_entries >= NR_PMB_ENTRIES)); BUG_ON(unlikely(nr_entries >= NR_PMB_ENTRIES));
pmb_cache = kmem_cache_create("pmb", sizeof(struct pmb_entry), 0, pmb_cache = kmem_cache_create("pmb", sizeof(struct pmb_entry), 0,
SLAB_PANIC, pmb_cache_ctor, NULL); SLAB_PANIC, pmb_cache_ctor);
jump_to_P2(); jump_to_P2();
......
...@@ -262,8 +262,7 @@ void __init pgtable_cache_init(void) ...@@ -262,8 +262,7 @@ void __init pgtable_cache_init(void)
tsb_caches[i] = kmem_cache_create(name, tsb_caches[i] = kmem_cache_create(name,
size, size, size, size,
0, 0, NULL);
NULL, NULL);
if (!tsb_caches[i]) { if (!tsb_caches[i]) {
prom_printf("Could not create %s cache\n", name); prom_printf("Could not create %s cache\n", name);
prom_halt(); prom_halt();
......
...@@ -1043,7 +1043,7 @@ static int __init bsg_init(void) ...@@ -1043,7 +1043,7 @@ static int __init bsg_init(void)
dev_t devid; dev_t devid;
bsg_cmd_cachep = kmem_cache_create("bsg_cmd", bsg_cmd_cachep = kmem_cache_create("bsg_cmd",
sizeof(struct bsg_command), 0, 0, NULL, NULL); sizeof(struct bsg_command), 0, 0, NULL);
if (!bsg_cmd_cachep) { if (!bsg_cmd_cachep) {
printk(KERN_ERR "bsg: failed creating slab cache\n"); printk(KERN_ERR "bsg: failed creating slab cache\n");
return -ENOMEM; return -ENOMEM;
......
...@@ -3698,13 +3698,13 @@ int __init blk_dev_init(void) ...@@ -3698,13 +3698,13 @@ int __init blk_dev_init(void)
panic("Failed to create kblockd\n"); panic("Failed to create kblockd\n");
request_cachep = kmem_cache_create("blkdev_requests", request_cachep = kmem_cache_create("blkdev_requests",
sizeof(struct request), 0, SLAB_PANIC, NULL, NULL); sizeof(struct request), 0, SLAB_PANIC, NULL);
requestq_cachep = kmem_cache_create("blkdev_queue", requestq_cachep = kmem_cache_create("blkdev_queue",
sizeof(request_queue_t), 0, SLAB_PANIC, NULL, NULL); sizeof(request_queue_t), 0, SLAB_PANIC, NULL);
iocontext_cachep = kmem_cache_create("blkdev_ioc", iocontext_cachep = kmem_cache_create("blkdev_ioc",
sizeof(struct io_context), 0, SLAB_PANIC, NULL, NULL); sizeof(struct io_context), 0, SLAB_PANIC, NULL);
for_each_possible_cpu(i) for_each_possible_cpu(i)
INIT_LIST_HEAD(&per_cpu(blk_cpu_done, i)); INIT_LIST_HEAD(&per_cpu(blk_cpu_done, i));
......
...@@ -1098,7 +1098,7 @@ void acpi_os_release_lock(acpi_spinlock lockp, acpi_cpu_flags flags) ...@@ -1098,7 +1098,7 @@ void acpi_os_release_lock(acpi_spinlock lockp, acpi_cpu_flags flags)
acpi_status acpi_status
acpi_os_create_cache(char *name, u16 size, u16 depth, acpi_cache_t ** cache) acpi_os_create_cache(char *name, u16 size, u16 depth, acpi_cache_t ** cache)
{ {
*cache = kmem_cache_create(name, size, 0, 0, NULL, NULL); *cache = kmem_cache_create(name, size, 0, 0, NULL);
if (*cache == NULL) if (*cache == NULL)
return AE_ERROR; return AE_ERROR;
else else
......
...@@ -257,9 +257,9 @@ aoeblk_exit(void) ...@@ -257,9 +257,9 @@ aoeblk_exit(void)
int __init int __init
aoeblk_init(void) aoeblk_init(void)
{ {
buf_pool_cache = kmem_cache_create("aoe_bufs", buf_pool_cache = kmem_cache_create("aoe_bufs",
sizeof(struct buf), sizeof(struct buf),
0, 0, NULL, NULL); 0, 0, NULL);
if (buf_pool_cache == NULL) if (buf_pool_cache == NULL)
return -ENOMEM; return -ENOMEM;
......
...@@ -1729,7 +1729,7 @@ static int __init ether1394_init_module(void) ...@@ -1729,7 +1729,7 @@ static int __init ether1394_init_module(void)
packet_task_cache = kmem_cache_create("packet_task", packet_task_cache = kmem_cache_create("packet_task",
sizeof(struct packet_task), sizeof(struct packet_task),
0, 0, NULL, NULL); 0, 0, NULL);
if (!packet_task_cache) if (!packet_task_cache)
return -ENOMEM; return -ENOMEM;
......
...@@ -2998,7 +2998,6 @@ static int __init ib_mad_init_module(void) ...@@ -2998,7 +2998,6 @@ static int __init ib_mad_init_module(void)
sizeof(struct ib_mad_private), sizeof(struct ib_mad_private),
0, 0,
SLAB_HWCACHE_ALIGN, SLAB_HWCACHE_ALIGN,
NULL,
NULL); NULL);
if (!ib_mad_cache) { if (!ib_mad_cache) {
printk(KERN_ERR PFX "Couldn't create ib_mad cache\n"); printk(KERN_ERR PFX "Couldn't create ib_mad cache\n");
......
...@@ -85,7 +85,7 @@ int vq_init(struct c2_dev *c2dev) ...@@ -85,7 +85,7 @@ int vq_init(struct c2_dev *c2dev)
(char) ('0' + c2dev->devnum)); (char) ('0' + c2dev->devnum));
c2dev->host_msg_cache = c2dev->host_msg_cache =
kmem_cache_create(c2dev->vq_cache_name, c2dev->rep_vq.msg_size, 0, kmem_cache_create(c2dev->vq_cache_name, c2dev->rep_vq.msg_size, 0,
SLAB_HWCACHE_ALIGN, NULL, NULL); SLAB_HWCACHE_ALIGN, NULL);
if (c2dev->host_msg_cache == NULL) { if (c2dev->host_msg_cache == NULL) {
return -ENOMEM; return -ENOMEM;
} }
......
...@@ -259,7 +259,7 @@ int ehca_init_av_cache(void) ...@@ -259,7 +259,7 @@ int ehca_init_av_cache(void)
av_cache = kmem_cache_create("ehca_cache_av", av_cache = kmem_cache_create("ehca_cache_av",
sizeof(struct ehca_av), 0, sizeof(struct ehca_av), 0,
SLAB_HWCACHE_ALIGN, SLAB_HWCACHE_ALIGN,
NULL, NULL); NULL);
if (!av_cache) if (!av_cache)
return -ENOMEM; return -ENOMEM;
return 0; return 0;
......
...@@ -387,7 +387,7 @@ int ehca_init_cq_cache(void) ...@@ -387,7 +387,7 @@ int ehca_init_cq_cache(void)
cq_cache = kmem_cache_create("ehca_cache_cq", cq_cache = kmem_cache_create("ehca_cache_cq",
sizeof(struct ehca_cq), 0, sizeof(struct ehca_cq), 0,
SLAB_HWCACHE_ALIGN, SLAB_HWCACHE_ALIGN,
NULL, NULL); NULL);
if (!cq_cache) if (!cq_cache)
return -ENOMEM; return -ENOMEM;
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment