linux/drivers/block/zram/backend_zstd.c

// SPDX-License-Identifier: GPL-2.0-or-later

#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/zstd.h>

#include "backend_zstd.h"

struct zstd_ctx {};

struct zstd_params {};

/*
 * For C/D dictionaries we need to provide zstd with zstd_custom_mem,
 * which zstd uses internally to allocate/free memory when needed.
 *
 * This means that allocator.customAlloc() can be called from zcomp_compress()
 * under local-lock (per-CPU compression stream), in which case we must use
 * GFP_ATOMIC.
 *
 * Another complication here is that we can be configured as a swap device.
 */
static void *zstd_custom_alloc(void *opaque, size_t size)
{}

static void zstd_custom_free(void *opaque, void *address)
{}

static void zstd_release_params(struct zcomp_params *params)
{}

static int zstd_setup_params(struct zcomp_params *params)
{}

static void zstd_destroy(struct zcomp_ctx *ctx)
{}

static int zstd_create(struct zcomp_params *params, struct zcomp_ctx *ctx)
{}

static int zstd_compress(struct zcomp_params *params, struct zcomp_ctx *ctx,
			 struct zcomp_req *req)
{}

static int zstd_decompress(struct zcomp_params *params, struct zcomp_ctx *ctx,
			   struct zcomp_req *req)
{}

const struct zcomp_ops backend_zstd =;