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>
This commit is contained in:
Christoph Hellwig
2014-10-02 14:39:55 +02:00
parent 1d5203284d
commit a62182f338
19 changed files with 42 additions and 228 deletions

View File

@@ -2195,26 +2195,6 @@ int fc_change_queue_depth(struct scsi_device *sdev, int qdepth, int reason)
}
EXPORT_SYMBOL(fc_change_queue_depth);
/**
* fc_change_queue_type() - Change a device's queue type
* @sdev: The SCSI device whose queue depth is to change
* @tag_type: Identifier for queue type
*/
int fc_change_queue_type(struct scsi_device *sdev, int tag_type)
{
if (sdev->tagged_supported) {
scsi_set_tag_type(sdev, tag_type);
if (tag_type)
scsi_activate_tcq(sdev, sdev->queue_depth);
else
scsi_deactivate_tcq(sdev, sdev->queue_depth);
} else
tag_type = 0;
return tag_type;
}
EXPORT_SYMBOL(fc_change_queue_type);
/**
* fc_fcp_destory() - Tear down the FCP layer for a given local port
* @lport: The local port that no longer needs the FCP layer