]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
crypto: api - Rename CRYPTO_ALG_REQ_CHAIN to CRYPTO_ALG_REQ_VIRT
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 1 May 2025 12:37:32 +0000 (20:37 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 5 May 2025 10:20:45 +0000 (18:20 +0800)
As chaining has been removed, all that remains of REQ_CHAIN is
just virtual address support.  Rename it before the reintroduction
of batching creates confusion.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/acompress.c
crypto/ahash.c
crypto/deflate.c
crypto/scompress.c
include/crypto/algapi.h
include/crypto/internal/acompress.h
include/crypto/internal/hash.h
include/linux/crypto.h

index 6ecbfc49bfa86220800a2a3212b12cbceee0c9bb..be28cbfd22e32d95bcc8f3de313c995cdee086c4 100644 (file)
@@ -287,7 +287,7 @@ int crypto_acomp_compress(struct acomp_req *req)
 
        if (acomp_req_on_stack(req) && acomp_is_async(tfm))
                return -EAGAIN;
-       if (crypto_acomp_req_chain(tfm) || acomp_request_issg(req))
+       if (crypto_acomp_req_virt(tfm) || acomp_request_issg(req))
                return crypto_acomp_reqtfm(req)->compress(req);
        return acomp_do_req_chain(req, true);
 }
@@ -299,7 +299,7 @@ int crypto_acomp_decompress(struct acomp_req *req)
 
        if (acomp_req_on_stack(req) && acomp_is_async(tfm))
                return -EAGAIN;
-       if (crypto_acomp_req_chain(tfm) || acomp_request_issg(req))
+       if (crypto_acomp_req_virt(tfm) || acomp_request_issg(req))
                return crypto_acomp_reqtfm(req)->decompress(req);
        return acomp_do_req_chain(req, false);
 }
index cc9885d5cfd2653590309dfca996c51802965b35..57c131a13067fc79dea2695963fadbc10de27553 100644 (file)
@@ -407,7 +407,7 @@ static int ahash_do_req_chain(struct ahash_request *req,
        u8 *page = NULL;
        int err;
 
-       if (crypto_ahash_req_chain(tfm) ||
+       if (crypto_ahash_req_virt(tfm) ||
            !update || !ahash_request_isvirt(req))
                return op(req);
 
@@ -550,7 +550,7 @@ int crypto_ahash_finup(struct ahash_request *req)
        if (ahash_req_on_stack(req) && ahash_is_async(tfm))
                return -EAGAIN;
        if (!crypto_ahash_alg(tfm)->finup ||
-           (!crypto_ahash_req_chain(tfm) && ahash_request_isvirt(req)))
+           (!crypto_ahash_req_virt(tfm) && ahash_request_isvirt(req)))
                return ahash_def_finup(req);
        return ahash_do_req_chain(req, crypto_ahash_alg(tfm)->finup);
 }
@@ -622,7 +622,7 @@ int crypto_ahash_digest(struct ahash_request *req)
                return shash_ahash_digest(req, prepare_shash_desc(req, tfm));
        if (ahash_req_on_stack(req) && ahash_is_async(tfm))
                return -EAGAIN;
-       if (!crypto_ahash_req_chain(tfm) && ahash_request_isvirt(req))
+       if (!crypto_ahash_req_virt(tfm) && ahash_request_isvirt(req))
                return ahash_def_digest(req);
        if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
                return -ENOKEY;
index 7eb1a5c44ee0a700a1f940eb5091f75020b94d8e..fe8e4ad0fee1060c29f30f1b4aff9a48c483fcc0 100644 (file)
@@ -228,7 +228,7 @@ static struct acomp_alg acomp = {
        .init                   = deflate_init,
        .base.cra_name          = "deflate",
        .base.cra_driver_name   = "deflate-generic",
-       .base.cra_flags         = CRYPTO_ALG_REQ_CHAIN,
+       .base.cra_flags         = CRYPTO_ALG_REQ_VIRT,
        .base.cra_module        = THIS_MODULE,
 };
 
index 15148c58d648578fe8b4a988544dfa7162a0ff39..c651e7f2197a97855d72c8dbeb7a840aea7e7361 100644 (file)
@@ -355,7 +355,7 @@ static void scomp_prepare_alg(struct scomp_alg *alg)
 
        comp_prepare_alg(&alg->calg);
 
-       base->cra_flags |= CRYPTO_ALG_REQ_CHAIN;
+       base->cra_flags |= CRYPTO_ALG_REQ_VIRT;
 }
 
 int crypto_register_scomp(struct scomp_alg *alg)
index f5f730969d725a2a441dfa422165a2b917f0ee8a..423e57eca3517b250d4cdb600825459822bffac4 100644 (file)
@@ -255,9 +255,9 @@ static inline u32 crypto_tfm_alg_type(struct crypto_tfm *tfm)
        return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK;
 }
 
-static inline bool crypto_tfm_req_chain(struct crypto_tfm *tfm)
+static inline bool crypto_tfm_req_virt(struct crypto_tfm *tfm)
 {
-       return tfm->__crt_alg->cra_flags & CRYPTO_ALG_REQ_CHAIN;
+       return tfm->__crt_alg->cra_flags & CRYPTO_ALG_REQ_VIRT;
 }
 
 static inline u32 crypto_request_flags(struct crypto_async_request *req)
index b72bb7a6a2b242e72d98d46a1fb2246269e5fd74..ffffd88bbbad3316e7e34fe6735d4b16def2cc71 100644 (file)
@@ -186,9 +186,9 @@ static inline bool acomp_request_isnondma(struct acomp_req *req)
                                  CRYPTO_ACOMP_REQ_DST_NONDMA);
 }
 
-static inline bool crypto_acomp_req_chain(struct crypto_acomp *tfm)
+static inline bool crypto_acomp_req_virt(struct crypto_acomp *tfm)
 {
-       return crypto_tfm_req_chain(&tfm->base);
+       return crypto_tfm_req_virt(&tfm->base);
 }
 
 void crypto_acomp_free_streams(struct crypto_acomp_streams *s);
index 33d45275f5bd454282c70cb23ded250340ea2a23..e911f32f46dcd92e57e973b71685af8497cccc4b 100644 (file)
@@ -267,9 +267,9 @@ static inline bool ahash_request_isvirt(struct ahash_request *req)
        return req->base.flags & CRYPTO_AHASH_REQ_VIRT;
 }
 
-static inline bool crypto_ahash_req_chain(struct crypto_ahash *tfm)
+static inline bool crypto_ahash_req_virt(struct crypto_ahash *tfm)
 {
-       return crypto_tfm_req_chain(&tfm->base);
+       return crypto_tfm_req_virt(&tfm->base);
 }
 
 static inline struct crypto_ahash *crypto_ahash_fb(struct crypto_ahash *tfm)
index b8d875b11193d687e37683fd17622884dc2ee845..b50f1954d1bbad1e6481d9ea8725757af630feeb 100644 (file)
  */
 #define CRYPTO_ALG_FIPS_INTERNAL       0x00020000
 
-/* Set if the algorithm supports request chains and virtual addresses. */
-#define CRYPTO_ALG_REQ_CHAIN           0x00040000
+/* Set if the algorithm supports virtual addresses. */
+#define CRYPTO_ALG_REQ_VIRT            0x00040000
 
 /* The high bits 0xff000000 are reserved for type-specific flags. */