aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slob.c
diff options
context:
space:
mode:
authorDimitri Gorokhovik <dimitri.gorokhovik@free.fr>2006-12-29 19:48:28 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-30 13:56:42 -0500
commitbcb4ddb46a4c66d64d091e7ffa951b2aa1ba537f (patch)
tree80ba7ced73f4a329e8cb84dd2b0a192708a033f0 /mm/slob.c
parent131612dfe7923bd0ce5f82d6ed8303a7ef96e574 (diff)
[PATCH] MM: SLOB is broken by recent cleanup of slab.h
Recent cleanup of slab.h broke SLOB allocator: the routine kmem_cache_init has now the __init attribute for both slab.c and slob.c. This routine cannot be removed after init in the case of slob.c -- it serves as a timer callback. Provide a separate timer callback routine, call it once from kmem_cache_init, keep the __init attribute on the latter. Signed-off-by: Dimitri Gorokhovik <dimitri.gorokhovik@free.fr> Cc: Christoph Lameter <clameter@engr.sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/slob.c')
-rw-r--r--mm/slob.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/mm/slob.c b/mm/slob.c
index 2e9236e10ed1..5adc29cb58dd 100644
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -60,6 +60,8 @@ static DEFINE_SPINLOCK(slob_lock);
60static DEFINE_SPINLOCK(block_lock); 60static DEFINE_SPINLOCK(block_lock);
61 61
62static void slob_free(void *b, int size); 62static void slob_free(void *b, int size);
63static void slob_timer_cbk(void);
64
63 65
64static void *slob_alloc(size_t size, gfp_t gfp, int align) 66static void *slob_alloc(size_t size, gfp_t gfp, int align)
65{ 67{
@@ -326,7 +328,7 @@ const char *kmem_cache_name(struct kmem_cache *c)
326EXPORT_SYMBOL(kmem_cache_name); 328EXPORT_SYMBOL(kmem_cache_name);
327 329
328static struct timer_list slob_timer = TIMER_INITIALIZER( 330static struct timer_list slob_timer = TIMER_INITIALIZER(
329 (void (*)(unsigned long))kmem_cache_init, 0, 0); 331 (void (*)(unsigned long))slob_timer_cbk, 0, 0);
330 332
331int kmem_cache_shrink(struct kmem_cache *d) 333int kmem_cache_shrink(struct kmem_cache *d)
332{ 334{
@@ -339,7 +341,12 @@ int kmem_ptr_validate(struct kmem_cache *a, const void *b)
339 return 0; 341 return 0;
340} 342}
341 343
342void kmem_cache_init(void) 344void __init kmem_cache_init(void)
345{
346 slob_timer_cbk();
347}
348
349static void slob_timer_cbk(void)
343{ 350{
344 void *p = slob_alloc(PAGE_SIZE, 0, PAGE_SIZE-1); 351 void *p = slob_alloc(PAGE_SIZE, 0, PAGE_SIZE-1);
345 352