public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] blk-crypto: pass a gendisk to blk_crypto_sysfs_register
@ 2022-11-05  8:08 Christoph Hellwig
  2022-11-05  8:08 ` [PATCH 2/3] block: untangle request_queue refcounting from sysfs Christoph Hellwig
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Christoph Hellwig @ 2022-11-05  8:08 UTC (permalink / raw)
  To: axboe; +Cc: linux-block

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


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

end of thread, other threads:[~2022-11-09 13:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-05  8:08 [PATCH 1/3] blk-crypto: pass a gendisk to blk_crypto_sysfs_register Christoph Hellwig
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox