Skip to content

Commit fcc234f

Browse files
Pekka EnbergLinus Torvalds
authored andcommitted
[PATCH] mm: kill kmem_cache_t usage
We have struct kmem_cache now so use it instead of the old typedef. Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent b5d8ca7 commit fcc234f

4 files changed

Lines changed: 10 additions & 8 deletions

File tree

‎mm/mempolicy.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@
9898
/* The number of pages to migrate per call to migrate_pages() */
9999
#define MIGRATE_CHUNK_SIZE 256
100100

101-
static kmem_cache_t *policy_cache;
102-
static kmem_cache_t *sn_cache;
101+
static struct kmem_cache *policy_cache;
102+
static struct kmem_cache *sn_cache;
103103

104104
#define PDprintk(fmt...)
105105

‎mm/mempool.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,14 +278,14 @@ EXPORT_SYMBOL(mempool_free);
278278
*/
279279
void *mempool_alloc_slab(gfp_t gfp_mask, void *pool_data)
280280
{
281-
kmem_cache_t *mem = (kmem_cache_t *) pool_data;
281+
struct kmem_cache *mem = pool_data;
282282
return kmem_cache_alloc(mem, gfp_mask);
283283
}
284284
EXPORT_SYMBOL(mempool_alloc_slab);
285285

286286
void mempool_free_slab(void *element, void *pool_data)
287287
{
288-
kmem_cache_t *mem = (kmem_cache_t *) pool_data;
288+
struct kmem_cache *mem = pool_data;
289289
kmem_cache_free(mem, element);
290290
}
291291
EXPORT_SYMBOL(mempool_free_slab);

‎mm/rmap.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858

5959
//#define RMAP_DEBUG /* can be enabled only for debugging */
6060

61-
kmem_cache_t *anon_vma_cachep;
61+
struct kmem_cache *anon_vma_cachep;
6262

6363
static inline void validate_anon_vma(struct vm_area_struct *find_vma)
6464
{
@@ -166,7 +166,8 @@ void anon_vma_unlink(struct vm_area_struct *vma)
166166
anon_vma_free(anon_vma);
167167
}
168168

169-
static void anon_vma_ctor(void *data, kmem_cache_t *cachep, unsigned long flags)
169+
static void anon_vma_ctor(void *data, struct kmem_cache *cachep,
170+
unsigned long flags)
170171
{
171172
if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
172173
SLAB_CTOR_CONSTRUCTOR) {

‎mm/shmem.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2119,7 +2119,7 @@ static int shmem_fill_super(struct super_block *sb,
21192119
return err;
21202120
}
21212121

2122-
static kmem_cache_t *shmem_inode_cachep;
2122+
static struct kmem_cache *shmem_inode_cachep;
21232123

21242124
static struct inode *shmem_alloc_inode(struct super_block *sb)
21252125
{
@@ -2139,7 +2139,8 @@ static void shmem_destroy_inode(struct inode *inode)
21392139
kmem_cache_free(shmem_inode_cachep, SHMEM_I(inode));
21402140
}
21412141

2142-
static void init_once(void *foo, kmem_cache_t *cachep, unsigned long flags)
2142+
static void init_once(void *foo, struct kmem_cache *cachep,
2143+
unsigned long flags)
21432144
{
21442145
struct shmem_inode_info *p = (struct shmem_inode_info *) foo;
21452146

0 commit comments

Comments
 (0)