]> git.pld-linux.org Git - packages/kernel.git/blobdiff - dm-crypt-offload-writes-to-thread.patch
- 3.14.32
[packages/kernel.git] / dm-crypt-offload-writes-to-thread.patch
index da2e68f2b075c854b602f7067c95cc723603bd19..8fdec56c140578f2fb20c992d6f07161c6177681 100644 (file)
@@ -21,11 +21,11 @@ Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
  drivers/md/dm-crypt.c |  120 ++++++++++++++++++++++++++++++++++++++++----------
  1 file changed, 97 insertions(+), 23 deletions(-)
 
-Index: linux-3.9.2-fast/drivers/md/dm-crypt.c
+Index: linux-3.14/drivers/md/dm-crypt.c
 ===================================================================
---- linux-3.9.2-fast.orig/drivers/md/dm-crypt.c        2013-05-15 22:49:53.000000000 +0200
-+++ linux-3.9.2-fast/drivers/md/dm-crypt.c     2013-05-15 22:49:57.000000000 +0200
-@@ -17,6 +17,7 @@
+--- linux-3.14.orig/drivers/md/dm-crypt.c      2014-04-04 21:05:40.000000000 +0200
++++ linux-3.14/drivers/md/dm-crypt.c   2014-04-04 21:06:22.000000000 +0200
+@@ -18,6 +18,7 @@
  #include <linux/slab.h>
  #include <linux/crypto.h>
  #include <linux/workqueue.h>
@@ -33,16 +33,16 @@ Index: linux-3.9.2-fast/drivers/md/dm-crypt.c
  #include <linux/backing-dev.h>
  #include <linux/atomic.h>
  #include <linux/scatterlist.h>
-@@ -59,6 +60,8 @@ struct dm_crypt_io {
+@@ -58,6 +59,8 @@ struct dm_crypt_io {
        atomic_t io_pending;
        int error;
        sector_t sector;
 +
 +      struct list_head list;
- };
+ } CRYPTO_MINALIGN_ATTR;
  
  struct dm_crypt_request {
-@@ -123,6 +126,10 @@ struct crypt_config {
+@@ -128,6 +131,10 @@ struct crypt_config {
        struct workqueue_struct *io_queue;
        struct workqueue_struct *crypt_queue;
  
@@ -53,7 +53,7 @@ Index: linux-3.9.2-fast/drivers/md/dm-crypt.c
        char *cipher;
        char *cipher_string;
  
-@@ -977,37 +984,89 @@ static int kcryptd_io_read(struct dm_cry
+@@ -1141,37 +1148,89 @@ static int kcryptd_io_read(struct dm_cry
        return 0;
  }
  
@@ -159,9 +159,9 @@ Index: linux-3.9.2-fast/drivers/md/dm-crypt.c
  
        if (unlikely(io->error < 0)) {
                crypt_free_buffer_pages(cc, clone);
-@@ -1021,10 +1080,10 @@ static void kcryptd_crypt_write_io_submi
+@@ -1185,10 +1244,10 @@ static void kcryptd_crypt_write_io_submi
  
-       clone->bi_sector = cc->start + io->sector;
+       clone->bi_iter.bi_sector = cc->start + io->sector;
  
 -      if (async)
 -              kcryptd_queue_io(io);
@@ -174,16 +174,16 @@ Index: linux-3.9.2-fast/drivers/md/dm-crypt.c
  }
  
  static void kcryptd_crypt_write_convert(struct dm_crypt_io *io)
-@@ -1060,7 +1119,7 @@ static void kcryptd_crypt_write_convert(
+@@ -1224,7 +1283,7 @@ static void kcryptd_crypt_write_convert(
  
        /* Encryption was already finished, submit io now */
-       if (crypt_finished)
+       if (crypt_finished) {
 -              kcryptd_crypt_write_io_submit(io, 0);
 +              kcryptd_crypt_write_io_submit(io);
+               io->sector = sector;
+       }
  
- dec:
-       crypt_dec_pending(io);
-@@ -1118,7 +1177,7 @@ static void kcryptd_async_done(struct cr
+@@ -1284,7 +1343,7 @@ static void kcryptd_async_done(struct cr
        if (bio_data_dir(io->base_bio) == READ)
                kcryptd_crypt_read_done(io);
        else
@@ -192,7 +192,7 @@ Index: linux-3.9.2-fast/drivers/md/dm-crypt.c
  }
  
  static void kcryptd_crypt(struct work_struct *work)
-@@ -1262,6 +1321,9 @@ static void crypt_dtr(struct dm_target *
+@@ -1431,6 +1490,9 @@ static void crypt_dtr(struct dm_target *
        if (!cc)
                return;
  
@@ -202,7 +202,7 @@ Index: linux-3.9.2-fast/drivers/md/dm-crypt.c
        if (cc->io_queue)
                destroy_workqueue(cc->io_queue);
        if (cc->crypt_queue)
-@@ -1578,6 +1640,18 @@ static int crypt_ctr(struct dm_target *t
+@@ -1745,6 +1807,18 @@ static int crypt_ctr(struct dm_target *t
                goto bad;
        }
  
@@ -221,7 +221,7 @@ Index: linux-3.9.2-fast/drivers/md/dm-crypt.c
        ti->num_flush_bios = 1;
        ti->discard_zeroes_data_unsupported = true;
  
-@@ -1611,7 +1685,7 @@ static int crypt_map(struct dm_target *t
+@@ -1779,7 +1853,7 @@ static int crypt_map(struct dm_target *t
  
        if (bio_data_dir(io->base_bio) == READ) {
                if (kcryptd_io_read(io, GFP_NOWAIT))
This page took 0.030456 seconds and 4 git commands to generate.