提交 4c4e2148 编写于 作者: K Kiyoshi Ueda 提交者: Jens Axboe

blk_end_request: changing s390 (take 4)

This patch converts s390 to use blk_end_request interfaces.
Related 'uptodate' arguments are converted to 'error'.

As a result, the interfaces of internal functions below are changed:
  o dasd_end_request
  o tapeblock_end_request

Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: linux390@de.ibm.com
Signed-off-by: NKiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: NJun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
上级 fd539832
...@@ -1595,12 +1595,10 @@ void dasd_block_clear_timer(struct dasd_block *block) ...@@ -1595,12 +1595,10 @@ void dasd_block_clear_timer(struct dasd_block *block)
/* /*
* posts the buffer_cache about a finalized request * posts the buffer_cache about a finalized request
*/ */
static inline void dasd_end_request(struct request *req, int uptodate) static inline void dasd_end_request(struct request *req, int error)
{ {
if (end_that_request_first(req, uptodate, req->hard_nr_sectors)) if (__blk_end_request(req, error, blk_rq_bytes(req)))
BUG(); BUG();
add_disk_randomness(req->rq_disk);
end_that_request_last(req, uptodate);
} }
/* /*
...@@ -1657,7 +1655,7 @@ static void __dasd_process_request_queue(struct dasd_block *block) ...@@ -1657,7 +1655,7 @@ static void __dasd_process_request_queue(struct dasd_block *block)
"Rejecting write request %p", "Rejecting write request %p",
req); req);
blkdev_dequeue_request(req); blkdev_dequeue_request(req);
dasd_end_request(req, 0); dasd_end_request(req, -EIO);
continue; continue;
} }
cqr = basedev->discipline->build_cp(basedev, block, req); cqr = basedev->discipline->build_cp(basedev, block, req);
...@@ -1686,7 +1684,7 @@ static void __dasd_process_request_queue(struct dasd_block *block) ...@@ -1686,7 +1684,7 @@ static void __dasd_process_request_queue(struct dasd_block *block)
"on request %p", "on request %p",
PTR_ERR(cqr), req); PTR_ERR(cqr), req);
blkdev_dequeue_request(req); blkdev_dequeue_request(req);
dasd_end_request(req, 0); dasd_end_request(req, -EIO);
continue; continue;
} }
/* /*
...@@ -1705,11 +1703,14 @@ static void __dasd_cleanup_cqr(struct dasd_ccw_req *cqr) ...@@ -1705,11 +1703,14 @@ static void __dasd_cleanup_cqr(struct dasd_ccw_req *cqr)
{ {
struct request *req; struct request *req;
int status; int status;
int error = 0;
req = (struct request *) cqr->callback_data; req = (struct request *) cqr->callback_data;
dasd_profile_end(cqr->block, cqr, req); dasd_profile_end(cqr->block, cqr, req);
status = cqr->memdev->discipline->free_cp(cqr, req); status = cqr->memdev->discipline->free_cp(cqr, req);
dasd_end_request(req, status); if (status <= 0)
error = status ? status : -EIO;
dasd_end_request(req, error);
} }
/* /*
...@@ -2009,7 +2010,7 @@ static void dasd_flush_request_queue(struct dasd_block *block) ...@@ -2009,7 +2010,7 @@ static void dasd_flush_request_queue(struct dasd_block *block)
spin_lock_irq(&block->request_queue_lock); spin_lock_irq(&block->request_queue_lock);
while ((req = elv_next_request(block->request_queue))) { while ((req = elv_next_request(block->request_queue))) {
blkdev_dequeue_request(req); blkdev_dequeue_request(req);
dasd_end_request(req, 0); dasd_end_request(req, -EIO);
} }
spin_unlock_irq(&block->request_queue_lock); spin_unlock_irq(&block->request_queue_lock);
} }
......
...@@ -74,11 +74,10 @@ tapeblock_trigger_requeue(struct tape_device *device) ...@@ -74,11 +74,10 @@ tapeblock_trigger_requeue(struct tape_device *device)
* Post finished request. * Post finished request.
*/ */
static void static void
tapeblock_end_request(struct request *req, int uptodate) tapeblock_end_request(struct request *req, int error)
{ {
if (end_that_request_first(req, uptodate, req->hard_nr_sectors)) if (__blk_end_request(req, error, blk_rq_bytes(req)))
BUG(); BUG();
end_that_request_last(req, uptodate);
} }
static void static void
...@@ -91,7 +90,7 @@ __tapeblock_end_request(struct tape_request *ccw_req, void *data) ...@@ -91,7 +90,7 @@ __tapeblock_end_request(struct tape_request *ccw_req, void *data)
device = ccw_req->device; device = ccw_req->device;
req = (struct request *) data; req = (struct request *) data;
tapeblock_end_request(req, ccw_req->rc == 0); tapeblock_end_request(req, (ccw_req->rc == 0) ? 0 : -EIO);
if (ccw_req->rc == 0) if (ccw_req->rc == 0)
/* Update position. */ /* Update position. */
device->blk_data.block_position = device->blk_data.block_position =
...@@ -119,7 +118,7 @@ tapeblock_start_request(struct tape_device *device, struct request *req) ...@@ -119,7 +118,7 @@ tapeblock_start_request(struct tape_device *device, struct request *req)
ccw_req = device->discipline->bread(device, req); ccw_req = device->discipline->bread(device, req);
if (IS_ERR(ccw_req)) { if (IS_ERR(ccw_req)) {
DBF_EVENT(1, "TBLOCK: bread failed\n"); DBF_EVENT(1, "TBLOCK: bread failed\n");
tapeblock_end_request(req, 0); tapeblock_end_request(req, -EIO);
return PTR_ERR(ccw_req); return PTR_ERR(ccw_req);
} }
ccw_req->callback = __tapeblock_end_request; ccw_req->callback = __tapeblock_end_request;
...@@ -132,7 +131,7 @@ tapeblock_start_request(struct tape_device *device, struct request *req) ...@@ -132,7 +131,7 @@ tapeblock_start_request(struct tape_device *device, struct request *req)
* Start/enqueueing failed. No retries in * Start/enqueueing failed. No retries in
* this case. * this case.
*/ */
tapeblock_end_request(req, 0); tapeblock_end_request(req, -EIO);
device->discipline->free_bread(ccw_req); device->discipline->free_bread(ccw_req);
} }
...@@ -177,7 +176,7 @@ tapeblock_requeue(struct work_struct *work) { ...@@ -177,7 +176,7 @@ tapeblock_requeue(struct work_struct *work) {
if (rq_data_dir(req) == WRITE) { if (rq_data_dir(req) == WRITE) {
DBF_EVENT(1, "TBLOCK: Rejecting write request\n"); DBF_EVENT(1, "TBLOCK: Rejecting write request\n");
blkdev_dequeue_request(req); blkdev_dequeue_request(req);
tapeblock_end_request(req, 0); tapeblock_end_request(req, -EIO);
continue; continue;
} }
spin_unlock_irq(&device->blk_data.request_queue_lock); spin_unlock_irq(&device->blk_data.request_queue_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册