[BLOCK] update SCSI to use new blk_ordered for barriers

All ordered request related stuff delegated to HLD.  Midlayer
now doens't deal with ordered setting or prepare_flush
callback.  sd.c updated to deal with blk_queue_ordered
setting.  Currently, ordered tag isn't used as SCSI midlayer
cannot guarantee request ordering.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jens Axboe <axboe@suse.de>
This commit is contained in:
Tejun Heo
2006-01-06 09:52:55 +01:00
committed by Jens Axboe
parent 797e7dbbee
commit 461d4e90c8
5 changed files with 20 additions and 95 deletions

View File

@@ -932,9 +932,6 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes,
int sense_valid = 0;
int sense_deferred = 0;
if (blk_complete_barrier_rq(q, req, good_bytes >> 9))
return;
/*
* Free up any indirection buffers we allocated for DMA purposes.
* 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)
return BLKPREP_KILL;
}
static int scsi_prepare_flush_fn(request_queue_t *q, struct request *rq)
{
struct scsi_device *sdev = q->queuedata;
struct scsi_driver *drv;
if (sdev->sdev_state == SDEV_RUNNING) {
drv = *(struct scsi_driver **) rq->rq_disk->private_data;
if (drv->prepare_flush)
return drv->prepare_flush(q, rq);
}
return 0;
}
static void scsi_end_flush_fn(request_queue_t *q, struct request *rq)
{
struct scsi_device *sdev = q->queuedata;
struct request *flush_rq = rq->end_io_data;
struct scsi_driver *drv;
if (flush_rq->errors) {
printk("scsi: barrier error, disabling flush support\n");
blk_queue_ordered(q, QUEUE_ORDERED_NONE);
}
if (sdev->sdev_state == SDEV_RUNNING) {
drv = *(struct scsi_driver **) rq->rq_disk->private_data;
drv->end_flush(q, rq);
}
}
static int scsi_issue_flush_fn(request_queue_t *q, struct gendisk *disk,
sector_t *error_sector)
{
@@ -1703,17 +1668,6 @@ struct request_queue *scsi_alloc_queue(struct scsi_device *sdev)
blk_queue_segment_boundary(q, shost->dma_boundary);
blk_queue_issue_flush_fn(q, scsi_issue_flush_fn);
/*
* ordered tags are superior to flush ordering
*/
if (shost->ordered_tag)
blk_queue_ordered(q, QUEUE_ORDERED_TAG);
else if (shost->ordered_flush) {
blk_queue_ordered(q, QUEUE_ORDERED_FLUSH);
q->prepare_flush_fn = scsi_prepare_flush_fn;
q->end_flush_fn = scsi_end_flush_fn;
}
if (!shost->use_clustering)
clear_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags);
return q;