linux/drivers/block/zram/zcomp.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (C) 2014 Sergey Senozhatsky.
 */

#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/wait.h>
#include <linux/sched.h>
#include <linux/cpu.h>
#include <linux/crypto.h>
#include <linux/vmalloc.h>

#include "zcomp.h"

static const char * const backends[] =;

static void zcomp_strm_free(struct zcomp_strm *zstrm)
{}

/*
 * Initialize zcomp_strm structure with ->tfm initialized by backend, and
 * ->buffer. Return a negative value on error.
 */
static int zcomp_strm_init(struct zcomp_strm *zstrm, struct zcomp *comp)
{}

bool zcomp_available_algorithm(const char *comp)
{}

/* show available compressors */
ssize_t zcomp_available_show(const char *comp, char *buf)
{}

struct zcomp_strm *zcomp_stream_get(struct zcomp *comp)
{}

void zcomp_stream_put(struct zcomp *comp)
{}

int zcomp_compress(struct zcomp_strm *zstrm,
		const void *src, unsigned int *dst_len)
{}

int zcomp_decompress(struct zcomp_strm *zstrm,
		const void *src, unsigned int src_len, void *dst)
{}

int zcomp_cpu_up_prepare(unsigned int cpu, struct hlist_node *node)
{}

int zcomp_cpu_dead(unsigned int cpu, struct hlist_node *node)
{}

static int zcomp_init(struct zcomp *comp)
{}

void zcomp_destroy(struct zcomp *comp)
{}

/*
 * search available compressors for requested algorithm.
 * allocate new zcomp and initialize it. return compressing
 * backend pointer or ERR_PTR if things went bad. ERR_PTR(-EINVAL)
 * if requested algorithm is not supported, ERR_PTR(-ENOMEM) in
 * case of allocation error, or any other error potentially
 * returned by zcomp_init().
 */
struct zcomp *zcomp_create(const char *alg)
{}