Commit 919a670d authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] kmem_cache_destroy(): use slab_error()

Use slab_error for printing the error message from kmem_cache_destroy
parent 244f3626
......@@ -475,8 +475,6 @@ static void cache_estimate (unsigned long gfporder, size_t size,
*left_over = wastage;
}
#if DEBUG
#define slab_error(cachep, msg) __slab_error(__FUNCTION__, cachep, msg)
static void __slab_error(const char *function, kmem_cache_t *cachep, char *msg)
......@@ -486,8 +484,6 @@ static void __slab_error(const char *function, kmem_cache_t *cachep, char *msg)
dump_stack();
}
#endif
/*
* Start the reap timer running on the target CPU. We run at around 1 to 2Hz.
* Add the CPU number into the expiry time to minimize the possibility of the
......@@ -1307,6 +1303,8 @@ int kmem_cache_shrink(kmem_cache_t *cachep)
*/
int kmem_cache_destroy (kmem_cache_t * cachep)
{
int i;
if (!cachep || in_interrupt())
BUG();
......@@ -1319,21 +1317,19 @@ int kmem_cache_destroy (kmem_cache_t * cachep)
up(&cache_chain_sem);
if (__cache_shrink(cachep)) {
printk(KERN_ERR "kmem_cache_destroy: Can't free all objects %p\n",
cachep);
slab_error(cachep, "Can't free all objects");
down(&cache_chain_sem);
list_add(&cachep->next,&cache_chain);
up(&cache_chain_sem);
return 1;
}
{
int i;
for (i = 0; i < NR_CPUS; i++)
kfree(cachep->array[i]);
/* NUMA: free the list3 structures */
kfree(cachep->lists.shared);
cachep->lists.shared = NULL;
}
kmem_cache_free(&cache_cache, cachep);
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment