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/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/block')
-rw-r--r-- | drivers/block/cpqarray.c | 3 | ||||
-rw-r--r-- | drivers/block/sx8.c | 3 | ||||
-rw-r--r-- | drivers/block/virtio_blk.c | 2 | ||||
-rw-r--r-- | drivers/block/xen-blkfront.c | 4 |
4 files changed, 4 insertions, 8 deletions
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c index ca268ca11159..488a8f4a60aa 100644 --- a/drivers/block/cpqarray.c +++ b/drivers/block/cpqarray.c | |||
@@ -1024,8 +1024,7 @@ static inline void complete_command(cmdlist_t *cmd, int timeout) | |||
1024 | cmd->req.sg[i].size, ddir); | 1024 | cmd->req.sg[i].size, ddir); |
1025 | 1025 | ||
1026 | DBGPX(printk("Done with %p\n", rq);); | 1026 | DBGPX(printk("Done with %p\n", rq);); |
1027 | if (__blk_end_request(rq, error, blk_rq_bytes(rq))) | 1027 | __blk_end_request_all(rq, error); |
1028 | BUG(); | ||
1029 | } | 1028 | } |
1030 | 1029 | ||
1031 | /* | 1030 | /* |
diff --git a/drivers/block/sx8.c b/drivers/block/sx8.c index ff0448e4bf03..60e85bb6f790 100644 --- a/drivers/block/sx8.c +++ b/drivers/block/sx8.c | |||
@@ -749,8 +749,7 @@ static inline void carm_end_request_queued(struct carm_host *host, | |||
749 | struct request *req = crq->rq; | 749 | struct request *req = crq->rq; |
750 | int rc; | 750 | int rc; |
751 | 751 | ||
752 | rc = __blk_end_request(req, error, blk_rq_bytes(req)); | 752 | __blk_end_request_all(req, error); |
753 | assert(rc == 0); | ||
754 | 753 | ||
755 | rc = carm_put_request(host, crq); | 754 | rc = carm_put_request(host, crq); |
756 | assert(rc == 0); | 755 | assert(rc == 0); |
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 5d34764c8a87..50745e64414e 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c | |||
@@ -62,7 +62,7 @@ static void blk_done(struct virtqueue *vq) | |||
62 | break; | 62 | break; |
63 | } | 63 | } |
64 | 64 | ||
65 | __blk_end_request(vbr->req, error, blk_rq_bytes(vbr->req)); | 65 | __blk_end_request_all(vbr->req, error); |
66 | list_del(&vbr->list); | 66 | list_del(&vbr->list); |
67 | mempool_free(vbr, vblk->pool); | 67 | mempool_free(vbr, vblk->pool); |
68 | } | 68 | } |
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 8f905089b72b..cd6cfe3b51e1 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c | |||
@@ -551,7 +551,6 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) | |||
551 | 551 | ||
552 | for (i = info->ring.rsp_cons; i != rp; i++) { | 552 | for (i = info->ring.rsp_cons; i != rp; i++) { |
553 | unsigned long id; | 553 | unsigned long id; |
554 | int ret; | ||
555 | 554 | ||
556 | bret = RING_GET_RESPONSE(&info->ring, i); | 555 | bret = RING_GET_RESPONSE(&info->ring, i); |
557 | id = bret->id; | 556 | id = bret->id; |
@@ -578,8 +577,7 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) | |||
578 | dev_dbg(&info->xbdev->dev, "Bad return from blkdev data " | 577 | dev_dbg(&info->xbdev->dev, "Bad return from blkdev data " |
579 | "request: %x\n", bret->status); | 578 | "request: %x\n", bret->status); |
580 | 579 | ||
581 | ret = __blk_end_request(req, error, blk_rq_bytes(req)); | 580 | __blk_end_request_all(req, error); |
582 | BUG_ON(ret); | ||
583 | break; | 581 | break; |
584 | default: | 582 | default: |
585 | BUG(); | 583 | BUG(); |