diff mbox series

[3/3] blk-crypto: move __blk_crypto_cfg_supported to blk-crypto-internal.h

Message ID 20221107144229.1547370-4-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [1/3] blk-crypto: don't use struct request_queue for public interfaces | expand

Commit Message

Christoph Hellwig Nov. 7, 2022, 2:42 p.m. UTC
__blk_crypto_cfg_supported is only used internally by the blk-crypto
code now, so move it out of the public header.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/blk-crypto-internal.h        | 3 +++
 include/linux/blk-crypto-profile.h | 3 ---
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Eric Biggers Nov. 7, 2022, 8:23 p.m. UTC | #1
On Mon, Nov 07, 2022 at 03:42:29PM +0100, Christoph Hellwig wrote:
> __blk_crypto_cfg_supported is only used internally by the blk-crypto
> code now, so move it out of the public header.

"public header" is ambiguous here.  blk-crypto.h is the "public header" for
upper layers, but blk-crypto-profile.h is the "public header" for drivers.
Maybe write "blk-crypto-profile.h, which is included by drivers".

> diff --git a/block/blk-crypto-internal.h b/block/blk-crypto-internal.h
> index e6818ffaddbf8..c587b3e1886c9 100644
> --- a/block/blk-crypto-internal.h
> +++ b/block/blk-crypto-internal.h
> @@ -19,6 +19,9 @@ struct blk_crypto_mode {
>  
>  extern const struct blk_crypto_mode blk_crypto_modes[];
>  
> +bool __blk_crypto_cfg_supported(struct blk_crypto_profile *profile,
> +				const struct blk_crypto_config *cfg);
> +
>  #ifdef CONFIG_BLK_INLINE_ENCRYPTION

It should go in the '#ifdef CONFIG_BLK_INLINE_ENCRYPTION' section.

> diff --git a/include/linux/blk-crypto-profile.h b/include/linux/blk-crypto-profile.h
> index bbab65bd54288..e990ec9b32aa4 100644
> --- a/include/linux/blk-crypto-profile.h
> +++ b/include/linux/blk-crypto-profile.h
> @@ -144,9 +144,6 @@ blk_status_t blk_crypto_get_keyslot(struct blk_crypto_profile *profile,
>  
>  void blk_crypto_put_keyslot(struct blk_crypto_keyslot *slot);
>  
> -bool __blk_crypto_cfg_supported(struct blk_crypto_profile *profile,
> -				const struct blk_crypto_config *cfg);
> -
>  int __blk_crypto_evict_key(struct blk_crypto_profile *profile,
>  			   const struct blk_crypto_key *key);

Otherwise I guess this patch is fine.  The exact same argument would also apply
to blk_crypto_get_keyslot(), blk_crypto_put_keyslot(), and
__blk_crypto_evict_key(), though.  It might be worth handling them all in one
patch.

- Eric
diff mbox series

Patch

diff --git a/block/blk-crypto-internal.h b/block/blk-crypto-internal.h
index e6818ffaddbf8..c587b3e1886c9 100644
--- a/block/blk-crypto-internal.h
+++ b/block/blk-crypto-internal.h
@@ -19,6 +19,9 @@  struct blk_crypto_mode {
 
 extern const struct blk_crypto_mode blk_crypto_modes[];
 
+bool __blk_crypto_cfg_supported(struct blk_crypto_profile *profile,
+				const struct blk_crypto_config *cfg);
+
 #ifdef CONFIG_BLK_INLINE_ENCRYPTION
 
 int blk_crypto_sysfs_register(struct request_queue *q);
diff --git a/include/linux/blk-crypto-profile.h b/include/linux/blk-crypto-profile.h
index bbab65bd54288..e990ec9b32aa4 100644
--- a/include/linux/blk-crypto-profile.h
+++ b/include/linux/blk-crypto-profile.h
@@ -144,9 +144,6 @@  blk_status_t blk_crypto_get_keyslot(struct blk_crypto_profile *profile,
 
 void blk_crypto_put_keyslot(struct blk_crypto_keyslot *slot);
 
-bool __blk_crypto_cfg_supported(struct blk_crypto_profile *profile,
-				const struct blk_crypto_config *cfg);
-
 int __blk_crypto_evict_key(struct blk_crypto_profile *profile,
 			   const struct blk_crypto_key *key);