]> www.infradead.org Git - users/hch/block.git/commitdiff
scsi: remove an extra queue reference
authorChristoph Hellwig <hch@lst.de>
Mon, 17 Oct 2022 04:59:53 +0000 (06:59 +0200)
committerChristoph Hellwig <hch@lst.de>
Mon, 17 Oct 2022 04:59:53 +0000 (06:59 +0200)
Now that blk_mq_destroy_queue does not release the queue reference, there
is no need for a second queue reference to be held by the scsi_device.

Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/scsi_scan.c
drivers/scsi/scsi_sysfs.c

index 5d27f5196de6fd49537ba29d9d3814207380e0ea..0a95fa787fdf4838debff07d09bd06998dc62ae8 100644 (file)
@@ -344,7 +344,6 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
        sdev->request_queue = q;
        q->queuedata = sdev;
        __scsi_init_queue(sdev->host, q);
-       WARN_ON_ONCE(!blk_get_queue(q));
 
        depth = sdev->host->cmd_per_lun ?: 1;
 
index 1214c6f07bc64fddcd7af0cbfa1d02540f0d7364..c95177ca6ed2645e9720d76e6f3c2764a459e5b9 100644 (file)
@@ -1478,7 +1478,6 @@ void __scsi_remove_device(struct scsi_device *sdev)
        mutex_unlock(&sdev->state_mutex);
 
        blk_mq_destroy_queue(sdev->request_queue);
-       blk_put_queue(sdev->request_queue);
        kref_put(&sdev->host->tagset_refcnt, scsi_mq_free_tags);
        cancel_work_sync(&sdev->requeue_work);