]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
scsi: core: Pass sdev to blk_mq_alloc_queue()
authorJohn Garry <john.g.garry@oracle.com>
Fri, 24 May 2024 08:48:28 +0000 (08:48 +0000)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 31 May 2024 00:22:14 +0000 (20:22 -0400)
When calling scsi_alloc_sdev() -> blk_mq_alloc_queue(), we don't pass
the sdev as the queuedata, but rather manually set it afterwards. Just
pass to blk_mq_alloc_queue() to have automatically set.

Signed-off-by: John Garry <john.g.garry@oracle.com>
Link: https://lore.kernel.org/r/20240524084829.2132555-2-john.g.garry@oracle.com
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Tested-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_scan.c

index 8300fc28cb10a8a182f20c016f90506f92aa8bf6..c0b72199b4faac2bd1ed97533ab8f340a2326bf6 100644 (file)
@@ -334,7 +334,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
        sdev->sg_reserved_size = INT_MAX;
 
        scsi_init_limits(shost, &lim);
-       q = blk_mq_alloc_queue(&sdev->host->tag_set, &lim, NULL);
+       q = blk_mq_alloc_queue(&sdev->host->tag_set, &lim, sdev);
        if (IS_ERR(q)) {
                /* release fn is set up in scsi_sysfs_device_initialise, so
                 * have to free and put manually here */
@@ -344,7 +344,6 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
        }
        kref_get(&sdev->host->tagset_refcnt);
        sdev->request_queue = q;
-       q->queuedata = sdev;
 
        depth = sdev->host->cmd_per_lun ?: 1;