diff options
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 50 |
1 files changed, 2 insertions, 48 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index a7f3f0c84db7..ba93d6e66d48 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -308,7 +308,7 @@ struct scsi_io_context { | |||
308 | 308 | ||
309 | static kmem_cache_t *scsi_io_context_cache; | 309 | static kmem_cache_t *scsi_io_context_cache; |
310 | 310 | ||
311 | static void scsi_end_async(struct request *req) | 311 | static void scsi_end_async(struct request *req, int uptodate) |
312 | { | 312 | { |
313 | struct scsi_io_context *sioc = req->end_io_data; | 313 | struct scsi_io_context *sioc = req->end_io_data; |
314 | 314 | ||
@@ -791,7 +791,7 @@ static struct scsi_cmnd *scsi_end_request(struct scsi_cmnd *cmd, int uptodate, | |||
791 | spin_lock_irqsave(q->queue_lock, flags); | 791 | spin_lock_irqsave(q->queue_lock, flags); |
792 | if (blk_rq_tagged(req)) | 792 | if (blk_rq_tagged(req)) |
793 | blk_queue_end_tag(q, req); | 793 | blk_queue_end_tag(q, req); |
794 | end_that_request_last(req); | 794 | end_that_request_last(req, uptodate); |
795 | spin_unlock_irqrestore(q->queue_lock, flags); | 795 | spin_unlock_irqrestore(q->queue_lock, flags); |
796 | 796 | ||
797 | /* | 797 | /* |
@@ -932,9 +932,6 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes, | |||
932 | int sense_valid = 0; | 932 | int sense_valid = 0; |
933 | int sense_deferred = 0; | 933 | int sense_deferred = 0; |
934 | 934 | ||
935 | if (blk_complete_barrier_rq(q, req, good_bytes >> 9)) | ||
936 | return; | ||
937 | |||
938 | /* | 935 | /* |
939 | * Free up any indirection buffers we allocated for DMA purposes. | 936 | * Free up any indirection buffers we allocated for DMA purposes. |
940 | * For the case of a READ, we need to copy the data out of the | 937 | * For the case of a READ, we need to copy the data out of the |
@@ -1199,38 +1196,6 @@ static int scsi_init_io(struct scsi_cmnd *cmd) | |||
1199 | return BLKPREP_KILL; | 1196 | return BLKPREP_KILL; |
1200 | } | 1197 | } |
1201 | 1198 | ||
1202 | static int scsi_prepare_flush_fn(request_queue_t *q, struct request *rq) | ||
1203 | { | ||
1204 | struct scsi_device *sdev = q->queuedata; | ||
1205 | struct scsi_driver *drv; | ||
1206 | |||
1207 | if (sdev->sdev_state == SDEV_RUNNING) { | ||
1208 | drv = *(struct scsi_driver **) rq->rq_disk->private_data; | ||
1209 | |||
1210 | if (drv->prepare_flush) | ||
1211 | return drv->prepare_flush(q, rq); | ||
1212 | } | ||
1213 | |||
1214 | return 0; | ||
1215 | } | ||
1216 | |||
1217 | static void scsi_end_flush_fn(request_queue_t *q, struct request *rq) | ||
1218 | { | ||
1219 | struct scsi_device *sdev = q->queuedata; | ||
1220 | struct request *flush_rq = rq->end_io_data; | ||
1221 | struct scsi_driver *drv; | ||
1222 | |||
1223 | if (flush_rq->errors) { | ||
1224 | printk("scsi: barrier error, disabling flush support\n"); | ||
1225 | blk_queue_ordered(q, QUEUE_ORDERED_NONE); | ||
1226 | } | ||
1227 | |||
1228 | if (sdev->sdev_state == SDEV_RUNNING) { | ||
1229 | drv = *(struct scsi_driver **) rq->rq_disk->private_data; | ||
1230 | drv->end_flush(q, rq); | ||
1231 | } | ||
1232 | } | ||
1233 | |||
1234 | static int scsi_issue_flush_fn(request_queue_t *q, struct gendisk *disk, | 1199 | static int scsi_issue_flush_fn(request_queue_t *q, struct gendisk *disk, |
1235 | sector_t *error_sector) | 1200 | sector_t *error_sector) |
1236 | { | 1201 | { |
@@ -1703,17 +1668,6 @@ struct request_queue *scsi_alloc_queue(struct scsi_device *sdev) | |||
1703 | blk_queue_segment_boundary(q, shost->dma_boundary); | 1668 | blk_queue_segment_boundary(q, shost->dma_boundary); |
1704 | blk_queue_issue_flush_fn(q, scsi_issue_flush_fn); | 1669 | blk_queue_issue_flush_fn(q, scsi_issue_flush_fn); |
1705 | 1670 | ||
1706 | /* | ||
1707 | * ordered tags are superior to flush ordering | ||
1708 | */ | ||
1709 | if (shost->ordered_tag) | ||
1710 | blk_queue_ordered(q, QUEUE_ORDERED_TAG); | ||
1711 | else if (shost->ordered_flush) { | ||
1712 | blk_queue_ordered(q, QUEUE_ORDERED_FLUSH); | ||
1713 | q->prepare_flush_fn = scsi_prepare_flush_fn; | ||
1714 | q->end_flush_fn = scsi_end_flush_fn; | ||
1715 | } | ||
1716 | |||
1717 | if (!shost->use_clustering) | 1671 | if (!shost->use_clustering) |
1718 | clear_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags); | 1672 | clear_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags); |
1719 | return q; | 1673 | return q; |