diff options
author | Tejun Heo <htejun@gmail.com> | 2006-01-06 03:49:03 -0500 |
---|---|---|
committer | Jens Axboe <axboe@suse.de> | 2006-01-06 03:49:03 -0500 |
commit | 8ffdc6550c47f75ca4e6c9f30a2a89063e035cf2 (patch) | |
tree | a478b9acef5c66242a964154f7ad3a0ea750ef0f /drivers/scsi | |
parent | 64100099ed22f71cce656c5c2caecf5c9cf255dc (diff) |
[BLOCK] add @uptodate to end_that_request_last() and @error to rq_end_io_fn()
add @uptodate argument to end_that_request_last() and @error
to rq_end_io_fn(). there's no generic way to pass error code
to request completion function, making generic error handling
of non-fs request difficult (rq->errors is driver-specific and
each driver uses it differently). this patch adds @uptodate
to end_that_request_last() and @error to rq_end_io_fn().
for fs requests, this doesn't really matter, so just using the
same uptodate argument used in the last call to
end_that_request_first() should suffice. imho, this can also
help the generic command-carrying request jens is working on.
Signed-off-by: tejun heo <htejun@gmail.com>
Signed-Off-By: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/ide-scsi.c | 4 | ||||
-rw-r--r-- | drivers/scsi/scsi_lib.c | 2 | ||||
-rw-r--r-- | drivers/scsi/sd.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c index 4cb1f3ed9100..3c688ef54660 100644 --- a/drivers/scsi/ide-scsi.c +++ b/drivers/scsi/ide-scsi.c | |||
@@ -1046,7 +1046,7 @@ static int idescsi_eh_reset (struct scsi_cmnd *cmd) | |||
1046 | 1046 | ||
1047 | /* kill current request */ | 1047 | /* kill current request */ |
1048 | blkdev_dequeue_request(req); | 1048 | blkdev_dequeue_request(req); |
1049 | end_that_request_last(req); | 1049 | end_that_request_last(req, 0); |
1050 | if (req->flags & REQ_SENSE) | 1050 | if (req->flags & REQ_SENSE) |
1051 | kfree(scsi->pc->buffer); | 1051 | kfree(scsi->pc->buffer); |
1052 | kfree(scsi->pc); | 1052 | kfree(scsi->pc); |
@@ -1056,7 +1056,7 @@ static int idescsi_eh_reset (struct scsi_cmnd *cmd) | |||
1056 | /* now nuke the drive queue */ | 1056 | /* now nuke the drive queue */ |
1057 | while ((req = elv_next_request(drive->queue))) { | 1057 | while ((req = elv_next_request(drive->queue))) { |
1058 | blkdev_dequeue_request(req); | 1058 | blkdev_dequeue_request(req); |
1059 | end_that_request_last(req); | 1059 | end_that_request_last(req, 0); |
1060 | } | 1060 | } |
1061 | 1061 | ||
1062 | HWGROUP(drive)->rq = NULL; | 1062 | HWGROUP(drive)->rq = NULL; |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index a7f3f0c84db7..53551f1dfe21 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -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 | /* |
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 3d3ad7d1b779..d651150ee76d 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -748,7 +748,7 @@ static void sd_end_flush(request_queue_t *q, struct request *flush_rq) | |||
748 | * force journal abort of barriers | 748 | * force journal abort of barriers |
749 | */ | 749 | */ |
750 | end_that_request_first(rq, -EOPNOTSUPP, rq->hard_nr_sectors); | 750 | end_that_request_first(rq, -EOPNOTSUPP, rq->hard_nr_sectors); |
751 | end_that_request_last(rq); | 751 | end_that_request_last(rq, -EOPNOTSUPP); |
752 | } | 752 | } |
753 | } | 753 | } |
754 | 754 | ||