aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKiyoshi Ueda <k-ueda@ct.jp.nec.com>2007-12-11 17:47:52 -0500
committerJens Axboe <jens.axboe@oracle.com>2008-01-28 04:36:48 -0500
commite935eb9dba66ce2533d06e459cf5bbfc17c9318b (patch)
tree34d2754f6d22f8fdbdef56ad07433800a79cd6ee
parentf530f036378421fb0b59bb829a8097a50bca79e2 (diff)
blk_end_request: changing viocd (take 4)
This patch converts viocd to use blk_end_request interfaces. Related 'uptodate' arguments are converted to 'error'. As a result, the interface of internal function, viocd_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>
-rw-r--r--drivers/cdrom/viocd.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/cdrom/viocd.c b/drivers/cdrom/viocd.c
index d8bb44b98a6a..8473b9f1da96 100644
--- a/drivers/cdrom/viocd.c
+++ b/drivers/cdrom/viocd.c
@@ -289,7 +289,7 @@ static int send_request(struct request *req)
289 return 0; 289 return 0;
290} 290}
291 291
292static void viocd_end_request(struct request *req, int uptodate) 292static void viocd_end_request(struct request *req, int error)
293{ 293{
294 int nsectors = req->hard_nr_sectors; 294 int nsectors = req->hard_nr_sectors;
295 295
@@ -302,11 +302,8 @@ static void viocd_end_request(struct request *req, int uptodate)
302 if (!nsectors) 302 if (!nsectors)
303 nsectors = 1; 303 nsectors = 1;
304 304
305 if (end_that_request_first(req, uptodate, nsectors)) 305 if (__blk_end_request(req, error, nsectors << 9))
306 BUG(); 306 BUG();
307 add_disk_randomness(req->rq_disk);
308 blkdev_dequeue_request(req);
309 end_that_request_last(req, uptodate);
310} 307}
311 308
312static int rwreq; 309static int rwreq;
@@ -317,11 +314,11 @@ static void do_viocd_request(struct request_queue *q)
317 314
318 while ((rwreq == 0) && ((req = elv_next_request(q)) != NULL)) { 315 while ((rwreq == 0) && ((req = elv_next_request(q)) != NULL)) {
319 if (!blk_fs_request(req)) 316 if (!blk_fs_request(req))
320 viocd_end_request(req, 0); 317 viocd_end_request(req, -EIO);
321 else if (send_request(req) < 0) { 318 else if (send_request(req) < 0) {
322 printk(VIOCD_KERN_WARNING 319 printk(VIOCD_KERN_WARNING
323 "unable to send message to OS/400!"); 320 "unable to send message to OS/400!");
324 viocd_end_request(req, 0); 321 viocd_end_request(req, -EIO);
325 } else 322 } else
326 rwreq++; 323 rwreq++;
327 } 324 }
@@ -532,9 +529,9 @@ return_complete:
532 "with rc %d:0x%04X: %s\n", 529 "with rc %d:0x%04X: %s\n",
533 req, event->xRc, 530 req, event->xRc,
534 bevent->sub_result, err->msg); 531 bevent->sub_result, err->msg);
535 viocd_end_request(req, 0); 532 viocd_end_request(req, -EIO);
536 } else 533 } else
537 viocd_end_request(req, 1); 534 viocd_end_request(req, 0);
538 535
539 /* restart handling of incoming requests */ 536 /* restart handling of incoming requests */
540 spin_unlock_irqrestore(&viocd_reqlock, flags); 537 spin_unlock_irqrestore(&viocd_reqlock, flags);