Skip to content

Commit e7c09df

Browse files
johnpgarrymartinkpetersen
authored andcommitted
scsi: core: Pass sdev to blk_mq_alloc_queue()
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Tested-by: Himanshu Madhani <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 1613e60 commit e7c09df

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/scsi/scsi_scan.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
334334
sdev->sg_reserved_size = INT_MAX;
335335

336336
scsi_init_limits(shost, &lim);
337-
q = blk_mq_alloc_queue(&sdev->host->tag_set, &lim, NULL);
337+
q = blk_mq_alloc_queue(&sdev->host->tag_set, &lim, sdev);
338338
if (IS_ERR(q)) {
339339
/* release fn is set up in scsi_sysfs_device_initialise, so
340340
* have to free and put manually here */
@@ -344,7 +344,6 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
344344
}
345345
kref_get(&sdev->host->tagset_refcnt);
346346
sdev->request_queue = q;
347-
q->queuedata = sdev;
348347

349348
depth = sdev->host->cmd_per_lun ?: 1;
350349

0 commit comments

Comments
 (0)