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 /block/blk-barrier.c | |
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 'block/blk-barrier.c')
-rw-r--r-- | block/blk-barrier.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/block/blk-barrier.c b/block/blk-barrier.c index 20b4111fa050..c8d087655eff 100644 --- a/block/blk-barrier.c +++ b/block/blk-barrier.c | |||
@@ -106,10 +106,7 @@ bool blk_ordered_complete_seq(struct request_queue *q, unsigned seq, int error) | |||
106 | */ | 106 | */ |
107 | q->ordseq = 0; | 107 | q->ordseq = 0; |
108 | rq = q->orig_bar_rq; | 108 | rq = q->orig_bar_rq; |
109 | 109 | __blk_end_request_all(rq, q->orderr); | |
110 | if (__blk_end_request(rq, q->orderr, blk_rq_bytes(rq))) | ||
111 | BUG(); | ||
112 | |||
113 | return true; | 110 | return true; |
114 | } | 111 | } |
115 | 112 | ||
@@ -252,9 +249,7 @@ bool blk_do_ordered(struct request_queue *q, struct request **rqp) | |||
252 | * with prejudice. | 249 | * with prejudice. |
253 | */ | 250 | */ |
254 | elv_dequeue_request(q, rq); | 251 | elv_dequeue_request(q, rq); |
255 | if (__blk_end_request(rq, -EOPNOTSUPP, | 252 | __blk_end_request_all(rq, -EOPNOTSUPP); |
256 | blk_rq_bytes(rq))) | ||
257 | BUG(); | ||
258 | *rqp = NULL; | 253 | *rqp = NULL; |
259 | return false; | 254 | return false; |
260 | } | 255 | } |