mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/7] block: Add block level changes for inline encryption
@ 2018-05-28 12:30 Ladvine D Almeida
  2018-05-28 12:39 ` Ladvine D Almeida
  0 siblings, 1 reply; 2+ messages in thread
From: Ladvine D Almeida @ 2018-05-28 12:30 UTC (permalink / raw)
  To: Jens Axboe, Hannes Reinecke, Omar Sandoval, Johannes Thumshirn,
	Sagi Grimberg, Shaohua Li, Greg Kroah-Hartman, Ming Lei,
	Bart Van Assche, Keith Busch
  Cc: linux-block, linux-kernel,
	Manjunath M Bettegowda <manjumb@synopsys.com>; Prabu
	Thangamuthu <prabut@synopsys.com>; Tejas Joglekar


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/7] block: Add block level changes for inline encryption
  2018-05-28 12:30 [PATCH 1/7] block: Add block level changes for inline encryption Ladvine D Almeida
@ 2018-05-28 12:39 ` Ladvine D Almeida
  0 siblings, 0 replies; 2+ messages in thread
From: Ladvine D Almeida @ 2018-05-28 12:39 UTC (permalink / raw)
  To: Jens Axboe, Hannes Reinecke, Omar Sandoval, Johannes Thumshirn,
	Sagi Grimberg, Shaohua Li, Greg Kroah-Hartman, Ming Lei,
	Bart Van Assche, Keith Busch
  Cc: linux-block, linux-kernel,
	Manjunath M Bettegowda <manjumb@synopsys.com>; Prabu
	Thangamuthu <prabut@synopsys.com>; Tejas Joglekar

The subject line is incorrect for the patch.
Please discard it, I will resend with corrected subject line. 


On Monday 28 May 2018 01:30 PM, Ladvine D Almeida wrote:
> 
> 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)
> 

Best Regards,
Ladvine

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-28 12:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-28 12:30 [PATCH 1/7] block: Add block level changes for inline encryption Ladvine D Almeida
2018-05-28 12:39 ` Ladvine D Almeida

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®