Lines Matching refs:i
125 int i; in cnss_pool_init() local
127 for (i = 0; i < cnss_prealloc_pool_size; i++) { in cnss_pool_init()
129 cnss_pools[i].cache = in cnss_pool_init()
130 kmem_cache_create_usercopy(cnss_pools[i].name, in cnss_pool_init()
131 cnss_pools[i].size, 0, in cnss_pool_init()
133 cnss_pools[i].size, NULL); in cnss_pool_init()
134 if (!cnss_pools[i].cache) { in cnss_pool_init()
136 cnss_pools[i].name); in cnss_pool_init()
141 cnss_pools[i].mp = in cnss_pool_init()
142 mempool_create(cnss_pools[i].min, mempool_alloc_slab, in cnss_pool_init()
143 mempool_free_slab, cnss_pools[i].cache); in cnss_pool_init()
145 if (!cnss_pools[i].mp) { in cnss_pool_init()
147 cnss_pools[i].name); in cnss_pool_init()
148 kmem_cache_destroy(cnss_pools[i].cache); in cnss_pool_init()
149 cnss_pools[i].cache = NULL; in cnss_pool_init()
154 cnss_pools[i].name, cnss_pools[i].min, in cnss_pool_init()
155 cnss_pools[i].size); in cnss_pool_init()
170 int i; in cnss_pool_deinit() local
175 for (i = 0; i < cnss_prealloc_pool_size; i++) { in cnss_pool_deinit()
177 cnss_pools[i].name); in cnss_pool_deinit()
178 mempool_destroy(cnss_pools[i].mp); in cnss_pool_deinit()
179 kmem_cache_destroy(cnss_pools[i].cache); in cnss_pool_deinit()
180 cnss_pools[i].mp = NULL; in cnss_pool_deinit()
181 cnss_pools[i].cache = NULL; in cnss_pool_deinit()
237 int i; in cnss_pool_get_index() local
252 for (i = 0; i < cnss_prealloc_pool_size; i++) { in cnss_pool_get_index()
253 if (cnss_pools[i].cache == cache) in cnss_pool_get_index()
254 return i; in cnss_pool_get_index()
264 int i; in cnss_pool_get_index() local
279 for (i = 0; i < cnss_prealloc_pool_size; i++) { in cnss_pool_get_index()
280 if (cnss_pools[i].cache == cache) in cnss_pool_get_index()
281 return i; in cnss_pool_get_index()
302 int i; in wcnss_prealloc_get() local
314 for (i = 0; i < cnss_prealloc_pool_size; i++) { in wcnss_prealloc_get()
315 if (cnss_pools[i].size >= size && cnss_pools[i].mp) { in wcnss_prealloc_get()
316 mem = mempool_alloc(cnss_pools[i].mp, gfp_mask); in wcnss_prealloc_get()
344 int i; in wcnss_prealloc_put() local
349 i = cnss_pool_get_index(mem); in wcnss_prealloc_put()
350 if (i >= 0 && i < cnss_prealloc_pool_size && cnss_pools[i].mp) { in wcnss_prealloc_put()
351 mempool_free(mem, cnss_pools[i].mp); in wcnss_prealloc_put()