aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/xen-blkfront.c
diff options
context:
space:
mode:
authorKiyoshi Ueda <k-ueda@ct.jp.nec.com>2007-12-11 17:47:36 -0500
committerJens Axboe <jens.axboe@oracle.com>2008-01-28 04:36:46 -0500
commitf530f036378421fb0b59bb829a8097a50bca79e2 (patch)
tree74ff62e7b4a26fce50b4aea159f63fa56a737d06 /drivers/block/xen-blkfront.c
parentb2aec24ea4c5836f9b3cbc7dca51f0ae639865ed (diff)
blk_end_request: changing xen-blkfront (take 4)
This patch converts xen-blkfront to use blk_end_request interfaces. Related 'uptodate' arguments are converted to 'error'. Cc: Jeremy Fitzhardinge <jeremy@xensource.com> Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com> Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/block/xen-blkfront.c')
-rw-r--r--drivers/block/xen-blkfront.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 2bdebcb3ff16..8afce67c0aa5 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -452,7 +452,7 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
452 RING_IDX i, rp; 452 RING_IDX i, rp;
453 unsigned long flags; 453 unsigned long flags;
454 struct blkfront_info *info = (struct blkfront_info *)dev_id; 454 struct blkfront_info *info = (struct blkfront_info *)dev_id;
455 int uptodate; 455 int error;
456 456
457 spin_lock_irqsave(&blkif_io_lock, flags); 457 spin_lock_irqsave(&blkif_io_lock, flags);
458 458
@@ -477,13 +477,13 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
477 477
478 add_id_to_freelist(info, id); 478 add_id_to_freelist(info, id);
479 479
480 uptodate = (bret->status == BLKIF_RSP_OKAY); 480 error = (bret->status == BLKIF_RSP_OKAY) ? 0 : -EIO;
481 switch (bret->operation) { 481 switch (bret->operation) {
482 case BLKIF_OP_WRITE_BARRIER: 482 case BLKIF_OP_WRITE_BARRIER:
483 if (unlikely(bret->status == BLKIF_RSP_EOPNOTSUPP)) { 483 if (unlikely(bret->status == BLKIF_RSP_EOPNOTSUPP)) {
484 printk(KERN_WARNING "blkfront: %s: write barrier op failed\n", 484 printk(KERN_WARNING "blkfront: %s: write barrier op failed\n",
485 info->gd->disk_name); 485 info->gd->disk_name);
486 uptodate = -EOPNOTSUPP; 486 error = -EOPNOTSUPP;
487 info->feature_barrier = 0; 487 info->feature_barrier = 0;
488 xlvbd_barrier(info); 488 xlvbd_barrier(info);
489 } 489 }
@@ -494,10 +494,8 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
494 dev_dbg(&info->xbdev->dev, "Bad return from blkdev data " 494 dev_dbg(&info->xbdev->dev, "Bad return from blkdev data "
495 "request: %x\n", bret->status); 495 "request: %x\n", bret->status);
496 496
497 ret = end_that_request_first(req, uptodate, 497 ret = __blk_end_request(req, error, blk_rq_bytes(req));
498 req->hard_nr_sectors);
499 BUG_ON(ret); 498 BUG_ON(ret);
500 end_that_request_last(req, uptodate);
501 break; 499 break;
502 default: 500 default:
503 BUG(); 501 BUG();