Commit 9ca2dc2f authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Martin K. Petersen

scsi: pmcraid: Switch to using ->device_configure

Switch to the ->device_configure method instead of ->slave_configure and
update the block limits on the passed in queue_limits instead of using the
per-limit accessors.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20240409143748.980206-17-hch@lst.deReviewed-by: default avatarDamien Le Moal <dlemoal@kernel.org>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent c8bc8392
...@@ -197,8 +197,9 @@ static int pmcraid_slave_alloc(struct scsi_device *scsi_dev) ...@@ -197,8 +197,9 @@ static int pmcraid_slave_alloc(struct scsi_device *scsi_dev)
} }
/** /**
* pmcraid_slave_configure - Configures a SCSI device * pmcraid_device_configure - Configures a SCSI device
* @scsi_dev: scsi device struct * @scsi_dev: scsi device struct
* @lim: queue limits
* *
* This function is executed by SCSI mid layer just after a device is first * This function is executed by SCSI mid layer just after a device is first
* scanned (i.e. it has responded to an INQUIRY). For VSET resources, the * scanned (i.e. it has responded to an INQUIRY). For VSET resources, the
...@@ -209,7 +210,8 @@ static int pmcraid_slave_alloc(struct scsi_device *scsi_dev) ...@@ -209,7 +210,8 @@ static int pmcraid_slave_alloc(struct scsi_device *scsi_dev)
* Return value: * Return value:
* 0 on success * 0 on success
*/ */
static int pmcraid_slave_configure(struct scsi_device *scsi_dev) static int pmcraid_device_configure(struct scsi_device *scsi_dev,
struct queue_limits *lim)
{ {
struct pmcraid_resource_entry *res = scsi_dev->hostdata; struct pmcraid_resource_entry *res = scsi_dev->hostdata;
...@@ -233,8 +235,7 @@ static int pmcraid_slave_configure(struct scsi_device *scsi_dev) ...@@ -233,8 +235,7 @@ static int pmcraid_slave_configure(struct scsi_device *scsi_dev)
scsi_dev->allow_restart = 1; scsi_dev->allow_restart = 1;
blk_queue_rq_timeout(scsi_dev->request_queue, blk_queue_rq_timeout(scsi_dev->request_queue,
PMCRAID_VSET_IO_TIMEOUT); PMCRAID_VSET_IO_TIMEOUT);
blk_queue_max_hw_sectors(scsi_dev->request_queue, lim->max_hw_sectors = PMCRAID_VSET_MAX_SECTORS;
PMCRAID_VSET_MAX_SECTORS);
} }
/* /*
...@@ -3668,7 +3669,7 @@ static const struct scsi_host_template pmcraid_host_template = { ...@@ -3668,7 +3669,7 @@ static const struct scsi_host_template pmcraid_host_template = {
.eh_host_reset_handler = pmcraid_eh_host_reset_handler, .eh_host_reset_handler = pmcraid_eh_host_reset_handler,
.slave_alloc = pmcraid_slave_alloc, .slave_alloc = pmcraid_slave_alloc,
.slave_configure = pmcraid_slave_configure, .device_configure = pmcraid_device_configure,
.slave_destroy = pmcraid_slave_destroy, .slave_destroy = pmcraid_slave_destroy,
.change_queue_depth = pmcraid_change_queue_depth, .change_queue_depth = pmcraid_change_queue_depth,
.can_queue = PMCRAID_MAX_IO_CMD, .can_queue = PMCRAID_MAX_IO_CMD,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment