diff options
author | Christoph Lameter <clameter@sgi.com> | 2006-12-06 23:32:59 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:23 -0500 |
commit | ebe29738f3934ad6a93c8bd76e30aa5d797a269d (patch) | |
tree | bde287ec1b33aaeaa0941eeac6bdb677eec3feb3 /include | |
parent | b86c089b83b8ae2bc814db865057768a9ba787b5 (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')
-rw-r--r-- | include/linux/slab.h | 33 |
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 */ | ||
12 | typedef struct kmem_cache kmem_cache_t; | 13 | typedef 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 */ |
58 | extern void __init kmem_cache_init(void); | 59 | extern void __init kmem_cache_init(void); |
59 | 60 | ||
60 | extern kmem_cache_t *kmem_cache_create(const char *, size_t, size_t, unsigned long, | 61 | extern 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), |
63 | extern void kmem_cache_destroy(kmem_cache_t *); | 64 | void (*)(void *, struct kmem_cache *, unsigned long)); |
64 | extern int kmem_cache_shrink(kmem_cache_t *); | 65 | extern void kmem_cache_destroy(struct kmem_cache *); |
65 | extern void *kmem_cache_alloc(kmem_cache_t *, gfp_t); | 66 | extern int kmem_cache_shrink(struct kmem_cache *); |
67 | extern void *kmem_cache_alloc(struct kmem_cache *, gfp_t); | ||
66 | extern void *kmem_cache_zalloc(struct kmem_cache *, gfp_t); | 68 | extern void *kmem_cache_zalloc(struct kmem_cache *, gfp_t); |
67 | extern void kmem_cache_free(kmem_cache_t *, void *); | 69 | extern void kmem_cache_free(struct kmem_cache *, void *); |
68 | extern unsigned int kmem_cache_size(kmem_cache_t *); | 70 | extern unsigned int kmem_cache_size(struct kmem_cache *); |
69 | extern const char *kmem_cache_name(kmem_cache_t *); | 71 | extern const char *kmem_cache_name(struct kmem_cache *); |
70 | 72 | ||
71 | /* Size description struct for general caches. */ | 73 | /* Size description struct for general caches. */ |
72 | struct cache_sizes { | 74 | struct 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 | }; |
77 | extern struct cache_sizes malloc_sizes[]; | 79 | extern struct cache_sizes malloc_sizes[]; |
78 | 80 | ||
@@ -211,7 +213,7 @@ extern unsigned int ksize(const void *); | |||
211 | extern int slab_is_available(void); | 213 | extern int slab_is_available(void); |
212 | 214 | ||
213 | #ifdef CONFIG_NUMA | 215 | #ifdef CONFIG_NUMA |
214 | extern void *kmem_cache_alloc_node(kmem_cache_t *, gfp_t flags, int node); | 216 | extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); |
215 | extern void *__kmalloc_node(size_t size, gfp_t flags, int node); | 217 | extern void *__kmalloc_node(size_t size, gfp_t flags, int node); |
216 | 218 | ||
217 | static inline void *kmalloc_node(size_t size, gfp_t flags, int node) | 219 | static 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 */ |
258 | static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, gfp_t flags, int node) | 260 | static 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 | ||
271 | extern int FASTCALL(kmem_cache_reap(int)); | 274 | extern int FASTCALL(kmem_cache_reap(int)); |
272 | extern int FASTCALL(kmem_ptr_validate(kmem_cache_t *cachep, void *ptr)); | 275 | extern int FASTCALL(kmem_ptr_validate(struct kmem_cache *cachep, void *ptr)); |
273 | 276 | ||
274 | #else /* CONFIG_SLOB */ | 277 | #else /* CONFIG_SLOB */ |
275 | 278 | ||