Re: [PATCH v1 0/8] Batched zswap_store() with compression batching

From: Herbert Xu

Date: Sun Oct 18 2026 - 21:39:11 EST


On Sun, Oct 18, 2026 at 06:35:01PM -0700, Kanchana P. Sridhar wrote:
>
> Please let me know if [2] looks good and I can include this in v2, thanks!
>
> [2]:
>
> int crypto_acomp_compress(struct acomp_req *req)
> {
> struct crypto_acomp *tfm = crypto_acomp_reqtfm(req);
>
> if (unlikely(acomp_req_on_stack(req) && acomp_is_async(tfm)))
> return -EAGAIN;
>
> if (likely(req->unit_size && acomp_request_issg(req))) {
> if (likely(!crypto_acomp_req_seg(tfm))) {
> if (likely(req->unit_size == req->slen)) {
> int err = tfm->compress(req);
>
> req->dst->length = unlikely(err) ? err : req->dlen;
> return err;
> } else {
> return acomp_do_req_chain(req, true);
> }
> }
>
> return tfm->compress(req);
> }
>
> if (crypto_acomp_req_virt(tfm) || acomp_request_issg(req))
> return tfm->compress(req);
>
> return acomp_do_req_chain(req, true);
> }

This looks good to me.

Thanks,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt