diff options
author | Christoph Hellwig <hch@lst.de> | 2014-11-13 09:08:42 -0500 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-11-24 08:45:27 -0500 |
commit | db5ed4dfd5dd0142ec36ff7b335e0ec3b836b3e6 (patch) | |
tree | 6cae824b5c9e5a7fd9d213e3f9c2b1c7dc8b7b8a /drivers/ata | |
parent | 1e6f2416044c062a56091ebf8d76760956dd5872 (diff) |
scsi: drop reason argument from ->change_queue_depth
Drop the now unused reason argument from the ->change_queue_depth method.
Also add a return value to scsi_adjust_queue_depth, and rename it to
scsi_change_queue_depth now that it can be used as the default
->change_queue_depth implementation.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/libata-scsi.c | 17 | ||||
-rw-r--r-- | drivers/ata/sata_nv.c | 2 |
2 files changed, 6 insertions, 13 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index c8bb6abbf12c..de46385dbe71 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -1164,7 +1164,7 @@ static int ata_scsi_dev_config(struct scsi_device *sdev, | |||
1164 | 1164 | ||
1165 | depth = min(sdev->host->can_queue, ata_id_queue_depth(dev->id)); | 1165 | depth = min(sdev->host->can_queue, ata_id_queue_depth(dev->id)); |
1166 | depth = min(ATA_MAX_QUEUE - 1, depth); | 1166 | depth = min(ATA_MAX_QUEUE - 1, depth); |
1167 | scsi_adjust_queue_depth(sdev, depth); | 1167 | scsi_change_queue_depth(sdev, depth); |
1168 | } | 1168 | } |
1169 | 1169 | ||
1170 | blk_queue_flush_queueable(q, false); | 1170 | blk_queue_flush_queueable(q, false); |
@@ -1243,21 +1243,17 @@ void ata_scsi_slave_destroy(struct scsi_device *sdev) | |||
1243 | * @ap: ATA port to which the device change the queue depth | 1243 | * @ap: ATA port to which the device change the queue depth |
1244 | * @sdev: SCSI device to configure queue depth for | 1244 | * @sdev: SCSI device to configure queue depth for |
1245 | * @queue_depth: new queue depth | 1245 | * @queue_depth: new queue depth |
1246 | * @reason: calling context | ||
1247 | * | 1246 | * |
1248 | * libsas and libata have different approaches for associating a sdev to | 1247 | * libsas and libata have different approaches for associating a sdev to |
1249 | * its ata_port. | 1248 | * its ata_port. |
1250 | * | 1249 | * |
1251 | */ | 1250 | */ |
1252 | int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev, | 1251 | int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev, |
1253 | int queue_depth, int reason) | 1252 | int queue_depth) |
1254 | { | 1253 | { |
1255 | struct ata_device *dev; | 1254 | struct ata_device *dev; |
1256 | unsigned long flags; | 1255 | unsigned long flags; |
1257 | 1256 | ||
1258 | if (reason != SCSI_QDEPTH_DEFAULT) | ||
1259 | return -EOPNOTSUPP; | ||
1260 | |||
1261 | if (queue_depth < 1 || queue_depth == sdev->queue_depth) | 1257 | if (queue_depth < 1 || queue_depth == sdev->queue_depth) |
1262 | return sdev->queue_depth; | 1258 | return sdev->queue_depth; |
1263 | 1259 | ||
@@ -1282,15 +1278,13 @@ int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev, | |||
1282 | if (sdev->queue_depth == queue_depth) | 1278 | if (sdev->queue_depth == queue_depth) |
1283 | return -EINVAL; | 1279 | return -EINVAL; |
1284 | 1280 | ||
1285 | scsi_adjust_queue_depth(sdev, queue_depth); | 1281 | return scsi_change_queue_depth(sdev, queue_depth); |
1286 | return queue_depth; | ||
1287 | } | 1282 | } |
1288 | 1283 | ||
1289 | /** | 1284 | /** |
1290 | * ata_scsi_change_queue_depth - SCSI callback for queue depth config | 1285 | * ata_scsi_change_queue_depth - SCSI callback for queue depth config |
1291 | * @sdev: SCSI device to configure queue depth for | 1286 | * @sdev: SCSI device to configure queue depth for |
1292 | * @queue_depth: new queue depth | 1287 | * @queue_depth: new queue depth |
1293 | * @reason: calling context | ||
1294 | * | 1288 | * |
1295 | * This is libata standard hostt->change_queue_depth callback. | 1289 | * This is libata standard hostt->change_queue_depth callback. |
1296 | * SCSI will call into this callback when user tries to set queue | 1290 | * SCSI will call into this callback when user tries to set queue |
@@ -1302,12 +1296,11 @@ int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev, | |||
1302 | * RETURNS: | 1296 | * RETURNS: |
1303 | * Newly configured queue depth. | 1297 | * Newly configured queue depth. |
1304 | */ | 1298 | */ |
1305 | int ata_scsi_change_queue_depth(struct scsi_device *sdev, int queue_depth, | 1299 | int ata_scsi_change_queue_depth(struct scsi_device *sdev, int queue_depth) |
1306 | int reason) | ||
1307 | { | 1300 | { |
1308 | struct ata_port *ap = ata_shost_to_port(sdev->host); | 1301 | struct ata_port *ap = ata_shost_to_port(sdev->host); |
1309 | 1302 | ||
1310 | return __ata_change_queue_depth(ap, sdev, queue_depth, reason); | 1303 | return __ata_change_queue_depth(ap, sdev, queue_depth); |
1311 | } | 1304 | } |
1312 | 1305 | ||
1313 | /** | 1306 | /** |
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c index cdf99fac139a..1db6f5ce5e89 100644 --- a/drivers/ata/sata_nv.c +++ b/drivers/ata/sata_nv.c | |||
@@ -1951,7 +1951,7 @@ static int nv_swncq_slave_config(struct scsi_device *sdev) | |||
1951 | ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num)); | 1951 | ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num)); |
1952 | 1952 | ||
1953 | if (strncmp(model_num, "Maxtor", 6) == 0) { | 1953 | if (strncmp(model_num, "Maxtor", 6) == 0) { |
1954 | ata_scsi_change_queue_depth(sdev, 1, SCSI_QDEPTH_DEFAULT); | 1954 | ata_scsi_change_queue_depth(sdev, 1); |
1955 | ata_dev_notice(dev, "Disabling SWNCQ mode (depth %x)\n", | 1955 | ata_dev_notice(dev, "Disabling SWNCQ mode (depth %x)\n", |
1956 | sdev->queue_depth); | 1956 | sdev->queue_depth); |
1957 | } | 1957 | } |