| .. | .. |
|---|
| 46 | 46 | goto fail; |
|---|
| 47 | 47 | } |
|---|
| 48 | 48 | |
|---|
| 49 | | - /* crypto_alloc_skcipher() allocates with GFP_KERNEL */ |
|---|
| 49 | + /* crypto_alloc_sync_skcipher() allocates with GFP_KERNEL */ |
|---|
| 50 | 50 | noio_flag = memalloc_noio_save(); |
|---|
| 51 | | - key->tfm = crypto_alloc_skcipher("cbc(aes)", 0, CRYPTO_ALG_ASYNC); |
|---|
| 51 | + key->tfm = crypto_alloc_sync_skcipher("cbc(aes)", 0, 0); |
|---|
| 52 | 52 | memalloc_noio_restore(noio_flag); |
|---|
| 53 | 53 | if (IS_ERR(key->tfm)) { |
|---|
| 54 | 54 | ret = PTR_ERR(key->tfm); |
|---|
| .. | .. |
|---|
| 56 | 56 | goto fail; |
|---|
| 57 | 57 | } |
|---|
| 58 | 58 | |
|---|
| 59 | | - ret = crypto_skcipher_setkey(key->tfm, key->key, key->len); |
|---|
| 59 | + ret = crypto_sync_skcipher_setkey(key->tfm, key->key, key->len); |
|---|
| 60 | 60 | if (ret) |
|---|
| 61 | 61 | goto fail; |
|---|
| 62 | 62 | |
|---|
| .. | .. |
|---|
| 136 | 136 | if (key) { |
|---|
| 137 | 137 | kfree(key->key); |
|---|
| 138 | 138 | key->key = NULL; |
|---|
| 139 | | - crypto_free_skcipher(key->tfm); |
|---|
| 140 | | - key->tfm = NULL; |
|---|
| 139 | + if (key->tfm) { |
|---|
| 140 | + crypto_free_sync_skcipher(key->tfm); |
|---|
| 141 | + key->tfm = NULL; |
|---|
| 142 | + } |
|---|
| 141 | 143 | } |
|---|
| 142 | 144 | } |
|---|
| 143 | 145 | |
|---|
| .. | .. |
|---|
| 216 | 218 | static int ceph_aes_crypt(const struct ceph_crypto_key *key, bool encrypt, |
|---|
| 217 | 219 | void *buf, int buf_len, int in_len, int *pout_len) |
|---|
| 218 | 220 | { |
|---|
| 219 | | - SKCIPHER_REQUEST_ON_STACK(req, key->tfm); |
|---|
| 221 | + SYNC_SKCIPHER_REQUEST_ON_STACK(req, key->tfm); |
|---|
| 220 | 222 | struct sg_table sgt; |
|---|
| 221 | 223 | struct scatterlist prealloc_sg; |
|---|
| 222 | 224 | char iv[AES_BLOCK_SIZE] __aligned(8); |
|---|
| .. | .. |
|---|
| 232 | 234 | return ret; |
|---|
| 233 | 235 | |
|---|
| 234 | 236 | memcpy(iv, aes_iv, AES_BLOCK_SIZE); |
|---|
| 235 | | - skcipher_request_set_tfm(req, key->tfm); |
|---|
| 237 | + skcipher_request_set_sync_tfm(req, key->tfm); |
|---|
| 236 | 238 | skcipher_request_set_callback(req, 0, NULL, NULL); |
|---|
| 237 | 239 | skcipher_request_set_crypt(req, sgt.sgl, sgt.sgl, crypt_len, iv); |
|---|
| 238 | 240 | |
|---|