summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorAndrey Markovytch <andreym@codeaurora.org>2016-04-20 15:29:13 +0300
committerJeevan Shriram <jshriram@codeaurora.org>2016-04-25 17:45:24 -0700
commit03a29a9ee5f6a45fc52ded7a4f0e063cfe34bf0d (patch)
tree49237eb1dc8ac9e07e65da3b9e37f848903594cc /drivers/md
parent0fb5a0c53e15bc06c160d29b31eb2de20ffe0b05 (diff)
md: dm-req-crypt: Increase mempool size for dm-req-crypt data
DM layer allocates pool size of 256 for request based module while dm-req-crypt internally allocates pool for minimum 16 requests. Increasing pool size of dm-req-crypt to be consistent with DM layer. Also, changing GFP mask for allocation from pool, depending upon whether call is made from atomic context or not. Change-Id: I9dfeb46520e0d1b1fc6f850a007fce35bdc60d35 Signed-off-by: Dinesh K Garg <dineshg@codeaurora.org> Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-req-crypt.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/md/dm-req-crypt.c b/drivers/md/dm-req-crypt.c
index efb1748bebc7..e4d080ea50e4 100644
--- a/drivers/md/dm-req-crypt.c
+++ b/drivers/md/dm-req-crypt.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
@@ -40,7 +40,7 @@
#define MAX_SG_LIST 1024
#define REQ_DM_512_KB (512*1024)
#define MAX_ENCRYPTION_BUFFERS 1
-#define MIN_IOS 16
+#define MIN_IOS 256
#define MIN_POOL_PAGES 32
#define KEY_SIZE_XTS 32
#define AES_XTS_IV_LEN 16
@@ -912,10 +912,14 @@ static int req_crypt_map(struct dm_target *ti, struct request *clone,
struct req_dm_crypt_io *req_io = NULL;
int error = DM_REQ_CRYPT_ERROR, copy_bio_sector_to_req = 0;
struct bio *bio_src = NULL;
+ gfp_t gfp_flag = GFP_KERNEL;
- req_io = mempool_alloc(req_io_pool, GFP_NOWAIT);
+ if (in_interrupt() || irqs_disabled())
+ gfp_flag = GFP_NOWAIT;
+
+ req_io = mempool_alloc(req_io_pool, gfp_flag);
if (!req_io) {
- DMERR("%s req_io allocation failed\n", __func__);
+ WARN_ON(1);
error = DM_REQ_CRYPT_ERROR;
goto submit_request;
}