aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorKiyoshi Ueda <k-ueda@ct.jp.nec.com>2007-12-11 17:47:14 -0500
committerJens Axboe <jens.axboe@oracle.com>2008-01-28 04:36:44 -0500
commitb2aec24ea4c5836f9b3cbc7dca51f0ae639865ed (patch)
treeda7a6574ba2f78718b8de8c032687348ef964061 /drivers/block
parenta9c73d05f16113744e3d342255120bd36d84a1e8 (diff)
blk_end_request: changing viodasd (take 4)
This patch converts viodasd to use blk_end_request interfaces. Related 'uptodate' arguments are converted to 'error'. As a result, the interface of internal function, viodasd_end_request(), is changed. Cc: Stephen Rothwell <sfr@canb.auug.org.au> 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')
-rw-r--r--drivers/block/viodasd.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c
index ab5d404faa11..9e61fca46117 100644
--- a/drivers/block/viodasd.c
+++ b/drivers/block/viodasd.c
@@ -229,13 +229,10 @@ static struct block_device_operations viodasd_fops = {
229/* 229/*
230 * End a request 230 * End a request
231 */ 231 */
232static void viodasd_end_request(struct request *req, int uptodate, 232static void viodasd_end_request(struct request *req, int error,
233 int num_sectors) 233 int num_sectors)
234{ 234{
235 if (end_that_request_first(req, uptodate, num_sectors)) 235 __blk_end_request(req, error, num_sectors << 9);
236 return;
237 add_disk_randomness(req->rq_disk);
238 end_that_request_last(req, uptodate);
239} 236}
240 237
241/* 238/*
@@ -374,12 +371,12 @@ static void do_viodasd_request(struct request_queue *q)
374 blkdev_dequeue_request(req); 371 blkdev_dequeue_request(req);
375 /* check that request contains a valid command */ 372 /* check that request contains a valid command */
376 if (!blk_fs_request(req)) { 373 if (!blk_fs_request(req)) {
377 viodasd_end_request(req, 0, req->hard_nr_sectors); 374 viodasd_end_request(req, -EIO, req->hard_nr_sectors);
378 continue; 375 continue;
379 } 376 }
380 /* Try sending the request */ 377 /* Try sending the request */
381 if (send_request(req) != 0) 378 if (send_request(req) != 0)
382 viodasd_end_request(req, 0, req->hard_nr_sectors); 379 viodasd_end_request(req, -EIO, req->hard_nr_sectors);
383 } 380 }
384} 381}
385 382
@@ -591,7 +588,7 @@ static int viodasd_handle_read_write(struct vioblocklpevent *bevent)
591 num_req_outstanding--; 588 num_req_outstanding--;
592 spin_unlock_irqrestore(&viodasd_spinlock, irq_flags); 589 spin_unlock_irqrestore(&viodasd_spinlock, irq_flags);
593 590
594 error = event->xRc != HvLpEvent_Rc_Good; 591 error = (event->xRc == HvLpEvent_Rc_Good) ? 0 : -EIO;
595 if (error) { 592 if (error) {
596 const struct vio_error_entry *err; 593 const struct vio_error_entry *err;
597 err = vio_lookup_rc(viodasd_err_table, bevent->sub_result); 594 err = vio_lookup_rc(viodasd_err_table, bevent->sub_result);
@@ -601,7 +598,7 @@ static int viodasd_handle_read_write(struct vioblocklpevent *bevent)
601 } 598 }
602 qlock = req->q->queue_lock; 599 qlock = req->q->queue_lock;
603 spin_lock_irqsave(qlock, irq_flags); 600 spin_lock_irqsave(qlock, irq_flags);
604 viodasd_end_request(req, !error, num_sect); 601 viodasd_end_request(req, error, num_sect);
605 spin_unlock_irqrestore(qlock, irq_flags); 602 spin_unlock_irqrestore(qlock, irq_flags);
606 603
607 /* Finally, try to get more requests off of this device's queue */ 604 /* Finally, try to get more requests off of this device's queue */