static void *zbud_zpool_create(char *name, gfp_t gfp, const struct zpool_ops *zpool_ops, struct zpool *zpool) { struct zbud_pool *pool; pool = zbud_create_pool(gfp, zpool_ops ? &zbud_zpool_ops : NULL); if (pool) { pool->zpool = zpool; pool->zpool_ops = zpool_ops; } return pool; }
static void zswap_frontswap_init(unsigned type) { struct zswap_tree *tree; tree = kzalloc(sizeof(struct zswap_tree), GFP_KERNEL); if (!tree) goto err; tree->pool = zbud_create_pool(GFP_KERNEL, &zswap_zbud_ops); if (!tree->pool) goto freetree; tree->rbroot = RB_ROOT; spin_lock_init(&tree->lock); zswap_trees[type] = tree; return; freetree: kfree(tree); err: pr_err("alloc failed, zswap disabled for swap type %d\n", type); }
static void *zbud_zpool_create(char *name, gfp_t gfp, struct zpool_ops *zpool_ops) { return zbud_create_pool(gfp, &zbud_zpool_ops); }