Commit 72fa491912689ca69dd15f4266945d2c2f2819f8
1 parent
eaf44088ff
Exists in
master
and in
20 other branches
[CRYPTO] api: Rename crypto_alg_get to crypto_mod_get
The functions crypto_alg_get and crypto_alg_put operates on the crypto modules rather than the algorithms. Therefore it makes sense to call them crypto_mod_get and crypto_alg_put respectively. This is needed because we need to have real algorithm reference counters for parameterised algorithms as they can be unregistered from below by when their parameter algorithms are themselves unregistered. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 1 changed file with 7 additions and 7 deletions Side-by-side Diff
crypto/api.c
... | ... | @@ -29,12 +29,12 @@ |
29 | 29 | LIST_HEAD(crypto_alg_list); |
30 | 30 | DECLARE_RWSEM(crypto_alg_sem); |
31 | 31 | |
32 | -static inline int crypto_alg_get(struct crypto_alg *alg) | |
32 | +static inline int crypto_mod_get(struct crypto_alg *alg) | |
33 | 33 | { |
34 | 34 | return try_module_get(alg->cra_module); |
35 | 35 | } |
36 | 36 | |
37 | -static inline void crypto_alg_put(struct crypto_alg *alg) | |
37 | +static inline void crypto_mod_put(struct crypto_alg *alg) | |
38 | 38 | { |
39 | 39 | module_put(alg->cra_module); |
40 | 40 | } |
41 | 41 | |
... | ... | @@ -57,12 +57,12 @@ |
57 | 57 | if (!exact && !(fuzzy && q->cra_priority > best)) |
58 | 58 | continue; |
59 | 59 | |
60 | - if (unlikely(!crypto_alg_get(q))) | |
60 | + if (unlikely(!crypto_mod_get(q))) | |
61 | 61 | continue; |
62 | 62 | |
63 | 63 | best = q->cra_priority; |
64 | 64 | if (alg) |
65 | - crypto_alg_put(alg); | |
65 | + crypto_mod_put(alg); | |
66 | 66 | alg = q; |
67 | 67 | |
68 | 68 | if (exact) |
... | ... | @@ -202,7 +202,7 @@ |
202 | 202 | kfree(tfm); |
203 | 203 | tfm = NULL; |
204 | 204 | out_put: |
205 | - crypto_alg_put(alg); | |
205 | + crypto_mod_put(alg); | |
206 | 206 | out: |
207 | 207 | return tfm; |
208 | 208 | } |
... | ... | @@ -221,7 +221,7 @@ |
221 | 221 | if (alg->cra_exit) |
222 | 222 | alg->cra_exit(tfm); |
223 | 223 | crypto_exit_ops(tfm); |
224 | - crypto_alg_put(alg); | |
224 | + crypto_mod_put(alg); | |
225 | 225 | memset(tfm, 0, size); |
226 | 226 | kfree(tfm); |
227 | 227 | } |
... | ... | @@ -305,7 +305,7 @@ |
305 | 305 | struct crypto_alg *alg = crypto_alg_mod_lookup(name); |
306 | 306 | |
307 | 307 | if (alg) { |
308 | - crypto_alg_put(alg); | |
308 | + crypto_mod_put(alg); | |
309 | 309 | ret = 1; |
310 | 310 | } |
311 | 311 |