[SCSI] modify change_queue_depth to take in reason why it is being called
[deliverable/linux.git] / drivers / scsi / mpt2sas / mpt2sas_scsih.c
index 8dc682f00fd26c005476845d140c87f52a1ce384..55ee014a7e0855d3ad7a8683d1ccd0b0374b08c1 100644 (file)
@@ -1099,11 +1099,12 @@ _scsih_build_scatter_gather(struct MPT2SAS_ADAPTER *ioc,
  * _scsih_change_queue_depth - setting device queue depth
  * @sdev: scsi device struct
  * @qdepth: requested queue depth
+ * @reason: calling context
  *
  * Returns queue depth.
  */
 static int
-_scsih_change_queue_depth(struct scsi_device *sdev, int qdepth)
+_scsih_change_queue_depth(struct scsi_device *sdev, int qdepth, int reason)
 {
        struct Scsi_Host *shost = sdev->host;
        int max_depth;
@@ -1114,6 +1115,9 @@ _scsih_change_queue_depth(struct scsi_device *sdev, int qdepth)
        struct _sas_device *sas_device;
        unsigned long flags;
 
+       if (reason != SCSI_QDEPTH_DEFAULT)
+               return -EOPNOTSUPP;
+
        max_depth = shost->can_queue;
 
        /* limit max device queue for SATA to 32 */
@@ -1569,7 +1573,7 @@ _scsih_slave_configure(struct scsi_device *sdev)
                    r_level, raid_device->handle,
                    (unsigned long long)raid_device->wwid,
                    raid_device->num_pds, ds);
-               _scsih_change_queue_depth(sdev, qdepth);
+               _scsih_change_queue_depth(sdev, qdepth, SCSI_QDEPTH_DEFAULT);
                return 0;
        }
 
@@ -1615,7 +1619,7 @@ _scsih_slave_configure(struct scsi_device *sdev)
                        _scsih_display_sata_capabilities(ioc, sas_device, sdev);
        }
 
-       _scsih_change_queue_depth(sdev, qdepth);
+       _scsih_change_queue_depth(sdev, qdepth, SCSI_QDEPTH_DEFAULT);
 
        if (ssp_target)
                sas_read_port_mode_page(sdev);
This page took 0.027377 seconds and 5 git commands to generate.