All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@kernel.dk>, "Theodore Y. Ts'o" <tytso@mit.edu>,
	Mike Snitzer <snitzer@kernel.org>,
	linux-fscrypt@vger.kernel.org, linux-block@vger.kernel.org,
	dm-devel@redhat.com, Jaegeuk Kim <jaegeuk@kernel.org>
Subject: Re: [dm-devel] [PATCH 1/3] blk-crypto: don't use struct request_queue for public interfaces
Date: Mon, 7 Nov 2022 12:16:22 -0800	[thread overview]
Message-ID: <Y2lnloNN5wovDBMF@sol.localdomain> (raw)
In-Reply-To: <20221107144229.1547370-2-hch@lst.de>

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

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


WARNING: multiple messages have this Message-ID (diff)
From: Eric Biggers <ebiggers@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@kernel.dk>, Mike Snitzer <snitzer@kernel.org>,
	"Theodore Y. Ts'o" <tytso@mit.edu>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	dm-devel@redhat.com, linux-block@vger.kernel.org,
	linux-fscrypt@vger.kernel.org
Subject: Re: [PATCH 1/3] blk-crypto: don't use struct request_queue for public interfaces
Date: Mon, 7 Nov 2022 12:16:22 -0800	[thread overview]
Message-ID: <Y2lnloNN5wovDBMF@sol.localdomain> (raw)
In-Reply-To: <20221107144229.1547370-2-hch@lst.de>

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

  reply	other threads:[~2022-11-07 20:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-07 14:42 [dm-devel] pass a struct block_device to the blk-crypto interfaces v2 Christoph Hellwig
2022-11-07 14:42 ` Christoph Hellwig
2022-11-07 14:42 ` [dm-devel] [PATCH 1/3] blk-crypto: don't use struct request_queue for public interfaces Christoph Hellwig
2022-11-07 14:42   ` Christoph Hellwig
2022-11-07 20:16   ` Eric Biggers [this message]
2022-11-07 20:16     ` Eric Biggers
2022-11-09 13:14     ` [dm-devel] " Christoph Hellwig
2022-11-09 13:14       ` Christoph Hellwig
2022-11-07 14:42 ` [dm-devel] [PATCH 2/3] blk-crypto: add a blk_crypto_config_supported_natively helper Christoph Hellwig
2022-11-07 14:42   ` Christoph Hellwig
2022-11-07 20:18   ` [dm-devel] " Eric Biggers
2022-11-07 20:18     ` Eric Biggers
2022-11-07 14:42 ` [dm-devel] [PATCH 3/3] blk-crypto: move __blk_crypto_cfg_supported to blk-crypto-internal.h Christoph Hellwig
2022-11-07 14:42   ` Christoph Hellwig
2022-11-07 20:23   ` [dm-devel] " Eric Biggers
2022-11-07 20:23     ` Eric Biggers
  -- strict thread matches above, loose matches on Subject: below --
2022-11-14  4:29 [dm-devel] pass a struct block_device to the blk-crypto interfaces v3 Christoph Hellwig
2022-11-14  4:29 ` [dm-devel] [PATCH 1/3] blk-crypto: don't use struct request_queue for public interfaces Christoph Hellwig
2022-11-16  3:10   ` Eric Biggers

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=Y2lnloNN5wovDBMF@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=dm-devel@redhat.com \
    --cc=hch@lst.de \
    --cc=jaegeuk@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=snitzer@kernel.org \
    --cc=tytso@mit.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.