]> git.pld-linux.org Git - packages/kernel.git/blob - dm-crypt-remove-io-pool.patch
- fix vserver patch for 3.14.5
[packages/kernel.git] / dm-crypt-remove-io-pool.patch
1 dm-crypt: remove io_pool
2
3 Remove io_pool and _crypt_io_pool because they are unused.
4
5 Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
6
7 ---
8  drivers/md/dm-crypt.c |   21 +--------------------
9  1 file changed, 1 insertion(+), 20 deletions(-)
10
11 Index: linux-3.14/drivers/md/dm-crypt.c
12 ===================================================================
13 --- linux-3.14.orig/drivers/md/dm-crypt.c       2014-04-04 21:04:40.000000000 +0200
14 +++ linux-3.14/drivers/md/dm-crypt.c    2014-04-04 21:05:40.000000000 +0200
15 @@ -120,7 +120,6 @@ struct crypt_config {
16          * pool for per bio private data, crypto requests and
17          * encryption requeusts/buffer pages
18          */
19 -       mempool_t *io_pool;
20         mempool_t *req_pool;
21         mempool_t *page_pool;
22         struct bio_set *bs;
23 @@ -173,8 +172,6 @@ struct crypt_config {
24  
25  #define MIN_IOS        16
26  
27 -static struct kmem_cache *_crypt_io_pool;
28 -
29  static void clone_init(struct dm_crypt_io *, struct bio *);
30  static void kcryptd_queue_crypt(struct dm_crypt_io *io);
31  static u8 *iv_of_dmreq(struct crypt_config *cc, struct dm_crypt_request *dmreq);
32 @@ -1061,8 +1058,6 @@ static void crypt_dec_pending(struct dm_
33  
34         if (io->ctx.req)
35                 crypt_free_req(cc, io->ctx.req, base_bio);
36 -       if (io != dm_per_bio_data(base_bio, cc->per_bio_data_size))
37 -               mempool_free(io, cc->io_pool);
38  
39         bio_endio(base_bio, error);
40  }
41 @@ -1450,8 +1445,6 @@ static void crypt_dtr(struct dm_target *
42                 mempool_destroy(cc->page_pool);
43         if (cc->req_pool)
44                 mempool_destroy(cc->req_pool);
45 -       if (cc->io_pool)
46 -               mempool_destroy(cc->io_pool);
47  
48         if (cc->iv_gen_ops && cc->iv_gen_ops->dtr)
49                 cc->iv_gen_ops->dtr(cc);
50 @@ -1664,19 +1657,13 @@ static int crypt_ctr(struct dm_target *t
51         if (ret < 0)
52                 goto bad;
53  
54 -       ret = -ENOMEM;
55 -       cc->io_pool = mempool_create_slab_pool(MIN_IOS, _crypt_io_pool);
56 -       if (!cc->io_pool) {
57 -               ti->error = "Cannot allocate crypt io mempool";
58 -               goto bad;
59 -       }
60 -
61         cc->dmreq_start = sizeof(struct ablkcipher_request);
62         cc->dmreq_start += crypto_ablkcipher_reqsize(any_tfm(cc));
63         cc->dmreq_start = ALIGN(cc->dmreq_start, crypto_tfm_ctx_alignment());
64         cc->dmreq_start += crypto_ablkcipher_alignmask(any_tfm(cc)) &
65                            ~(crypto_tfm_ctx_alignment() - 1);
66  
67 +       ret = -ENOMEM;
68         cc->req_pool = mempool_create_kmalloc_pool(MIN_IOS, cc->dmreq_start +
69                         sizeof(struct dm_crypt_request) + cc->iv_size);
70         if (!cc->req_pool) {
71 @@ -1938,14 +1925,9 @@ static int __init dm_crypt_init(void)
72  {
73         int r;
74  
75 -       _crypt_io_pool = KMEM_CACHE(dm_crypt_io, 0);
76 -       if (!_crypt_io_pool)
77 -               return -ENOMEM;
78 -
79         r = dm_register_target(&crypt_target);
80         if (r < 0) {
81                 DMERR("register failed %d", r);
82 -               kmem_cache_destroy(_crypt_io_pool);
83         }
84  
85         return r;
86 @@ -1954,7 +1936,6 @@ static int __init dm_crypt_init(void)
87  static void __exit dm_crypt_exit(void)
88  {
89         dm_unregister_target(&crypt_target);
90 -       kmem_cache_destroy(_crypt_io_pool);
91  }
92  
93  module_init(dm_crypt_init);
This page took 0.035456 seconds and 3 git commands to generate.