]> www.infradead.org Git - users/jedix/linux-maple.git/commit
crypto: acomp - Add ACOMP_REQUEST_CLONE
authorHerbert Xu <herbert@gondor.apana.org.au>
Mon, 7 Apr 2025 10:03:00 +0000 (18:03 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 16 Apr 2025 07:16:20 +0000 (15:16 +0800)
commit097c432caaa6d91f87732fe991cb08139e31101a
treecbf90c936c17accd824b0f16e4bc7210f6eb02ef
parentd0a5c9d079decad95a77638c19bc5b3a6a0ffe21
crypto: acomp - Add ACOMP_REQUEST_CLONE

Add a new helper ACOMP_REQUEST_CLONE that will transform a stack
request into a dynamically allocated one if possible, and otherwise
switch it over to the sycnrhonous fallback transform.  The intended
usage is:

ACOMP_STACK_ON_REQUEST(req, tfm);

...
err = crypto_acomp_compress(req);
/* The request cannot complete synchronously. */
if (err == -EAGAIN) {
/* This will not fail. */
req = ACOMP_REQUEST_CLONE(req, gfp);

/* Redo operation. */
err = crypto_acomp_compress(req);
}

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/acompress.c
include/crypto/acompress.h
include/crypto/internal/acompress.h