aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/slab.h
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2006-12-06 23:32:59 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 11:39:23 -0500
commitebe29738f3934ad6a93c8bd76e30aa5d797a269d (patch)
treebde287ec1b33aaeaa0941eeac6bdb677eec3feb3 /include/linux/slab.h
parentb86c089b83b8ae2bc814db865057768a9ba787b5 (diff)
[PATCH] Remove uses of kmem_cache_t from mm/* and include/linux/slab.h
Remove all uses of kmem_cache_t (the most were left in slab.h). The typedef for kmem_cache_t is then only necessary for other kernel subsystems. Add a comment to that effect. Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/slab.h')
-rw-r--r--include/linux/slab.h33
1 files changed, 18 insertions, 15 deletions
diff --git a/include/linux/slab.h b/include/linux/slab.h
index e67314e4a0a0..b831776b2fc7 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -9,6 +9,7 @@
9 9
10#if defined(__KERNEL__) 10#if defined(__KERNEL__)
11 11
12/* kmem_cache_t exists for legacy reasons and is not used by code in mm */
12typedef struct kmem_cache kmem_cache_t; 13typedef struct kmem_cache kmem_cache_t;
13 14
14#include <linux/gfp.h> 15#include <linux/gfp.h>
@@ -57,22 +58,23 @@ typedef struct kmem_cache kmem_cache_t;
57/* prototypes */ 58/* prototypes */
58extern void __init kmem_cache_init(void); 59extern void __init kmem_cache_init(void);
59 60
60extern kmem_cache_t *kmem_cache_create(const char *, size_t, size_t, unsigned long, 61extern struct kmem_cache *kmem_cache_create(const char *, size_t, size_t,
61 void (*)(void *, kmem_cache_t *, unsigned long), 62 unsigned long,
62 void (*)(void *, kmem_cache_t *, unsigned long)); 63 void (*)(void *, struct kmem_cache *, unsigned long),
63extern void kmem_cache_destroy(kmem_cache_t *); 64 void (*)(void *, struct kmem_cache *, unsigned long));
64extern int kmem_cache_shrink(kmem_cache_t *); 65extern void kmem_cache_destroy(struct kmem_cache *);
65extern void *kmem_cache_alloc(kmem_cache_t *, gfp_t); 66extern int kmem_cache_shrink(struct kmem_cache *);
67extern void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
66extern void *kmem_cache_zalloc(struct kmem_cache *, gfp_t); 68extern void *kmem_cache_zalloc(struct kmem_cache *, gfp_t);
67extern void kmem_cache_free(kmem_cache_t *, void *); 69extern void kmem_cache_free(struct kmem_cache *, void *);
68extern unsigned int kmem_cache_size(kmem_cache_t *); 70extern unsigned int kmem_cache_size(struct kmem_cache *);
69extern const char *kmem_cache_name(kmem_cache_t *); 71extern const char *kmem_cache_name(struct kmem_cache *);
70 72
71/* Size description struct for general caches. */ 73/* Size description struct for general caches. */
72struct cache_sizes { 74struct cache_sizes {
73 size_t cs_size; 75 size_t cs_size;
74 kmem_cache_t *cs_cachep; 76 struct kmem_cache *cs_cachep;
75 kmem_cache_t *cs_dmacachep; 77 struct kmem_cache *cs_dmacachep;
76}; 78};
77extern struct cache_sizes malloc_sizes[]; 79extern struct cache_sizes malloc_sizes[];
78 80
@@ -211,7 +213,7 @@ extern unsigned int ksize(const void *);
211extern int slab_is_available(void); 213extern int slab_is_available(void);
212 214
213#ifdef CONFIG_NUMA 215#ifdef CONFIG_NUMA
214extern void *kmem_cache_alloc_node(kmem_cache_t *, gfp_t flags, int node); 216extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
215extern void *__kmalloc_node(size_t size, gfp_t flags, int node); 217extern void *__kmalloc_node(size_t size, gfp_t flags, int node);
216 218
217static inline void *kmalloc_node(size_t size, gfp_t flags, int node) 219static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
@@ -255,7 +257,8 @@ extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, void *);
255 __builtin_return_address(0)) 257 __builtin_return_address(0))
256#endif 258#endif
257#else /* CONFIG_NUMA */ 259#else /* CONFIG_NUMA */
258static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, gfp_t flags, int node) 260static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep,
261 gfp_t flags, int node)
259{ 262{
260 return kmem_cache_alloc(cachep, flags); 263 return kmem_cache_alloc(cachep, flags);
261} 264}
@@ -269,7 +272,7 @@ static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
269#endif 272#endif
270 273
271extern int FASTCALL(kmem_cache_reap(int)); 274extern int FASTCALL(kmem_cache_reap(int));
272extern int FASTCALL(kmem_ptr_validate(kmem_cache_t *cachep, void *ptr)); 275extern int FASTCALL(kmem_ptr_validate(struct kmem_cache *cachep, void *ptr));
273 276
274#else /* CONFIG_SLOB */ 277#else /* CONFIG_SLOB */
275 278