]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/md/dm-crypt.c
crypto: drop mask=CRYPTO_ALG_ASYNC from 'cipher' tfm allocations
[linux.git] / drivers / md / dm-crypt.c
index 0481223b1deb826af43fa8f0da0b81e5b6654009..a7195eb5b8d8949b87cfcedc5daf7c944abce5f2 100644 (file)
@@ -377,7 +377,7 @@ static struct crypto_cipher *alloc_essiv_cipher(struct crypt_config *cc,
        int err;
 
        /* Setup the essiv_tfm with the given salt */
-       essiv_tfm = crypto_alloc_cipher(cc->cipher, 0, CRYPTO_ALG_ASYNC);
+       essiv_tfm = crypto_alloc_cipher(cc->cipher, 0, 0);
        if (IS_ERR(essiv_tfm)) {
                ti->error = "Error allocating crypto tfm for ESSIV";
                return essiv_tfm;
@@ -2661,6 +2661,7 @@ static int crypt_ctr_optional(struct dm_target *ti, unsigned int argc, char **ar
 static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 {
        struct crypt_config *cc;
+       const char *devname = dm_table_device_name(ti->table);
        int key_size;
        unsigned int align_mask;
        unsigned long long tmpll;
@@ -2806,18 +2807,22 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
        }
 
        ret = -ENOMEM;
-       cc->io_queue = alloc_workqueue("kcryptd_io", WQ_HIGHPRI | WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM, 1);
+       cc->io_queue = alloc_workqueue("kcryptd_io/%s",
+                                      WQ_HIGHPRI | WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM,
+                                      1, devname);
        if (!cc->io_queue) {
                ti->error = "Couldn't create kcryptd io queue";
                goto bad;
        }
 
        if (test_bit(DM_CRYPT_SAME_CPU, &cc->flags))
-               cc->crypt_queue = alloc_workqueue("kcryptd", WQ_HIGHPRI | WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM, 1);
+               cc->crypt_queue = alloc_workqueue("kcryptd/%s",
+                                                 WQ_HIGHPRI | WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM,
+                                                 1, devname);
        else
-               cc->crypt_queue = alloc_workqueue("kcryptd",
+               cc->crypt_queue = alloc_workqueue("kcryptd/%s",
                                                  WQ_HIGHPRI | WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM | WQ_UNBOUND,
-                                                 num_online_cpus());
+                                                 num_online_cpus(), devname);
        if (!cc->crypt_queue) {
                ti->error = "Couldn't create kcryptd queue";
                goto bad;
@@ -2826,7 +2831,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
        spin_lock_init(&cc->write_thread_lock);
        cc->write_tree = RB_ROOT;
 
-       cc->write_thread = kthread_create(dmcrypt_write, cc, "dmcrypt_write");
+       cc->write_thread = kthread_create(dmcrypt_write, cc, "dmcrypt_write/%s", devname);
        if (IS_ERR(cc->write_thread)) {
                ret = PTR_ERR(cc->write_thread);
                cc->write_thread = NULL;