Re: [PATCH 1/3] blk-crypto: don't use struct request_queue for public interfaces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 07, 2022 at 03:42:27PM +0100, Christoph Hellwig wrote:
> diff --git a/block/blk-crypto.c b/block/blk-crypto.c
> index a496aaef85ba4..0e0c2fc56c428 100644
> --- a/block/blk-crypto.c
> +++ b/block/blk-crypto.c
> @@ -357,17 +357,18 @@ int blk_crypto_init_key(struct blk_crypto_key *blk_key, const u8 *raw_key,
>   * request queue it's submitted to supports inline crypto, or the
>   * blk-crypto-fallback is enabled and supports the cfg).
>   */

Replace "request queue" with block_device in the above comment?

> -bool blk_crypto_config_supported(struct request_queue *q,
> +bool blk_crypto_config_supported(struct block_device *bdev,
>  				 const struct blk_crypto_config *cfg)
>  {
>  	return IS_ENABLED(CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK) ||
> -	       __blk_crypto_cfg_supported(q->crypto_profile, cfg);
> +	       __blk_crypto_cfg_supported(bdev_get_queue(bdev)->crypto_profile,
> +	       				  cfg);
>  }

There's a whitespace error here:

$ checkpatch 0001-blk-crypto-don-t-use-struct-request_queue-for-public.patch
ERROR: code indent should use tabs where possible
#87: FILE: block/blk-crypto.c:365:
+^I       ^I^I^I^I  cfg);$

WARNING: please, no space before tabs
#87: FILE: block/blk-crypto.c:365:
+^I       ^I^I^I^I  cfg);$

> -int blk_crypto_evict_key(struct request_queue *q,
> +int blk_crypto_evict_key(struct block_device *bdev,
>                          const struct blk_crypto_key *key)
>  {
> +	struct request_queue *q = bdev_get_queue(bdev);
> +
>	if (__blk_crypto_cfg_supported(q->crypto_profile, &key->crypto_cfg))
>		return __blk_crypto_evict_key(q->crypto_profile, key);
>
>	/*
>        * If the request_queue didn't support the key, then blk-crypto-fallback
>        * may have been used, so try to evict the key from blk-crypto-fallback.
>        */
>	return blk_crypto_fallback_evict_key(key);

Likewise, s/request_queue/block_device/ in the above comment.

> diff --git a/include/linux/blk-crypto.h b/include/linux/blk-crypto.h
> index 69b24fe92cbf1..b314e2febcaf5 100644
> --- a/include/linux/blk-crypto.h
> +++ b/include/linux/blk-crypto.h
[...]
>
> struct request;
> struct request_queue;

These forward declarations are no longer needed and can be removed.

- Eric



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux