@@ -3538,10 +3538,11 @@ static struct attribute *host_v2_hw_attrs[] = {
ATTRIBUTE_GROUPS(host_v2_hw);
-static int map_queues_v2_hw(struct Scsi_Host *shost)
+static int map_queues_v2_hw(struct blk_mq_tag_set *set)
{
+ struct Scsi_Host *shost = set->driver_data;
struct hisi_hba *hisi_hba = shost_priv(shost);
- struct blk_mq_queue_map *qmap = &shost->tag_set.map[HCTX_TYPE_DEFAULT];
+ struct blk_mq_queue_map *qmap = &set->map[HCTX_TYPE_DEFAULT];
const struct cpumask *mask;
unsigned int queue, cpu;
@@ -3135,10 +3135,11 @@ static int debugfs_set_bist_v3_hw(struct hisi_hba *hisi_hba, bool enable)
return 0;
}
-static int hisi_sas_map_queues(struct Scsi_Host *shost)
+static int hisi_sas_map_queues(struct blk_mq_tag_set *set)
{
+ struct Scsi_Host *shost = set->driver_data;
struct hisi_hba *hisi_hba = shost_priv(shost);
- struct blk_mq_queue_map *qmap = &shost->tag_set.map[HCTX_TYPE_DEFAULT];
+ struct blk_mq_queue_map *qmap = &set->map[HCTX_TYPE_DEFAULT];
return blk_mq_pci_map_queues(qmap, hisi_hba->pci_dev,
BASE_VECTORS_V3_HW);
@@ -3168,12 +3168,14 @@ megasas_bios_param(struct scsi_device *sdev, struct block_device *bdev,
return 0;
}
-static int megasas_map_queues(struct Scsi_Host *shost)
+static int megasas_map_queues(struct blk_mq_tag_set *set)
{
+ struct Scsi_Host *shost;
struct megasas_instance *instance;
int qoff = 0, offset;
struct blk_mq_queue_map *map;
+ shost = set->driver_data;
instance = (struct megasas_instance *)shost->hostdata;
if (shost->nr_hw_queues == 1)
@@ -3167,8 +3167,9 @@ static int mpi3mr_bios_param(struct scsi_device *sdev,
*
* Return: return zero.
*/
-static int mpi3mr_map_queues(struct Scsi_Host *shost)
+static int mpi3mr_map_queues(struct blk_mq_tag_set *set)
{
+ struct Scsi_Host *shost = set->driver_data;
struct mpi3mr_ioc *mrioc = shost_priv(shost);
int i, qoff, offset;
struct blk_mq_queue_map *map = NULL;
@@ -3205,7 +3206,6 @@ static int mpi3mr_map_queues(struct Scsi_Host *shost)
}
return 0;
-
}
/**
@@ -11868,8 +11868,9 @@ scsih_scan_finished(struct Scsi_Host *shost, unsigned long time)
* scsih_map_queues - map reply queues with request queues
* @shost: SCSI host pointer
*/
-static int scsih_map_queues(struct Scsi_Host *shost)
+static int scsih_map_queues(struct blk_mq_tag_set *set)
{
+ struct Scsi_Host *shost = set->driver_data;
struct MPT3SAS_ADAPTER *ioc =
(struct MPT3SAS_ADAPTER *)shost->hostdata;
struct blk_mq_queue_map *map;
@@ -335,7 +335,7 @@ MODULE_PARM_DESC(ql2xabts_wait_nvme,
static void qla2x00_clear_drv_active(struct qla_hw_data *);
static void qla2x00_free_device(scsi_qla_host_t *);
-static int qla2xxx_map_queues(struct Scsi_Host *shost);
+static int qla2xxx_map_queues(struct blk_mq_tag_set *tag_set);
static void qla2x00_destroy_deferred_work(struct qla_hw_data *);
@@ -7881,11 +7881,12 @@ qla_pci_reset_done(struct pci_dev *pdev)
clear_bit(ABORT_ISP_ACTIVE, &base_vha->dpc_flags);
}
-static int qla2xxx_map_queues(struct Scsi_Host *shost)
+static int qla2xxx_map_queues(struct blk_mq_tag_set *set)
{
int rc;
+ struct Scsi_Host *shost = set->driver_data;
scsi_qla_host_t *vha = (scsi_qla_host_t *)shost->hostdata;
- struct blk_mq_queue_map *qmap = &shost->tag_set.map[HCTX_TYPE_DEFAULT];
+ struct blk_mq_queue_map *qmap = &set->map[HCTX_TYPE_DEFAULT];
if (USER_CTRL_IRQ(vha->hw) || !vha->hw->mqiobase)
rc = blk_mq_map_queues(qmap);
@@ -7272,15 +7272,16 @@ static int resp_not_ready(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)
return check_condition_result;
}
-static int sdebug_map_queues(struct Scsi_Host *shost)
+static int sdebug_map_queues(struct blk_mq_tag_set *set)
{
int i, qoff;
+ struct Scsi_Host *shost = set->driver_data;
if (shost->nr_hw_queues == 1)
return 0;
for (i = 0, qoff = 0; i < HCTX_MAX_TYPES; i++) {
- struct blk_mq_queue_map *map = &shost->tag_set.map[i];
+ struct blk_mq_queue_map *map = &set->map[i];
map->nr_queues = 0;
@@ -1864,10 +1864,10 @@ static int scsi_init_hctx(struct blk_mq_hw_ctx *hctx, void *data,
static int scsi_map_queues(struct blk_mq_tag_set *set)
{
- struct Scsi_Host *shost = container_of(set, struct Scsi_Host, tag_set);
+ struct Scsi_Host *shost = set->driver_data;
if (shost->hostt->map_queues)
- return shost->hostt->map_queues(shost);
+ return shost->hostt->map_queues(set);
return blk_mq_map_queues(&set->map[HCTX_TYPE_DEFAULT]);
}
@@ -6332,11 +6332,12 @@ static int pqi_slave_alloc(struct scsi_device *sdev)
return 0;
}
-static int pqi_map_queues(struct Scsi_Host *shost)
+static int pqi_map_queues(struct blk_mq_tag_set *set)
{
+ struct Scsi_Host *shost = set->driver_data;
struct pqi_ctrl_info *ctrl_info = shost_to_hba(shost);
- return blk_mq_pci_map_queues(&shost->tag_set.map[HCTX_TYPE_DEFAULT],
+ return blk_mq_pci_map_queues(&set->map[HCTX_TYPE_DEFAULT],
ctrl_info->pci_dev, 0);
}
@@ -711,10 +711,11 @@ static int virtscsi_abort(struct scsi_cmnd *sc)
return virtscsi_tmf(vscsi, cmd);
}
-static int virtscsi_map_queues(struct Scsi_Host *shost)
+static int virtscsi_map_queues(struct blk_mq_tag_set *set)
{
+ struct Scsi_Host *shost = set->driver_data;
struct virtio_scsi *vscsi = shost_priv(shost);
- struct blk_mq_queue_map *qmap = &shost->tag_set.map[HCTX_TYPE_DEFAULT];
+ struct blk_mq_queue_map *qmap = &set->map[HCTX_TYPE_DEFAULT];
return blk_mq_virtio_map_queues(qmap, vscsi->vdev, 2);
}
@@ -277,7 +277,7 @@ struct scsi_host_template {
*
* Status: OPTIONAL
*/
- int (* map_queues)(struct Scsi_Host *shost);
+ int (* map_queues)(struct blk_mq_tag_set *set);
/*
* SCSI interface of blk_poll - poll for IO completions.
Change the scsi_host_template->map_queues() to accept a blk_mq_tag_set instead of a Scsi_Host as a function parameter. A future commit will introduce the concept of device tag sets. Thus map_queues() cannot assume that the target blk_mq_tag_set is accessible through Scsi_Host->tag_set. Generalize map_queues() by changing its input to a blk_mq_tag_set. This commit makes no functional change, as the Scsi_Host->tag_set is passed as the argument to the LLD map_queues function. Signed-off-by: Melanie Plageman <melanieplageman@gmail.com> --- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 5 +++-- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 5 +++-- drivers/scsi/megaraid/megaraid_sas_base.c | 4 +++- drivers/scsi/mpi3mr/mpi3mr_os.c | 4 ++-- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 3 ++- drivers/scsi/qla2xxx/qla_os.c | 7 ++++--- drivers/scsi/scsi_debug.c | 5 +++-- drivers/scsi/scsi_lib.c | 4 ++-- drivers/scsi/smartpqi/smartpqi_init.c | 5 +++-- drivers/scsi/virtio_scsi.c | 5 +++-- include/scsi/scsi_host.h | 2 +- 11 files changed, 29 insertions(+), 20 deletions(-)