mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ladvine D Almeida <Ladvine.DAlmeida@synopsys.com>
To: Jens Axboe <axboe@kernel.dk>, Hannes Reinecke <hare@suse.com>,
	"Omar Sandoval" <osandov@fb.com>,
	Johannes Thumshirn <jthumshirn@suse.de>,
	"Sagi Grimberg" <sagi@grimberg.me>, Shaohua Li <shli@fb.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ming Lei <ming.lei@redhat.com>,
	Bart Van Assche <bart.vanassche@wdc.com>,
	Keith Busch <keith.busch@intel.com>
Cc: <linux-block@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	"Manjunath M Bettegowda <manjumb@synopsys.com>; Prabu
	Thangamuthu <prabut@synopsys.com>; Tejas Joglekar"
	<Tejas.Joglekar@synopsys.com>
Subject: [PATCH 1/7] block: Add block level changes for inline encryption
Date: Mon, 28 May 2018 13:30:25 +0100	[thread overview]
Message-ID: <8cd6a622-693a-f130-708d-eae517f26c78@synopsys.com> (raw)


This patch introduces new variable under bio structure to
facilitate inline encryption. This variable is used to
associate I/O requests to crypto information.

Signed-off-by: Ladvine D Almeida <ladvine@synopsys.com>
---
 block/Kconfig             | 13 +++++++++++++
 block/bio.c               |  6 ++++++
 include/linux/blk_types.h |  3 +++
 3 files changed, 22 insertions(+)

diff --git a/block/Kconfig b/block/Kconfig
index 28ec557..a48ecec 100644
--- a/block/Kconfig
+++ b/block/Kconfig
@@ -128,6 +128,19 @@ config BLK_DEV_THROTTLING_LOW
 
 	Note, this is an experimental interface and could be changed someday.
 
+config BLK_DEV_INLINE_ENCRYPTION
+	bool "Enable support for block device inline encryption"
+	default n
+	help
+	Enable block devices for Inline Encryption support.
+
+	This option is required to support the inline encryption capability
+	of the block device driver, including UFS Host Controller driver.
+	When the Inline Encryption feature is enabled in the block device
+	drivers, this option will be automatically enabled.
+
+	If unsure, say N.
+
 config BLK_CMDLINE_PARSER
 	bool "Block device command line partition parser"
 	default n
diff --git a/block/bio.c b/block/bio.c
index 0a4df92..91aecf5 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -606,6 +606,9 @@ void __bio_clone_fast(struct bio *bio, struct bio *bio_src)
 	bio->bi_write_hint = bio_src->bi_write_hint;
 	bio->bi_iter = bio_src->bi_iter;
 	bio->bi_io_vec = bio_src->bi_io_vec;
+#ifdef CONFIG_BLK_DEV_INLINE_ENCRYPTION
+	bio->bi_ie_private = bio_src->bi_ie_private;
+#endif
 
 	bio_clone_blkcg_association(bio, bio_src);
 }
@@ -690,6 +693,9 @@ struct bio *bio_clone_bioset(struct bio *bio_src, gfp_t gfp_mask,
 	bio->bi_write_hint	= bio_src->bi_write_hint;
 	bio->bi_iter.bi_sector	= bio_src->bi_iter.bi_sector;
 	bio->bi_iter.bi_size	= bio_src->bi_iter.bi_size;
+#ifdef CONFIG_BLK_DEV_INLINE_ENCRYPTION
+	bio->bi_ie_private      = bio_src->bi_ie_private;
+#endif
 
 	switch (bio_op(bio)) {
 	case REQ_OP_DISCARD:
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 4cb970c..11df096 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -183,6 +183,9 @@ struct bio {
 	void			*bi_cg_private;
 	struct bio_issue	bi_issue;
 #endif
+#ifdef CONFIG_BLK_DEV_INLINE_ENCRYPTION
+	void                    *bi_ie_private;
+#endif
 #endif
 	union {
 #if defined(CONFIG_BLK_DEV_INTEGRITY)
-- 
2.7.4

             reply	other threads:[~2018-05-28 12:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-28 12:30 Ladvine D Almeida [this message]
2018-05-28 12:39 ` Ladvine D Almeida

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8cd6a622-693a-f130-708d-eae517f26c78@synopsys.com \
    --to=ladvine.dalmeida@synopsys.com \
    --cc=Tejas.Joglekar@synopsys.com \
    --cc=axboe@kernel.dk \
    --cc=bart.vanassche@wdc.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hare@suse.com \
    --cc=jthumshirn@suse.de \
    --cc=keith.busch@intel.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=osandov@fb.com \
    --cc=sagi@grimberg.me \
    --cc=shli@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®