static void destroy_handle_cache(struct zs_pool *pool)
{
- if (pool->handle_cachep)
- kmem_cache_destroy(pool->handle_cachep);
+ kmem_cache_destroy(pool->handle_cachep);
}
static unsigned long alloc_handle(struct zs_pool *pool)
#ifdef CONFIG_ZPOOL
-static void *zs_zpool_create(char *name, gfp_t gfp, struct zpool_ops *zpool_ops,
+static void *zs_zpool_create(char *name, gfp_t gfp,
+ const struct zpool_ops *zpool_ops,
struct zpool *zpool)
{
return zs_create_pool(name, gfp);
*
* Based on the number of unused allocated objects calculate
* and return the number of pages that we can free.
- *
- * Should be called under class->lock.
*/
static unsigned long zs_can_compact(struct size_class *class)
{
if (class->index != i)
continue;
- spin_lock(&class->lock);
pages_to_free += zs_can_compact(class);
- spin_unlock(&class->lock);
}
return pages_to_free;