diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/plat-s3c24xx/dma.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/rtas_flash.c | 2 | ||||
-rw-r--r-- | arch/powerpc/mm/hugetlbpage.c | 9 | ||||
-rw-r--r-- | arch/powerpc/mm/init_64.c | 24 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/inode.c | 2 | ||||
-rw-r--r-- | arch/sh/mm/pmb.c | 2 | ||||
-rw-r--r-- | arch/xtensa/mm/init.c | 2 |
7 files changed, 16 insertions, 27 deletions
diff --git a/arch/arm/plat-s3c24xx/dma.c b/arch/arm/plat-s3c24xx/dma.c index 60f162dc4fad..8c5e656d5d8c 100644 --- a/arch/arm/plat-s3c24xx/dma.c +++ b/arch/arm/plat-s3c24xx/dma.c | |||
@@ -1304,7 +1304,7 @@ struct sysdev_class dma_sysclass = { | |||
1304 | 1304 | ||
1305 | /* kmem cache implementation */ | 1305 | /* kmem cache implementation */ |
1306 | 1306 | ||
1307 | static void s3c2410_dma_cache_ctor(struct kmem_cache *c, void *p) | 1307 | static void s3c2410_dma_cache_ctor(void *p) |
1308 | { | 1308 | { |
1309 | memset(p, 0, sizeof(struct s3c2410_dma_buf)); | 1309 | memset(p, 0, sizeof(struct s3c2410_dma_buf)); |
1310 | } | 1310 | } |
diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c index 09ded5c424a9..149cb112cd1a 100644 --- a/arch/powerpc/kernel/rtas_flash.c +++ b/arch/powerpc/kernel/rtas_flash.c | |||
@@ -286,7 +286,7 @@ static ssize_t rtas_flash_read(struct file *file, char __user *buf, | |||
286 | } | 286 | } |
287 | 287 | ||
288 | /* constructor for flash_block_cache */ | 288 | /* constructor for flash_block_cache */ |
289 | void rtas_block_ctor(struct kmem_cache *cache, void *ptr) | 289 | void rtas_block_ctor(void *ptr) |
290 | { | 290 | { |
291 | memset(ptr, 0, RTAS_BLK_SIZE); | 291 | memset(ptr, 0, RTAS_BLK_SIZE); |
292 | } | 292 | } |
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c index fb42c4dd3217..ed0aab0208a6 100644 --- a/arch/powerpc/mm/hugetlbpage.c +++ b/arch/powerpc/mm/hugetlbpage.c | |||
@@ -113,7 +113,7 @@ static inline pte_t *hugepte_offset(hugepd_t *hpdp, unsigned long addr, | |||
113 | static int __hugepte_alloc(struct mm_struct *mm, hugepd_t *hpdp, | 113 | static int __hugepte_alloc(struct mm_struct *mm, hugepd_t *hpdp, |
114 | unsigned long address, unsigned int psize) | 114 | unsigned long address, unsigned int psize) |
115 | { | 115 | { |
116 | pte_t *new = kmem_cache_alloc(huge_pgtable_cache(psize), | 116 | pte_t *new = kmem_cache_zalloc(huge_pgtable_cache(psize), |
117 | GFP_KERNEL|__GFP_REPEAT); | 117 | GFP_KERNEL|__GFP_REPEAT); |
118 | 118 | ||
119 | if (! new) | 119 | if (! new) |
@@ -730,11 +730,6 @@ static int __init hugepage_setup_sz(char *str) | |||
730 | } | 730 | } |
731 | __setup("hugepagesz=", hugepage_setup_sz); | 731 | __setup("hugepagesz=", hugepage_setup_sz); |
732 | 732 | ||
733 | static void zero_ctor(struct kmem_cache *cache, void *addr) | ||
734 | { | ||
735 | memset(addr, 0, kmem_cache_size(cache)); | ||
736 | } | ||
737 | |||
738 | static int __init hugetlbpage_init(void) | 733 | static int __init hugetlbpage_init(void) |
739 | { | 734 | { |
740 | unsigned int psize; | 735 | unsigned int psize; |
@@ -756,7 +751,7 @@ static int __init hugetlbpage_init(void) | |||
756 | HUGEPTE_TABLE_SIZE(psize), | 751 | HUGEPTE_TABLE_SIZE(psize), |
757 | HUGEPTE_TABLE_SIZE(psize), | 752 | HUGEPTE_TABLE_SIZE(psize), |
758 | 0, | 753 | 0, |
759 | zero_ctor); | 754 | NULL); |
760 | if (!huge_pgtable_cache(psize)) | 755 | if (!huge_pgtable_cache(psize)) |
761 | panic("hugetlbpage_init(): could not create %s"\ | 756 | panic("hugetlbpage_init(): could not create %s"\ |
762 | "\n", HUGEPTE_CACHE_NAME(psize)); | 757 | "\n", HUGEPTE_CACHE_NAME(psize)); |
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c index a41bc5aa2043..4f7df85129d8 100644 --- a/arch/powerpc/mm/init_64.c +++ b/arch/powerpc/mm/init_64.c | |||
@@ -136,9 +136,14 @@ static int __init setup_kcore(void) | |||
136 | module_init(setup_kcore); | 136 | module_init(setup_kcore); |
137 | #endif | 137 | #endif |
138 | 138 | ||
139 | static void zero_ctor(struct kmem_cache *cache, void *addr) | 139 | static void pgd_ctor(void *addr) |
140 | { | 140 | { |
141 | memset(addr, 0, kmem_cache_size(cache)); | 141 | memset(addr, 0, PGD_TABLE_SIZE); |
142 | } | ||
143 | |||
144 | static void pmd_ctor(void *addr) | ||
145 | { | ||
146 | memset(addr, 0, PMD_TABLE_SIZE); | ||
142 | } | 147 | } |
143 | 148 | ||
144 | static const unsigned int pgtable_cache_size[2] = { | 149 | static const unsigned int pgtable_cache_size[2] = { |
@@ -163,19 +168,8 @@ struct kmem_cache *pgtable_cache[ARRAY_SIZE(pgtable_cache_size)]; | |||
163 | 168 | ||
164 | void pgtable_cache_init(void) | 169 | void pgtable_cache_init(void) |
165 | { | 170 | { |
166 | int i; | 171 | pgtable_cache[0] = kmem_cache_create(pgtable_cache_name[0], PGD_TABLE_SIZE, PGD_TABLE_SIZE, SLAB_PANIC, pgd_ctor); |
167 | 172 | pgtable_cache[1] = kmem_cache_create(pgtable_cache_name[1], PMD_TABLE_SIZE, PMD_TABLE_SIZE, SLAB_PANIC, pmd_ctor); | |
168 | for (i = 0; i < ARRAY_SIZE(pgtable_cache_size); i++) { | ||
169 | int size = pgtable_cache_size[i]; | ||
170 | const char *name = pgtable_cache_name[i]; | ||
171 | |||
172 | pr_debug("Allocating page table cache %s (#%d) " | ||
173 | "for size: %08x...\n", name, i, size); | ||
174 | pgtable_cache[i] = kmem_cache_create(name, | ||
175 | size, size, | ||
176 | SLAB_PANIC, | ||
177 | zero_ctor); | ||
178 | } | ||
179 | } | 173 | } |
180 | 174 | ||
181 | #ifdef CONFIG_SPARSEMEM_VMEMMAP | 175 | #ifdef CONFIG_SPARSEMEM_VMEMMAP |
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index 7123472801d9..690ca7b0dcf6 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c | |||
@@ -78,7 +78,7 @@ spufs_destroy_inode(struct inode *inode) | |||
78 | } | 78 | } |
79 | 79 | ||
80 | static void | 80 | static void |
81 | spufs_init_once(struct kmem_cache *cachep, void *p) | 81 | spufs_init_once(void *p) |
82 | { | 82 | { |
83 | struct spufs_inode_info *ei = p; | 83 | struct spufs_inode_info *ei = p; |
84 | 84 | ||
diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c index 0b0ec6e04753..46911bcbf17b 100644 --- a/arch/sh/mm/pmb.c +++ b/arch/sh/mm/pmb.c | |||
@@ -293,7 +293,7 @@ void pmb_unmap(unsigned long addr) | |||
293 | } while (pmbe); | 293 | } while (pmbe); |
294 | } | 294 | } |
295 | 295 | ||
296 | static void pmb_cache_ctor(struct kmem_cache *cachep, void *pmb) | 296 | static void pmb_cache_ctor(void *pmb) |
297 | { | 297 | { |
298 | struct pmb_entry *pmbe = pmb; | 298 | struct pmb_entry *pmbe = pmb; |
299 | 299 | ||
diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c index 81d0560eaea2..ee261005b363 100644 --- a/arch/xtensa/mm/init.c +++ b/arch/xtensa/mm/init.c | |||
@@ -309,7 +309,7 @@ void show_mem(void) | |||
309 | 309 | ||
310 | struct kmem_cache *pgtable_cache __read_mostly; | 310 | struct kmem_cache *pgtable_cache __read_mostly; |
311 | 311 | ||
312 | static void pgd_ctor(struct kmem_cache *cache, void* addr) | 312 | static void pgd_ctor(void* addr) |
313 | { | 313 | { |
314 | pte_t* ptep = (pte_t*)addr; | 314 | pte_t* ptep = (pte_t*)addr; |
315 | int i; | 315 | int i; |