static inline void sysfs_slab_remove(struct kmem_cache *s)
{
kfree(s->name);
- kfree(s);
+ kmem_cache_free(kmem_cache, s);
}
#endif
if (!n)
return NULL;
- s = kmalloc(kmem_size, GFP_KERNEL);
+ s = kmem_cache_alloc(kmem_cache, GFP_KERNEL);
if (s) {
if (kmem_cache_open(s, n,
size, align, flags, ctor)) {
list_del(&s->list);
kmem_cache_close(s);
}
- kfree(s);
+ kmem_cache_free(kmem_cache, s);
}
kfree(n);
return NULL;
struct kmem_cache *s = to_slab(kobj);
kfree(s->name);
- kfree(s);
+ kmem_cache_free(kmem_cache, s);
}
static const struct sysfs_ops slab_sysfs_ops = {