include/crypto/internal/acompress.h

Source file repositories/reference/linux-study-clean/include/crypto/internal/acompress.h

File Facts

System
Linux kernel
Corpus path
include/crypto/internal/acompress.h
Extension
.h
Size
6778 bytes
Lines
247
Domain
Repository Root And Misc
Bucket
include
Inferred role
Repository Root And Misc: implementation source
Status
source implementation candidate

Why This File Exists

Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.

Dependency Surface

Detected Declarations

Annotated Snippet

struct acomp_alg {
	int (*compress)(struct acomp_req *req);
	int (*decompress)(struct acomp_req *req);
	int (*init)(struct crypto_acomp *tfm);
	void (*exit)(struct crypto_acomp *tfm);

	union {
		struct COMP_ALG_COMMON;
		struct comp_alg_common calg;
	};
};

struct crypto_acomp_stream {
	spinlock_t lock;
	void *ctx;
};

struct crypto_acomp_streams {
	/* These must come first because of struct scomp_alg. */
	void *(*alloc_ctx)(void);
	void (*free_ctx)(void *);

	struct crypto_acomp_stream __percpu *streams;
	struct work_struct stream_work;
	cpumask_t stream_want;
};

struct acomp_walk {
	union {
		/* Virtual address of the source. */
		struct {
			struct {
				const void *const addr;
			} virt;
		} src;

		/* Private field for the API, do not use. */
		struct scatter_walk in;
	};

	union {
		/* Virtual address of the destination. */
		struct {
			struct {
				void *const addr;
			} virt;
		} dst;

		/* Private field for the API, do not use. */
		struct scatter_walk out;
	};

	unsigned int slen;
	unsigned int dlen;

	int flags;
};

/*
 * Transform internal helpers.
 */
static inline void *acomp_request_ctx(struct acomp_req *req)
{
	return req->__ctx;
}

static inline void *acomp_tfm_ctx(struct crypto_acomp *tfm)
{
	return tfm->base.__crt_ctx;
}

static inline void acomp_request_complete(struct acomp_req *req,
					  int err)
{
	crypto_request_complete(&req->base, err);
}

/**
 * crypto_register_acomp() -- Register asynchronous compression algorithm
 *
 * Function registers an implementation of an asynchronous
 * compression algorithm
 *
 * @alg:	algorithm definition
 *
 * Return:	zero on success; error code in case of error
 */
int crypto_register_acomp(struct acomp_alg *alg);

/**

Annotation

Implementation Notes