From 4c4e21486154c8db93c7e82a4b3ab5f621cd1d97 Mon Sep 17 00:00:00 2001 From: Kiyoshi Ueda Date: Mon, 28 Jan 2008 10:29:42 +0100 Subject: 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 Cc: Heiko Carstens Cc: linux390@de.ibm.com Signed-off-by: Kiyoshi Ueda Signed-off-by: Jun'ichi Nomura Signed-off-by: Jens Axboe --- drivers/s390/block/dasd.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'drivers/s390/block') diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 1db15f3e5d20..d640427c74c8 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -1595,12 +1595,10 @@ void dasd_block_clear_timer(struct dasd_block *block) /* * 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(); - 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) "Rejecting write request %p", req); blkdev_dequeue_request(req); - dasd_end_request(req, 0); + dasd_end_request(req, -EIO); continue; } cqr = basedev->discipline->build_cp(basedev, block, req); @@ -1686,7 +1684,7 @@ static void __dasd_process_request_queue(struct dasd_block *block) "on request %p", PTR_ERR(cqr), req); blkdev_dequeue_request(req); - dasd_end_request(req, 0); + dasd_end_request(req, -EIO); continue; } /* @@ -1705,11 +1703,14 @@ static void __dasd_cleanup_cqr(struct dasd_ccw_req *cqr) { struct request *req; int status; + int error = 0; req = (struct request *) cqr->callback_data; dasd_profile_end(cqr->block, 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) spin_lock_irq(&block->request_queue_lock); while ((req = elv_next_request(block->request_queue))) { blkdev_dequeue_request(req); - dasd_end_request(req, 0); + dasd_end_request(req, -EIO); } spin_unlock_irq(&block->request_queue_lock); } -- cgit v1.2.1