]> www.infradead.org Git - users/hch/block.git/commitdiff
blk-crypto: pass a gendisk to blk_crypto_sysfs_register
authorChristoph Hellwig <hch@lst.de>
Sat, 21 May 2022 09:08:58 +0000 (11:08 +0200)
committerChristoph Hellwig <hch@lst.de>
Sat, 18 Jun 2022 14:28:42 +0000 (16:28 +0200)
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
block/blk-crypto-sysfs.c
block/blk-sysfs.c

index e6818ffaddbf8e36b0a0df1977b94767fc12b696..32990299dace1779efb08584469416e60a95e3a9 100644 (file)
@@ -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;
 }
index fd93bd2f33b7580f596d5b00f9006dfb2bead608..a638a2eecfc89d7bb0469f367f6f174644eb571e 100644 (file)
@@ -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;
 
index 0415722a4625f9aa6560ab9516bf9edb420d9936..b7fe2007026140eeee7e1733b212c9f49d41f3b3 100644 (file)
@@ -835,7 +835,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;