]> git.karo-electronics.de Git - linux-beck.git/commitdiff
scsi: allow LLDDs to expose the queue mapping to blk-mq
authorChristoph Hellwig <hch@lst.de>
Tue, 1 Nov 2016 14:12:48 +0000 (08:12 -0600)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 8 Nov 2016 22:30:00 +0000 (17:30 -0500)
Just hand through the blk-mq map_queues method in the host template.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_lib.c
include/scsi/scsi_host.h

index 2cca9cffc63fde351f8ced6687951c0be2f86d6a..f23ec240cab076d20b8c73c5361779df67ee6b5d 100644 (file)
@@ -1990,6 +1990,15 @@ static void scsi_exit_request(void *data, struct request *rq,
        kfree(cmd->sense_buffer);
 }
 
+static int scsi_map_queues(struct blk_mq_tag_set *set)
+{
+       struct Scsi_Host *shost = container_of(set, struct Scsi_Host, tag_set);
+
+       if (shost->hostt->map_queues)
+               return shost->hostt->map_queues(shost);
+       return blk_mq_map_queues(set);
+}
+
 static u64 scsi_calculate_bounce_limit(struct Scsi_Host *shost)
 {
        struct device *host_dev;
@@ -2082,6 +2091,7 @@ static struct blk_mq_ops scsi_mq_ops = {
        .timeout        = scsi_timeout,
        .init_request   = scsi_init_request,
        .exit_request   = scsi_exit_request,
+       .map_queues     = scsi_map_queues,
 };
 
 struct request_queue *scsi_mq_alloc_queue(struct scsi_device *sdev)
index 7e4cd53139ed518a89795ea360bf30cce0ce1377..36680f13270d7c02eea5fc2028f4f37df9808f1f 100644 (file)
@@ -277,6 +277,14 @@ struct scsi_host_template {
         */
        int (* change_queue_depth)(struct scsi_device *, int);
 
+       /*
+        * This functions lets the driver expose the queue mapping
+        * to the block layer.
+        *
+        * Status: OPTIONAL
+        */
+       int (* map_queues)(struct Scsi_Host *shost);
+
        /*
         * This function determines the BIOS parameters for a given
         * harddisk.  These tend to be numbers that are made up by