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>
This commit is contained in:
Kiyoshi Ueda 2007-12-11 17:47:14 -05:00 committed by Jens Axboe
parent a9c73d05f1
commit b2aec24ea4
1 changed files with 6 additions and 9 deletions

View File

@ -229,13 +229,10 @@ static struct block_device_operations viodasd_fops = {
/* /*
* End a request * 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) int num_sectors)
{ {
if (end_that_request_first(req, uptodate, num_sectors)) __blk_end_request(req, error, num_sectors << 9);
return;
add_disk_randomness(req->rq_disk);
end_that_request_last(req, uptodate);
} }
/* /*
@ -374,12 +371,12 @@ static void do_viodasd_request(struct request_queue *q)
blkdev_dequeue_request(req); blkdev_dequeue_request(req);
/* check that request contains a valid command */ /* check that request contains a valid command */
if (!blk_fs_request(req)) { if (!blk_fs_request(req)) {
viodasd_end_request(req, 0, req->hard_nr_sectors); viodasd_end_request(req, -EIO, req->hard_nr_sectors);
continue; continue;
} }
/* Try sending the request */ /* Try sending the request */
if (send_request(req) != 0) if (send_request(req) != 0)
viodasd_end_request(req, 0, req->hard_nr_sectors); viodasd_end_request(req, -EIO, req->hard_nr_sectors);
} }
} }
@ -591,7 +588,7 @@ static int viodasd_handle_read_write(struct vioblocklpevent *bevent)
num_req_outstanding--; num_req_outstanding--;
spin_unlock_irqrestore(&viodasd_spinlock, irq_flags); spin_unlock_irqrestore(&viodasd_spinlock, irq_flags);
error = event->xRc != HvLpEvent_Rc_Good; error = (event->xRc == HvLpEvent_Rc_Good) ? 0 : -EIO;
if (error) { if (error) {
const struct vio_error_entry *err; const struct vio_error_entry *err;
err = vio_lookup_rc(viodasd_err_table, bevent->sub_result); err = vio_lookup_rc(viodasd_err_table, bevent->sub_result);
@ -601,7 +598,7 @@ static int viodasd_handle_read_write(struct vioblocklpevent *bevent)
} }
qlock = req->q->queue_lock; qlock = req->q->queue_lock;
spin_lock_irqsave(qlock, irq_flags); 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); spin_unlock_irqrestore(qlock, irq_flags);
/* Finally, try to get more requests off of this device's queue */ /* Finally, try to get more requests off of this device's queue */