Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[sfrench/cifs-2.6.git] / drivers / scsi / storvsc_drv.c
index b89269120a2dd3028bee98d06e617d5666c6dee5..c2b6a0ca693335b8c7a2cc38356073ead148917d 100644 (file)
@@ -375,6 +375,7 @@ enum storvsc_request_type {
 
 static int storvsc_ringbuffer_size = (128 * 1024);
 static u32 max_outstanding_req_per_channel;
+static int storvsc_change_queue_depth(struct scsi_device *sdev, int queue_depth);
 
 static int storvsc_vcpus_per_sub_channel = 4;
 
@@ -1699,6 +1700,7 @@ static struct scsi_host_template scsi_driver = {
        .dma_boundary =         PAGE_SIZE-1,
        .no_write_same =        1,
        .track_queue_depth =    1,
+       .change_queue_depth =   storvsc_change_queue_depth,
 };
 
 enum {
@@ -1905,6 +1907,15 @@ err_out0:
        return ret;
 }
 
+/* Change a scsi target's queue depth */
+static int storvsc_change_queue_depth(struct scsi_device *sdev, int queue_depth)
+{
+       if (queue_depth > scsi_driver.can_queue)
+               queue_depth = scsi_driver.can_queue;
+
+       return scsi_change_queue_depth(sdev, queue_depth);
+}
+
 static int storvsc_remove(struct hv_device *dev)
 {
        struct storvsc_device *stor_device = hv_get_drvdata(dev);