{
if (kmalloc_verbose)
printk("Bulk free %p[0-%lu]\n", list, size - 1);
- for (int i = 0; i < size; i++) {
+
+ for (int i = 0; i < size; i++)
kmem_cache_free(cachep, list[i]);
- }
}
int kmem_cache_alloc_bulk(struct kmem_cache *cachep, gfp_t gfp, size_t size,
void **p)
{
size_t i;
+
if (kmalloc_verbose)
printk("Bulk alloc %lu\n", size);
return 0;
if (!(gfp & __GFP_DIRECT_RECLAIM))
- cachep->non_kernel-= size;
+ cachep->non_kernel -= size;
pthread_mutex_lock(&cachep->lock);
if (cachep->nr_objs >= size) {
struct radix_tree_node *node = cachep->objs;
+
for (i = 0; i < size; i++) {
cachep->nr_objs--;
cachep->objs = node->parent;
struct kmem_cache *kmem_cache_create(const char *name, unsigned int size,
unsigned int align, unsigned int flags,
void (*ctor)(void *));
-void kmem_cache_free_bulk(struct kmem_cache *, size_t, void **);
-int kmem_cache_alloc_bulk(struct kmem_cache *, gfp_t, size_t, void **);
+
+void kmem_cache_free_bulk(struct kmem_cache *cachep, size_t, void **);
+int kmem_cache_alloc_bulk(struct kmem_cache *cachep, gfp_t, size_t, void **);
#endif /* SLAB_H */