Revert "dm crypt: export sysfs of kcryptd workqueue"
[linux-2.6-microblaze.git] / drivers / md / dm-crypt.c
index 380386c..5379113 100644 (file)
@@ -424,7 +424,8 @@ static int crypt_iv_lmk_ctr(struct crypt_config *cc, struct dm_target *ti,
                return -EINVAL;
        }
 
-       lmk->hash_tfm = crypto_alloc_shash("md5", 0, 0);
+       lmk->hash_tfm = crypto_alloc_shash("md5", 0,
+                                          CRYPTO_ALG_ALLOCATES_MEMORY);
        if (IS_ERR(lmk->hash_tfm)) {
                ti->error = "Error initializing LMK hash";
                return PTR_ERR(lmk->hash_tfm);
@@ -586,7 +587,8 @@ static int crypt_iv_tcw_ctr(struct crypt_config *cc, struct dm_target *ti,
                return -EINVAL;
        }
 
-       tcw->crc32_tfm = crypto_alloc_shash("crc32", 0, 0);
+       tcw->crc32_tfm = crypto_alloc_shash("crc32", 0,
+                                           CRYPTO_ALG_ALLOCATES_MEMORY);
        if (IS_ERR(tcw->crc32_tfm)) {
                ti->error = "Error initializing CRC32 in TCW";
                return PTR_ERR(tcw->crc32_tfm);
@@ -773,7 +775,8 @@ static int crypt_iv_elephant_ctr(struct crypt_config *cc, struct dm_target *ti,
        struct iv_elephant_private *elephant = &cc->iv_gen_private.elephant;
        int r;
 
-       elephant->tfm = crypto_alloc_skcipher("ecb(aes)", 0, 0);
+       elephant->tfm = crypto_alloc_skcipher("ecb(aes)", 0,
+                                             CRYPTO_ALG_ALLOCATES_MEMORY);
        if (IS_ERR(elephant->tfm)) {
                r = PTR_ERR(elephant->tfm);
                elephant->tfm = NULL;
@@ -1087,16 +1090,16 @@ static const struct crypt_iv_operations crypt_iv_tcw_ops = {
        .post      = crypt_iv_tcw_post
 };
 
-static struct crypt_iv_operations crypt_iv_random_ops = {
+static const struct crypt_iv_operations crypt_iv_random_ops = {
        .generator = crypt_iv_random_gen
 };
 
-static struct crypt_iv_operations crypt_iv_eboiv_ops = {
+static const struct crypt_iv_operations crypt_iv_eboiv_ops = {
        .ctr       = crypt_iv_eboiv_ctr,
        .generator = crypt_iv_eboiv_gen
 };
 
-static struct crypt_iv_operations crypt_iv_elephant_ops = {
+static const struct crypt_iv_operations crypt_iv_elephant_ops = {
        .ctr       = crypt_iv_elephant_ctr,
        .dtr       = crypt_iv_elephant_dtr,
        .init      = crypt_iv_elephant_init,
@@ -2154,7 +2157,8 @@ static int crypt_alloc_tfms_skcipher(struct crypt_config *cc, char *ciphermode)
                return -ENOMEM;
 
        for (i = 0; i < cc->tfms_count; i++) {
-               cc->cipher_tfm.tfms[i] = crypto_alloc_skcipher(ciphermode, 0, 0);
+               cc->cipher_tfm.tfms[i] = crypto_alloc_skcipher(ciphermode, 0,
+                                               CRYPTO_ALG_ALLOCATES_MEMORY);
                if (IS_ERR(cc->cipher_tfm.tfms[i])) {
                        err = PTR_ERR(cc->cipher_tfm.tfms[i]);
                        crypt_free_tfms(cc);
@@ -2180,7 +2184,8 @@ static int crypt_alloc_tfms_aead(struct crypt_config *cc, char *ciphermode)
        if (!cc->cipher_tfm.tfms)
                return -ENOMEM;
 
-       cc->cipher_tfm.tfms_aead[0] = crypto_alloc_aead(ciphermode, 0, 0);
+       cc->cipher_tfm.tfms_aead[0] = crypto_alloc_aead(ciphermode, 0,
+                                               CRYPTO_ALG_ALLOCATES_MEMORY);
        if (IS_ERR(cc->cipher_tfm.tfms_aead[0])) {
                err = PTR_ERR(cc->cipher_tfm.tfms_aead[0]);
                crypt_free_tfms(cc);
@@ -2667,7 +2672,7 @@ static int crypt_ctr_auth_cipher(struct crypt_config *cc, char *cipher_api)
                return -ENOMEM;
        strncpy(mac_alg, start, end - start);
 
-       mac = crypto_alloc_ahash(mac_alg, 0, 0);
+       mac = crypto_alloc_ahash(mac_alg, 0, CRYPTO_ALG_ALLOCATES_MEMORY);
        kfree(mac_alg);
 
        if (IS_ERR(mac))