Skip to content

Commit

Permalink
[PATCH] mm: kill kmem_cache_t usage
Browse files Browse the repository at this point in the history
We have struct kmem_cache now so use it instead of the old typedef.

Signed-off-by: Pekka Enberg <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Pekka Enberg authored and Linus Torvalds committed Mar 22, 2006
1 parent b5d8ca7 commit fcc234f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions mm/mempolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@
/* The number of pages to migrate per call to migrate_pages() */
#define MIGRATE_CHUNK_SIZE 256

static kmem_cache_t *policy_cache;
static kmem_cache_t *sn_cache;
static struct kmem_cache *policy_cache;
static struct kmem_cache *sn_cache;

#define PDprintk(fmt...)

Expand Down
4 changes: 2 additions & 2 deletions mm/mempool.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,14 @@ EXPORT_SYMBOL(mempool_free);
*/
void *mempool_alloc_slab(gfp_t gfp_mask, void *pool_data)
{
kmem_cache_t *mem = (kmem_cache_t *) pool_data;
struct kmem_cache *mem = pool_data;
return kmem_cache_alloc(mem, gfp_mask);
}
EXPORT_SYMBOL(mempool_alloc_slab);

void mempool_free_slab(void *element, void *pool_data)
{
kmem_cache_t *mem = (kmem_cache_t *) pool_data;
struct kmem_cache *mem = pool_data;
kmem_cache_free(mem, element);
}
EXPORT_SYMBOL(mempool_free_slab);
5 changes: 3 additions & 2 deletions mm/rmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

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

kmem_cache_t *anon_vma_cachep;
struct kmem_cache *anon_vma_cachep;

static inline void validate_anon_vma(struct vm_area_struct *find_vma)
{
Expand Down Expand Up @@ -166,7 +166,8 @@ void anon_vma_unlink(struct vm_area_struct *vma)
anon_vma_free(anon_vma);
}

static void anon_vma_ctor(void *data, kmem_cache_t *cachep, unsigned long flags)
static void anon_vma_ctor(void *data, struct kmem_cache *cachep,
unsigned long flags)
{
if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
SLAB_CTOR_CONSTRUCTOR) {
Expand Down
5 changes: 3 additions & 2 deletions mm/shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2119,7 +2119,7 @@ static int shmem_fill_super(struct super_block *sb,
return err;
}

static kmem_cache_t *shmem_inode_cachep;
static struct kmem_cache *shmem_inode_cachep;

static struct inode *shmem_alloc_inode(struct super_block *sb)
{
Expand All @@ -2139,7 +2139,8 @@ static void shmem_destroy_inode(struct inode *inode)
kmem_cache_free(shmem_inode_cachep, SHMEM_I(inode));
}

static void init_once(void *foo, kmem_cache_t *cachep, unsigned long flags)
static void init_once(void *foo, struct kmem_cache *cachep,
unsigned long flags)
{
struct shmem_inode_info *p = (struct shmem_inode_info *) foo;

Expand Down

0 comments on commit fcc234f

Please sign in to comment.