mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
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>
This commit is contained in:
parent
b2aec24ea4
commit
f530f03637
1 changed files with 4 additions and 6 deletions
|
@ -452,7 +452,7 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
|
||||||
RING_IDX i, rp;
|
RING_IDX i, rp;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
struct blkfront_info *info = (struct blkfront_info *)dev_id;
|
struct blkfront_info *info = (struct blkfront_info *)dev_id;
|
||||||
int uptodate;
|
int error;
|
||||||
|
|
||||||
spin_lock_irqsave(&blkif_io_lock, flags);
|
spin_lock_irqsave(&blkif_io_lock, flags);
|
||||||
|
|
||||||
|
@ -477,13 +477,13 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
|
||||||
|
|
||||||
add_id_to_freelist(info, id);
|
add_id_to_freelist(info, id);
|
||||||
|
|
||||||
uptodate = (bret->status == BLKIF_RSP_OKAY);
|
error = (bret->status == BLKIF_RSP_OKAY) ? 0 : -EIO;
|
||||||
switch (bret->operation) {
|
switch (bret->operation) {
|
||||||
case BLKIF_OP_WRITE_BARRIER:
|
case BLKIF_OP_WRITE_BARRIER:
|
||||||
if (unlikely(bret->status == BLKIF_RSP_EOPNOTSUPP)) {
|
if (unlikely(bret->status == BLKIF_RSP_EOPNOTSUPP)) {
|
||||||
printk(KERN_WARNING "blkfront: %s: write barrier op failed\n",
|
printk(KERN_WARNING "blkfront: %s: write barrier op failed\n",
|
||||||
info->gd->disk_name);
|
info->gd->disk_name);
|
||||||
uptodate = -EOPNOTSUPP;
|
error = -EOPNOTSUPP;
|
||||||
info->feature_barrier = 0;
|
info->feature_barrier = 0;
|
||||||
xlvbd_barrier(info);
|
xlvbd_barrier(info);
|
||||||
}
|
}
|
||||||
|
@ -494,10 +494,8 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
|
||||||
dev_dbg(&info->xbdev->dev, "Bad return from blkdev data "
|
dev_dbg(&info->xbdev->dev, "Bad return from blkdev data "
|
||||||
"request: %x\n", bret->status);
|
"request: %x\n", bret->status);
|
||||||
|
|
||||||
ret = end_that_request_first(req, uptodate,
|
ret = __blk_end_request(req, error, blk_rq_bytes(req));
|
||||||
req->hard_nr_sectors);
|
|
||||||
BUG_ON(ret);
|
BUG_ON(ret);
|
||||||
end_that_request_last(req, uptodate);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
BUG();
|
BUG();
|
||||||
|
|
Loading…
Add table
Reference in a new issue