diff options
author | Christoph Hellwig <hch@lst.de> | 2014-10-02 08:39:55 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-11-12 05:19:39 -0500 |
commit | a62182f338b39a22035531c6afc0a8d2928b1df2 (patch) | |
tree | 57ca6cea82a09d2655daf5c161024c5015373646 /drivers/target/loopback | |
parent | 1d5203284d8acbdfdf9b478d434450b34f338f28 (diff) |
scsi: provide a generic change_queue_type method
Most drivers use exactly the same implementation, so provide it as a
library function.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Diffstat (limited to 'drivers/target/loopback')
-rw-r--r-- | drivers/target/loopback/tcm_loop.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index ab3ab27d49b7..3b9c76835b45 100644 --- a/drivers/target/loopback/tcm_loop.c +++ b/drivers/target/loopback/tcm_loop.c | |||
@@ -135,21 +135,6 @@ static int tcm_loop_change_queue_depth( | |||
135 | return sdev->queue_depth; | 135 | return sdev->queue_depth; |
136 | } | 136 | } |
137 | 137 | ||
138 | static int tcm_loop_change_queue_type(struct scsi_device *sdev, int tag) | ||
139 | { | ||
140 | if (sdev->tagged_supported) { | ||
141 | scsi_set_tag_type(sdev, tag); | ||
142 | |||
143 | if (tag) | ||
144 | scsi_activate_tcq(sdev, sdev->queue_depth); | ||
145 | else | ||
146 | scsi_deactivate_tcq(sdev, sdev->queue_depth); | ||
147 | } else | ||
148 | tag = 0; | ||
149 | |||
150 | return tag; | ||
151 | } | ||
152 | |||
153 | /* | 138 | /* |
154 | * Locate the SAM Task Attr from struct scsi_cmnd * | 139 | * Locate the SAM Task Attr from struct scsi_cmnd * |
155 | */ | 140 | */ |
@@ -451,7 +436,7 @@ static struct scsi_host_template tcm_loop_driver_template = { | |||
451 | .name = "TCM_Loopback", | 436 | .name = "TCM_Loopback", |
452 | .queuecommand = tcm_loop_queuecommand, | 437 | .queuecommand = tcm_loop_queuecommand, |
453 | .change_queue_depth = tcm_loop_change_queue_depth, | 438 | .change_queue_depth = tcm_loop_change_queue_depth, |
454 | .change_queue_type = tcm_loop_change_queue_type, | 439 | .change_queue_type = scsi_change_queue_type, |
455 | .eh_abort_handler = tcm_loop_abort_task, | 440 | .eh_abort_handler = tcm_loop_abort_task, |
456 | .eh_device_reset_handler = tcm_loop_device_reset, | 441 | .eh_device_reset_handler = tcm_loop_device_reset, |
457 | .eh_target_reset_handler = tcm_loop_target_reset, | 442 | .eh_target_reset_handler = tcm_loop_target_reset, |