[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240730115838.3507302-2-quic_mdalam@quicinc.com>
Date: Tue, 30 Jul 2024 17:28:33 +0530
From: Md Sadre Alam <quic_mdalam@...cinc.com>
To: axboe@...nel.dk, agk@...hat.com, snitzer@...nel.org, mpatocka@...hat.com,
adrian.hunter@...el.com, quic_asutoshd@...cinc.com,
ritesh.list@...il.com, ulf.hansson@...aro.org, andersson@...nel.org,
konrad.dybcio@...aro.org, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, dm-devel@...ts.linux.dev,
linux-mmc@...r.kernel.org, linux-arm-msm@...r.kernel.org,
quic_viswanat@...cinc.com, quic_srichara@...cinc.com,
quic_varada@...cinc.com
Cc: quic_mdalam@...cinc.com
Subject: [PATCH 1/6] md: dm-crypt: Fix compilation issue
Fix compilation issue due to inline encryption change.
Signed-off-by: Md Sadre Alam <quic_mdalam@...cinc.com>
---
drivers/md/dm-crypt.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index eb59b02f9bf2..37add222b169 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -233,7 +233,6 @@ struct crypt_config {
#ifdef CONFIG_BLK_INLINE_ENCRYPTION
enum blk_crypto_mode_num crypto_mode;
- enum blk_crypto_key_type key_type;
struct blk_crypto_key *blk_key;
#endif
u8 *authenc_key; /* space for keys in authenc() format (if used) */
@@ -2485,10 +2484,6 @@ static int crypt_select_inline_crypt_mode(struct dm_target *ti, char *cipher,
if (strcmp(cipher, "xts(aes)") == 0) {
cc->crypto_mode = BLK_ENCRYPTION_MODE_AES_256_XTS;
- cc->key_type = BLK_CRYPTO_KEY_TYPE_STANDARD;
- } else if (strcmp(cipher, "xts(paes)") == 0) {
- cc->crypto_mode = BLK_ENCRYPTION_MODE_AES_256_XTS;
- cc->key_type = BLK_CRYPTO_KEY_TYPE_HW_WRAPPED;
} else {
ti->error = "Invalid cipher for inline_crypt";
return -EINVAL;
@@ -2512,16 +2507,14 @@ static int crypt_prepare_inline_crypt_key(struct crypt_config *cc)
if (!cc->blk_key)
return -ENOMEM;
- ret = blk_crypto_init_key(cc->blk_key, cc->key, cc->key_size,
- cc->key_type, cc->crypto_mode, cc->iv_size,
- cc->sector_size);
+ ret = blk_crypto_init_key(cc->blk_key, cc->key, cc->crypto_mode,
+ cc->iv_size, cc->sector_size);
if (ret) {
DMERR("Failed to init inline encryption key");
goto bad_key;
}
- ret = blk_crypto_start_using_key(cc->blk_key,
- bdev_get_queue(cc->dev->bdev));
+ ret = blk_crypto_start_using_key(cc->dev->bdev, cc->blk_key);
if (ret) {
DMERR("Failed to use inline encryption key");
goto bad_key;
@@ -2537,8 +2530,7 @@ static int crypt_prepare_inline_crypt_key(struct crypt_config *cc)
static void crypt_destroy_inline_crypt_key(struct crypt_config *cc)
{
if (cc->blk_key) {
- blk_crypto_evict_key(bdev_get_queue(cc->dev->bdev),
- cc->blk_key);
+ blk_crypto_evict_key(cc->dev->bdev, cc->blk_key);
kfree_sensitive(cc->blk_key);
cc->blk_key = NULL;
}
--
2.34.1
Powered by blists - more mailing lists