diff options
Diffstat (limited to 'drivers/s390/block')
-rw-r--r-- | drivers/s390/block/dasd.c | 17 |
1 files changed, 9 insertions, 8 deletions
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) | |||
1595 | /* | 1595 | /* |
1596 | * posts the buffer_cache about a finalized request | 1596 | * posts the buffer_cache about a finalized request |
1597 | */ | 1597 | */ |
1598 | static inline void dasd_end_request(struct request *req, int uptodate) | 1598 | static inline void dasd_end_request(struct request *req, int error) |
1599 | { | 1599 | { |
1600 | if (end_that_request_first(req, uptodate, req->hard_nr_sectors)) | 1600 | if (__blk_end_request(req, error, blk_rq_bytes(req))) |
1601 | BUG(); | 1601 | BUG(); |
1602 | add_disk_randomness(req->rq_disk); | ||
1603 | end_that_request_last(req, uptodate); | ||
1604 | } | 1602 | } |
1605 | 1603 | ||
1606 | /* | 1604 | /* |
@@ -1657,7 +1655,7 @@ static void __dasd_process_request_queue(struct dasd_block *block) | |||
1657 | "Rejecting write request %p", | 1655 | "Rejecting write request %p", |
1658 | req); | 1656 | req); |
1659 | blkdev_dequeue_request(req); | 1657 | blkdev_dequeue_request(req); |
1660 | dasd_end_request(req, 0); | 1658 | dasd_end_request(req, -EIO); |
1661 | continue; | 1659 | continue; |
1662 | } | 1660 | } |
1663 | cqr = basedev->discipline->build_cp(basedev, block, req); | 1661 | cqr = basedev->discipline->build_cp(basedev, block, req); |
@@ -1686,7 +1684,7 @@ static void __dasd_process_request_queue(struct dasd_block *block) | |||
1686 | "on request %p", | 1684 | "on request %p", |
1687 | PTR_ERR(cqr), req); | 1685 | PTR_ERR(cqr), req); |
1688 | blkdev_dequeue_request(req); | 1686 | blkdev_dequeue_request(req); |
1689 | dasd_end_request(req, 0); | 1687 | dasd_end_request(req, -EIO); |
1690 | continue; | 1688 | continue; |
1691 | } | 1689 | } |
1692 | /* | 1690 | /* |
@@ -1705,11 +1703,14 @@ static void __dasd_cleanup_cqr(struct dasd_ccw_req *cqr) | |||
1705 | { | 1703 | { |
1706 | struct request *req; | 1704 | struct request *req; |
1707 | int status; | 1705 | int status; |
1706 | int error = 0; | ||
1708 | 1707 | ||
1709 | req = (struct request *) cqr->callback_data; | 1708 | req = (struct request *) cqr->callback_data; |
1710 | dasd_profile_end(cqr->block, cqr, req); | 1709 | dasd_profile_end(cqr->block, cqr, req); |
1711 | status = cqr->memdev->discipline->free_cp(cqr, req); | 1710 | status = cqr->memdev->discipline->free_cp(cqr, req); |
1712 | dasd_end_request(req, status); | 1711 | if (status <= 0) |
1712 | error = status ? status : -EIO; | ||
1713 | dasd_end_request(req, error); | ||
1713 | } | 1714 | } |
1714 | 1715 | ||
1715 | /* | 1716 | /* |
@@ -2009,7 +2010,7 @@ static void dasd_flush_request_queue(struct dasd_block *block) | |||
2009 | spin_lock_irq(&block->request_queue_lock); | 2010 | spin_lock_irq(&block->request_queue_lock); |
2010 | while ((req = elv_next_request(block->request_queue))) { | 2011 | while ((req = elv_next_request(block->request_queue))) { |
2011 | blkdev_dequeue_request(req); | 2012 | blkdev_dequeue_request(req); |
2012 | dasd_end_request(req, 0); | 2013 | dasd_end_request(req, -EIO); |
2013 | } | 2014 | } |
2014 | spin_unlock_irq(&block->request_queue_lock); | 2015 | spin_unlock_irq(&block->request_queue_lock); |
2015 | } | 2016 | } |