From: Christoph Hellwig <hch@lst.de>
To: axboe@kernel.dk
Cc: linux-block@vger.kernel.org
Subject: [PATCH 1/3] blk-crypto: pass a gendisk to blk_crypto_sysfs_register
Date: Sat, 5 Nov 2022 09:08:13 +0100 [thread overview]
Message-ID: <20221105080815.775721-1-hch@lst.de> (raw)
Prepare for changes to the block layer sysfs handling by passing the
readily available gendisk to blk_crypto_sysfs_register.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/blk-crypto-internal.h | 4 ++--
block/blk-crypto-sysfs.c | 3 ++-
block/blk-sysfs.c | 2 +-
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/block/blk-crypto-internal.h b/block/blk-crypto-internal.h
index e6818ffaddbf8..32990299dace1 100644
--- a/block/blk-crypto-internal.h
+++ b/block/blk-crypto-internal.h
@@ -21,7 +21,7 @@ extern const struct blk_crypto_mode blk_crypto_modes[];
#ifdef CONFIG_BLK_INLINE_ENCRYPTION
-int blk_crypto_sysfs_register(struct request_queue *q);
+int blk_crypto_sysfs_register(struct gendisk *disk);
void blk_crypto_sysfs_unregister(struct request_queue *q);
@@ -67,7 +67,7 @@ static inline bool blk_crypto_rq_is_encrypted(struct request *rq)
#else /* CONFIG_BLK_INLINE_ENCRYPTION */
-static inline int blk_crypto_sysfs_register(struct request_queue *q)
+static inline int blk_crypto_sysfs_register(struct gendisk *disk)
{
return 0;
}
diff --git a/block/blk-crypto-sysfs.c b/block/blk-crypto-sysfs.c
index fd93bd2f33b75..a638a2eecfc89 100644
--- a/block/blk-crypto-sysfs.c
+++ b/block/blk-crypto-sysfs.c
@@ -126,8 +126,9 @@ static struct kobj_type blk_crypto_ktype = {
* If the request_queue has a blk_crypto_profile, create the "crypto"
* subdirectory in sysfs (/sys/block/$disk/queue/crypto/).
*/
-int blk_crypto_sysfs_register(struct request_queue *q)
+int blk_crypto_sysfs_register(struct gendisk *disk)
{
+ struct request_queue *q = disk->queue;
struct blk_crypto_kobj *obj;
int err;
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 02e94c4beff17..440149d0e21b9 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -836,7 +836,7 @@ int blk_register_queue(struct gendisk *disk)
goto put_dev;
}
- ret = blk_crypto_sysfs_register(q);
+ ret = blk_crypto_sysfs_register(disk);
if (ret)
goto put_dev;
--
2.30.2
next reply other threads:[~2022-11-05 8:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-05 8:08 Christoph Hellwig [this message]
2022-11-05 8:08 ` [PATCH 2/3] block: untangle request_queue refcounting from sysfs Christoph Hellwig
2022-11-07 19:57 ` Eric Biggers
2022-11-09 13:01 ` Christoph Hellwig
2022-11-05 8:08 ` [PATCH 3/3] block: mark blk_put_queue as potentially blocking Christoph Hellwig
2022-11-07 19:55 ` [PATCH 1/3] blk-crypto: pass a gendisk to blk_crypto_sysfs_register Eric Biggers
2022-11-09 12:49 ` Christoph Hellwig
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=20221105080815.775721-1-hch@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
/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