aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ibmvscsi
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2014-10-02 08:39:55 -0400
committerChristoph Hellwig <hch@lst.de>2014-11-12 05:19:39 -0500
commita62182f338b39a22035531c6afc0a8d2928b1df2 (patch)
tree57ca6cea82a09d2655daf5c161024c5015373646 /drivers/scsi/ibmvscsi
parent1d5203284d8acbdfdf9b478d434450b34f338f28 (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/scsi/ibmvscsi')
-rw-r--r--drivers/scsi/ibmvscsi/ibmvfc.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index 598c42cba5a8..48d19a3256ce 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -2929,29 +2929,6 @@ static int ibmvfc_change_queue_depth(struct scsi_device *sdev, int qdepth,
2929 return sdev->queue_depth; 2929 return sdev->queue_depth;
2930} 2930}
2931 2931
2932/**
2933 * ibmvfc_change_queue_type - Change the device's queue type
2934 * @sdev: scsi device struct
2935 * @tag_type: type of tags to use
2936 *
2937 * Return value:
2938 * actual queue type set
2939 **/
2940static int ibmvfc_change_queue_type(struct scsi_device *sdev, int tag_type)
2941{
2942 if (sdev->tagged_supported) {
2943 scsi_set_tag_type(sdev, tag_type);
2944
2945 if (tag_type)
2946 scsi_activate_tcq(sdev, sdev->queue_depth);
2947 else
2948 scsi_deactivate_tcq(sdev, sdev->queue_depth);
2949 } else
2950 tag_type = 0;
2951
2952 return tag_type;
2953}
2954
2955static ssize_t ibmvfc_show_host_partition_name(struct device *dev, 2932static ssize_t ibmvfc_show_host_partition_name(struct device *dev,
2956 struct device_attribute *attr, char *buf) 2933 struct device_attribute *attr, char *buf)
2957{ 2934{
@@ -3133,7 +3110,7 @@ static struct scsi_host_template driver_template = {
3133 .target_alloc = ibmvfc_target_alloc, 3110 .target_alloc = ibmvfc_target_alloc,
3134 .scan_finished = ibmvfc_scan_finished, 3111 .scan_finished = ibmvfc_scan_finished,
3135 .change_queue_depth = ibmvfc_change_queue_depth, 3112 .change_queue_depth = ibmvfc_change_queue_depth,
3136 .change_queue_type = ibmvfc_change_queue_type, 3113 .change_queue_type = scsi_change_queue_type,
3137 .cmd_per_lun = 16, 3114 .cmd_per_lun = 16,
3138 .can_queue = IBMVFC_MAX_REQUESTS_DEFAULT, 3115 .can_queue = IBMVFC_MAX_REQUESTS_DEFAULT,
3139 .this_id = -1, 3116 .this_id = -1,