Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 77616
b: refs/heads/master
c: b2aec24
h: refs/heads/master
v: v3
  • Loading branch information
Kiyoshi Ueda authored and Jens Axboe committed Jan 28, 2008
1 parent 54cf5e3 commit 5300756
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a9c73d05f16113744e3d342255120bd36d84a1e8
refs/heads/master: b2aec24ea4c5836f9b3cbc7dca51f0ae639865ed
15 changes: 6 additions & 9 deletions trunk/drivers/block/viodasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,10 @@ static struct block_device_operations viodasd_fops = {
/*
* End a request
*/
static void viodasd_end_request(struct request *req, int uptodate,
static void viodasd_end_request(struct request *req, int error,
int num_sectors)
{
if (end_that_request_first(req, uptodate, num_sectors))
return;
add_disk_randomness(req->rq_disk);
end_that_request_last(req, uptodate);
__blk_end_request(req, error, num_sectors << 9);
}

/*
Expand Down Expand Up @@ -374,12 +371,12 @@ static void do_viodasd_request(struct request_queue *q)
blkdev_dequeue_request(req);
/* check that request contains a valid command */
if (!blk_fs_request(req)) {
viodasd_end_request(req, 0, req->hard_nr_sectors);
viodasd_end_request(req, -EIO, req->hard_nr_sectors);
continue;
}
/* Try sending the request */
if (send_request(req) != 0)
viodasd_end_request(req, 0, req->hard_nr_sectors);
viodasd_end_request(req, -EIO, req->hard_nr_sectors);
}
}

Expand Down Expand Up @@ -591,7 +588,7 @@ static int viodasd_handle_read_write(struct vioblocklpevent *bevent)
num_req_outstanding--;
spin_unlock_irqrestore(&viodasd_spinlock, irq_flags);

error = event->xRc != HvLpEvent_Rc_Good;
error = (event->xRc == HvLpEvent_Rc_Good) ? 0 : -EIO;
if (error) {
const struct vio_error_entry *err;
err = vio_lookup_rc(viodasd_err_table, bevent->sub_result);
Expand All @@ -601,7 +598,7 @@ static int viodasd_handle_read_write(struct vioblocklpevent *bevent)
}
qlock = req->q->queue_lock;
spin_lock_irqsave(qlock, irq_flags);
viodasd_end_request(req, !error, num_sect);
viodasd_end_request(req, error, num_sect);
spin_unlock_irqrestore(qlock, irq_flags);

/* Finally, try to get more requests off of this device's queue */
Expand Down

0 comments on commit 5300756

Please sign in to comment.