diff options
author | Tejun Heo <tj@kernel.org> | 2009-04-22 22:05:19 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-04-28 01:37:35 -0400 |
commit | 40cbbb781d3eba5d6ac0860db078af490e5c7c6b (patch) | |
tree | dec374543cf045fc630bccddbb7646c695094b0d /drivers/s390/block | |
parent | b243ddcbe9be146172baa544dadecebf156eda0e (diff) |
block: implement and use [__]blk_end_request_all()
There are many [__]blk_end_request() call sites which call it with
full request length and expect full completion. Many of them ensure
that the request actually completes by doing BUG_ON() the return
value, which is awkward and error-prone.
This patch adds [__]blk_end_request_all() which takes @rq and @error
and fully completes the request. BUG_ON() is added to to ensure that
this actually happens.
Most conversions are simple but there are a few noteworthy ones.
* cdrom/viocd: viocd_end_request() replaced with direct calls to
__blk_end_request_all().
* s390/block/dasd: dasd_end_request() replaced with direct calls to
__blk_end_request_all().
* s390/char/tape_block: tapeblock_end_request() replaced with direct
calls to blk_end_request_all().
[ Impact: cleanup ]
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Mike Miller <mike.miller@hp.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Alex Dubov <oakad@yahoo.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390/block')
-rw-r--r-- | drivers/s390/block/dasd.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index d1815272c435..fabec95686b0 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c | |||
@@ -1614,15 +1614,6 @@ void dasd_block_clear_timer(struct dasd_block *block) | |||
1614 | } | 1614 | } |
1615 | 1615 | ||
1616 | /* | 1616 | /* |
1617 | * posts the buffer_cache about a finalized request | ||
1618 | */ | ||
1619 | static inline void dasd_end_request(struct request *req, int error) | ||
1620 | { | ||
1621 | if (__blk_end_request(req, error, blk_rq_bytes(req))) | ||
1622 | BUG(); | ||
1623 | } | ||
1624 | |||
1625 | /* | ||
1626 | * Process finished error recovery ccw. | 1617 | * Process finished error recovery ccw. |
1627 | */ | 1618 | */ |
1628 | static inline void __dasd_block_process_erp(struct dasd_block *block, | 1619 | static inline void __dasd_block_process_erp(struct dasd_block *block, |
@@ -1676,7 +1667,7 @@ static void __dasd_process_request_queue(struct dasd_block *block) | |||
1676 | "Rejecting write request %p", | 1667 | "Rejecting write request %p", |
1677 | req); | 1668 | req); |
1678 | blkdev_dequeue_request(req); | 1669 | blkdev_dequeue_request(req); |
1679 | dasd_end_request(req, -EIO); | 1670 | __blk_end_request_all(req, -EIO); |
1680 | continue; | 1671 | continue; |
1681 | } | 1672 | } |
1682 | cqr = basedev->discipline->build_cp(basedev, block, req); | 1673 | cqr = basedev->discipline->build_cp(basedev, block, req); |
@@ -1705,7 +1696,7 @@ static void __dasd_process_request_queue(struct dasd_block *block) | |||
1705 | "on request %p", | 1696 | "on request %p", |
1706 | PTR_ERR(cqr), req); | 1697 | PTR_ERR(cqr), req); |
1707 | blkdev_dequeue_request(req); | 1698 | blkdev_dequeue_request(req); |
1708 | dasd_end_request(req, -EIO); | 1699 | __blk_end_request_all(req, -EIO); |
1709 | continue; | 1700 | continue; |
1710 | } | 1701 | } |
1711 | /* | 1702 | /* |
@@ -1731,7 +1722,7 @@ static void __dasd_cleanup_cqr(struct dasd_ccw_req *cqr) | |||
1731 | status = cqr->block->base->discipline->free_cp(cqr, req); | 1722 | status = cqr->block->base->discipline->free_cp(cqr, req); |
1732 | if (status <= 0) | 1723 | if (status <= 0) |
1733 | error = status ? status : -EIO; | 1724 | error = status ? status : -EIO; |
1734 | dasd_end_request(req, error); | 1725 | __blk_end_request_all(req, error); |
1735 | } | 1726 | } |
1736 | 1727 | ||
1737 | /* | 1728 | /* |
@@ -2040,7 +2031,7 @@ static void dasd_flush_request_queue(struct dasd_block *block) | |||
2040 | spin_lock_irq(&block->request_queue_lock); | 2031 | spin_lock_irq(&block->request_queue_lock); |
2041 | while ((req = elv_next_request(block->request_queue))) { | 2032 | while ((req = elv_next_request(block->request_queue))) { |
2042 | blkdev_dequeue_request(req); | 2033 | blkdev_dequeue_request(req); |
2043 | dasd_end_request(req, -EIO); | 2034 | __blk_end_request_all(req, -EIO); |
2044 | } | 2035 | } |
2045 | spin_unlock_irq(&block->request_queue_lock); | 2036 | spin_unlock_irq(&block->request_queue_lock); |
2046 | } | 2037 | } |