diff options
author | Christoph Hellwig <hch@lst.de> | 2014-11-03 14:15:14 -0500 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-11-12 05:19:43 -0500 |
commit | c8b09f6fb67df7fc1b51ced1037fa9b677428149 (patch) | |
tree | 87527c3e17a7539c0ffa9f64fbd85ec2ad3dabf1 /drivers/target/loopback/tcm_loop.c | |
parent | 2ecb204d07ac8debe3893c362415919bc78bebd6 (diff) |
scsi: don't set tagging state from scsi_adjust_queue_depth
Remove the tagged argument from scsi_adjust_queue_depth, and just let it
handle the queue depth. For most drivers those two are fairly separate,
given that most modern drivers don't care about the SCSI "tagged" status
of a command at all, and many old drivers allow queuing of multiple
untagged commands in the driver.
Instead we start out with the ->simple_tags flag set before calling
->slave_configure, which is how all drivers actually looking at
->simple_tags except for one worke anyway. The one other case looks
broken, but I've kept the behavior as-is for now.
Except for that we only change ->simple_tags from the ->change_queue_type,
and when rejecting a tag message in a single driver, so keeping this
churn out of scsi_adjust_queue_depth is a clear win.
Now that the usage of scsi_adjust_queue_depth is more obvious we can
also remove all the trivial instances in ->slave_alloc or ->slave_configure
that just set it to the cmd_per_lun default.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/target/loopback/tcm_loop.c')
-rw-r--r-- | drivers/target/loopback/tcm_loop.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index 120a851df0d7..0ed96644ec94 100644 --- a/drivers/target/loopback/tcm_loop.c +++ b/drivers/target/loopback/tcm_loop.c | |||
@@ -121,13 +121,13 @@ static int tcm_loop_change_queue_depth( | |||
121 | { | 121 | { |
122 | switch (reason) { | 122 | switch (reason) { |
123 | case SCSI_QDEPTH_DEFAULT: | 123 | case SCSI_QDEPTH_DEFAULT: |
124 | scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), depth); | 124 | scsi_adjust_queue_depth(sdev, depth); |
125 | break; | 125 | break; |
126 | case SCSI_QDEPTH_QFULL: | 126 | case SCSI_QDEPTH_QFULL: |
127 | scsi_track_queue_full(sdev, depth); | 127 | scsi_track_queue_full(sdev, depth); |
128 | break; | 128 | break; |
129 | case SCSI_QDEPTH_RAMP_UP: | 129 | case SCSI_QDEPTH_RAMP_UP: |
130 | scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), depth); | 130 | scsi_adjust_queue_depth(sdev, depth); |
131 | break; | 131 | break; |
132 | default: | 132 | default: |
133 | return -EOPNOTSUPP; | 133 | return -EOPNOTSUPP; |
@@ -404,19 +404,6 @@ static int tcm_loop_slave_alloc(struct scsi_device *sd) | |||
404 | return 0; | 404 | return 0; |
405 | } | 405 | } |
406 | 406 | ||
407 | static int tcm_loop_slave_configure(struct scsi_device *sd) | ||
408 | { | ||
409 | if (sd->tagged_supported) { | ||
410 | scsi_adjust_queue_depth(sd, MSG_SIMPLE_TAG, | ||
411 | sd->host->cmd_per_lun); | ||
412 | } else { | ||
413 | scsi_adjust_queue_depth(sd, 0, | ||
414 | sd->host->cmd_per_lun); | ||
415 | } | ||
416 | |||
417 | return 0; | ||
418 | } | ||
419 | |||
420 | static struct scsi_host_template tcm_loop_driver_template = { | 407 | static struct scsi_host_template tcm_loop_driver_template = { |
421 | .show_info = tcm_loop_show_info, | 408 | .show_info = tcm_loop_show_info, |
422 | .proc_name = "tcm_loopback", | 409 | .proc_name = "tcm_loopback", |
@@ -434,7 +421,6 @@ static struct scsi_host_template tcm_loop_driver_template = { | |||
434 | .max_sectors = 0xFFFF, | 421 | .max_sectors = 0xFFFF, |
435 | .use_clustering = DISABLE_CLUSTERING, | 422 | .use_clustering = DISABLE_CLUSTERING, |
436 | .slave_alloc = tcm_loop_slave_alloc, | 423 | .slave_alloc = tcm_loop_slave_alloc, |
437 | .slave_configure = tcm_loop_slave_configure, | ||
438 | .module = THIS_MODULE, | 424 | .module = THIS_MODULE, |
439 | .use_blk_tags = 1, | 425 | .use_blk_tags = 1, |
440 | }; | 426 | }; |