Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db5ed4df authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

scsi: drop reason argument from ->change_queue_depth



Drop the now unused reason argument from the ->change_queue_depth method.
Also add a return value to scsi_adjust_queue_depth, and rename it to
scsi_change_queue_depth now that it can be used as the default
->change_queue_depth implementation.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
parent 1e6f2416
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -149,7 +149,7 @@ scsi_add_host() ---->
scsi_scan_host()  -------+
                         |
                    slave_alloc()
                    slave_configure() -->  scsi_adjust_queue_depth()
                    slave_configure() -->  scsi_change_queue_depth()
                         |
                    slave_alloc()
                    slave_configure()
@@ -159,7 +159,7 @@ scsi_scan_host() -------+
------------------------------------------------------------

If the LLD wants to adjust the default queue settings, it can invoke
scsi_adjust_queue_depth() in its slave_configure() routine.
scsi_change_queue_depth() in its slave_configure() routine.

*** For scsi devices that the mid level tries to scan but do not
    respond, a slave_alloc(), slave_destroy() pair is called.
@@ -203,7 +203,7 @@ LLD mid level LLD
scsi_add_device()  ------+
                         |
                    slave_alloc()
                    slave_configure()   [--> scsi_adjust_queue_depth()]
                    slave_configure()   [--> scsi_change_queue_depth()]
------------------------------------------------------------

In a similar fashion, an LLD may become aware that a SCSI device has been
@@ -261,7 +261,7 @@ init_this_scsi_driver() ----+
                            |                scsi_register()
                            |
                      slave_alloc()
                      slave_configure()  -->  scsi_adjust_queue_depth()
                      slave_configure()  -->  scsi_change_queue_depth()
                      slave_alloc()   ***
                      slave_destroy() ***
                            |
@@ -271,7 +271,7 @@ init_this_scsi_driver() ----+
                      slave_destroy() ***
------------------------------------------------------------

The mid level invokes scsi_adjust_queue_depth() with "cmd_per_lun" for that
The mid level invokes scsi_change_queue_depth() with "cmd_per_lun" for that
host as the queue length. These settings can be overridden by a
slave_configure() supplied by the LLD.

@@ -368,7 +368,7 @@ names all start with "scsi_".
Summary:
   scsi_add_device - creates new scsi device (lu) instance
   scsi_add_host - perform sysfs registration and set up transport class
   scsi_adjust_queue_depth - change the queue depth on a SCSI device
   scsi_change_queue_depth - change the queue depth on a SCSI device
   scsi_bios_ptable - return copy of block device's partition table
   scsi_block_requests - prevent further commands being queued to given host
   scsi_host_alloc - return a new scsi_host instance whose refcount==1
@@ -436,7 +436,7 @@ int scsi_add_host(struct Scsi_Host *shost, struct device * dev)


/**
 * scsi_adjust_queue_depth - allow LLD to change queue depth on a SCSI device
 * scsi_change_queue_depth - allow LLD to change queue depth on a SCSI device
 * @sdev:       pointer to SCSI device to change queue depth on
 * @tags        Number of tags allowed if tagged queuing enabled,
 *              or number of commands the LLD can queue up
@@ -453,7 +453,7 @@ int scsi_add_host(struct Scsi_Host *shost, struct device * dev)
 *      Defined in: drivers/scsi/scsi.c [see source code for more notes]
 *
 **/
void scsi_adjust_queue_depth(struct scsi_device *sdev, int tags)
int scsi_change_queue_depth(struct scsi_device *sdev, int tags)


/**
@@ -1214,7 +1214,7 @@ of interest:
                   for disk firmware uploads.
    cmd_per_lun  - maximum number of commands that can be queued on devices
                   controlled by the host. Overridden by LLD calls to
                   scsi_adjust_queue_depth().
                   scsi_change_queue_depth().
    unchecked_isa_dma - 1=>only use bottom 16 MB of ram (ISA DMA addressing
                   restriction), 0=>can use full 32 bit (or better) DMA
                   address space
@@ -1254,7 +1254,7 @@ struct scsi_cmnd
Instances of this structure convey SCSI commands to the LLD and responses
back to the mid level. The SCSI mid level will ensure that no more SCSI
commands become queued against the LLD than are indicated by
scsi_adjust_queue_depth() (or struct Scsi_Host::cmd_per_lun). There will
scsi_change_queue_depth() (or struct Scsi_Host::cmd_per_lun). There will
be at least one instance of struct scsi_cmnd available for each SCSI device.
Members of interest:
    cmnd         - array containing SCSI command
+5 −12
Original line number Diff line number Diff line
@@ -1164,7 +1164,7 @@ static int ata_scsi_dev_config(struct scsi_device *sdev,

		depth = min(sdev->host->can_queue, ata_id_queue_depth(dev->id));
		depth = min(ATA_MAX_QUEUE - 1, depth);
		scsi_adjust_queue_depth(sdev, depth);
		scsi_change_queue_depth(sdev, depth);
	}

	blk_queue_flush_queueable(q, false);
@@ -1243,21 +1243,17 @@ void ata_scsi_slave_destroy(struct scsi_device *sdev)
 *	@ap: ATA port to which the device change the queue depth
 *	@sdev: SCSI device to configure queue depth for
 *	@queue_depth: new queue depth
 *	@reason: calling context
 *
 *	libsas and libata have different approaches for associating a sdev to
 *	its ata_port.
 *
 */
int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev,
			     int queue_depth, int reason)
			     int queue_depth)
{
	struct ata_device *dev;
	unsigned long flags;

	if (reason != SCSI_QDEPTH_DEFAULT)
		return -EOPNOTSUPP;

	if (queue_depth < 1 || queue_depth == sdev->queue_depth)
		return sdev->queue_depth;

@@ -1282,15 +1278,13 @@ int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev,
	if (sdev->queue_depth == queue_depth)
		return -EINVAL;

	scsi_adjust_queue_depth(sdev, queue_depth);
	return queue_depth;
	return scsi_change_queue_depth(sdev, queue_depth);
}

/**
 *	ata_scsi_change_queue_depth - SCSI callback for queue depth config
 *	@sdev: SCSI device to configure queue depth for
 *	@queue_depth: new queue depth
 *	@reason: calling context
 *
 *	This is libata standard hostt->change_queue_depth callback.
 *	SCSI will call into this callback when user tries to set queue
@@ -1302,12 +1296,11 @@ int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev,
 *	RETURNS:
 *	Newly configured queue depth.
 */
int ata_scsi_change_queue_depth(struct scsi_device *sdev, int queue_depth,
				int reason)
int ata_scsi_change_queue_depth(struct scsi_device *sdev, int queue_depth)
{
	struct ata_port *ap = ata_shost_to_port(sdev->host);

	return __ata_change_queue_depth(ap, sdev, queue_depth, reason);
	return __ata_change_queue_depth(ap, sdev, queue_depth);
}

/**
+1 −1
Original line number Diff line number Diff line
@@ -1951,7 +1951,7 @@ static int nv_swncq_slave_config(struct scsi_device *sdev)
	ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num));

	if (strncmp(model_num, "Maxtor", 6) == 0) {
		ata_scsi_change_queue_depth(sdev, 1, SCSI_QDEPTH_DEFAULT);
		ata_scsi_change_queue_depth(sdev, 1);
		ata_dev_notice(dev, "Disabling SWNCQ mode (depth %x)\n",
			       sdev->queue_depth);
	}
+1 −1
Original line number Diff line number Diff line
@@ -911,7 +911,7 @@ static struct scsi_host_template iscsi_iser_sht = {
	.module                 = THIS_MODULE,
	.name                   = "iSCSI Initiator over iSER",
	.queuecommand           = iscsi_queuecommand,
	.change_queue_depth	= iscsi_change_queue_depth,
	.change_queue_depth	= scsi_change_queue_depth,
	.sg_tablesize           = ISCSI_ISER_SG_TABLESIZE,
	.max_sectors		= 1024,
	.cmd_per_lun            = ISER_DEF_CMD_PER_LUN,
+2 −5
Original line number Diff line number Diff line
@@ -2402,18 +2402,15 @@ static int srp_cm_handler(struct ib_cm_id *cm_id, struct ib_cm_event *event)
 * srp_change_queue_depth - setting device queue depth
 * @sdev: scsi device struct
 * @qdepth: requested queue depth
 * @reason: SCSI_QDEPTH_DEFAULT
 * (see include/scsi/scsi_host.h for definition)
 *
 * Returns queue depth.
 */
static int
srp_change_queue_depth(struct scsi_device *sdev, int qdepth, int reason)
srp_change_queue_depth(struct scsi_device *sdev, int qdepth)
{
	if (!sdev->tagged_supported)
		qdepth = 1;
	scsi_adjust_queue_depth(sdev, qdepth);
	return sdev->queue_depth;
	return scsi_change_queue_depth(sdev, qdepth);
}

static int srp_send_tsk_mgmt(struct srp_rdma_ch *ch, u64 req_tag,
Loading