[PATCH RESEND 3/3] ublk: pass NULL to blk_mq_alloc_disk() as queuedata

Ziyang Zhang posted 3 patches 2 years, 7 months ago
[PATCH RESEND 3/3] ublk: pass NULL to blk_mq_alloc_disk() as queuedata
Posted by Ziyang Zhang 2 years, 7 months ago
queuedata is not referenced in ublk_drv and we can use driver_data
instead. Pass NULL to blk_mq_alloc_disk() as queuedata while allocating
ublk's gendisk.

Signed-off-by: Ziyang Zhang <ZiyangZhang@linux.alibaba.com>
---
 drivers/block/ublk_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
index 06eddefdf02a..d83fe2c2b3ba 100644
--- a/drivers/block/ublk_drv.c
+++ b/drivers/block/ublk_drv.c
@@ -1578,7 +1578,7 @@ static int ublk_ctrl_start_dev(struct ublk_device *ub, struct io_uring_cmd *cmd)
 		goto out_unlock;
 	}
 
-	disk = blk_mq_alloc_disk(&ub->tag_set, ub);
+	disk = blk_mq_alloc_disk(&ub->tag_set, NULL);
 	if (IS_ERR(disk)) {
 		ret = PTR_ERR(disk);
 		goto out_unlock;
-- 
2.18.4
Re: [PATCH RESEND 3/3] ublk: pass NULL to blk_mq_alloc_disk() as queuedata
Posted by Ming Lei 2 years, 7 months ago
On Tue, Feb 07, 2023 at 03:08:39PM +0800, Ziyang Zhang wrote:
> queuedata is not referenced in ublk_drv and we can use driver_data
> instead. Pass NULL to blk_mq_alloc_disk() as queuedata while allocating
> ublk's gendisk.
> 
> Signed-off-by: Ziyang Zhang <ZiyangZhang@linux.alibaba.com>

Reviewed-by: Ming Lei <ming.lei@redhat.com>


Thanks, 
Ming