diff options
author | Tejun Heo <tj@kernel.org> | 2009-04-22 22:05:19 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-04-28 01:37:36 -0400 |
commit | f06d9a2b52e246a66b606130cea3f0d7b7be17a7 (patch) | |
tree | 020df1f9d54b00c72d8af02ac0827d496597e75a /drivers/block/mg_disk.c | |
parent | 40cbbb781d3eba5d6ac0860db078af490e5c7c6b (diff) |
block: replace end_request() with [__]blk_end_request_cur()
end_request() has been kept around for backward compatibility;
however, it's about time for it to go away.
* There aren't too many users left.
* Its use of @updtodate is pretty confusing.
* In some cases, newer code ends up using mixture of end_request() and
[__]blk_end_request[_all](), which is way too confusing.
So, add [__]blk_end_request_cur() and replace end_request() with it.
Most conversions are straightforward. Noteworthy ones are...
* paride/pcd: next_request() updated to take 0/-errno instead of 1/0.
* paride/pf: pf_end_request() and next_request() updated to take
0/-errno instead of 1/0.
* xd: xd_readwrite() updated to return 0/-errno instead of 1/0.
* mtd/mtd_blkdevs: blktrans_discard_request() updated to return
0/-errno instead of 1/0. Unnecessary local variable res
initialization removed from mtd_blktrans_thread().
[ Impact: cleanup ]
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Joerg Dorchain <joerg@dorchain.net>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Laurent Vivier <Laurent@lvivier.info>
Cc: Tim Waugh <tim@cyberelk.net>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Markus Lidel <Markus.Lidel@shadowconnect.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Cc: unsik Kim <donari75@gmail.com>
Diffstat (limited to 'drivers/block/mg_disk.c')
-rw-r--r-- | drivers/block/mg_disk.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/block/mg_disk.c b/drivers/block/mg_disk.c index f3898353d0a8..408c2bd8a439 100644 --- a/drivers/block/mg_disk.c +++ b/drivers/block/mg_disk.c | |||
@@ -285,7 +285,7 @@ static void mg_bad_rw_intr(struct mg_host *host) | |||
285 | if (req != NULL) | 285 | if (req != NULL) |
286 | if (++req->errors >= MG_MAX_ERRORS || | 286 | if (++req->errors >= MG_MAX_ERRORS || |
287 | host->error == MG_ERR_TIMEOUT) | 287 | host->error == MG_ERR_TIMEOUT) |
288 | end_request(req, 0); | 288 | __blk_end_request_cur(req, -EIO); |
289 | } | 289 | } |
290 | 290 | ||
291 | static unsigned int mg_out(struct mg_host *host, | 291 | static unsigned int mg_out(struct mg_host *host, |
@@ -351,7 +351,7 @@ static void mg_read(struct request *req) | |||
351 | 351 | ||
352 | if (req->current_nr_sectors <= 0) { | 352 | if (req->current_nr_sectors <= 0) { |
353 | MG_DBG("remain : %d sects\n", remains); | 353 | MG_DBG("remain : %d sects\n", remains); |
354 | end_request(req, 1); | 354 | __blk_end_request_cur(req, 0); |
355 | if (remains > 0) | 355 | if (remains > 0) |
356 | req = elv_next_request(host->breq); | 356 | req = elv_next_request(host->breq); |
357 | } | 357 | } |
@@ -395,7 +395,7 @@ static void mg_write(struct request *req) | |||
395 | 395 | ||
396 | if (req->current_nr_sectors <= 0) { | 396 | if (req->current_nr_sectors <= 0) { |
397 | MG_DBG("remain : %d sects\n", remains); | 397 | MG_DBG("remain : %d sects\n", remains); |
398 | end_request(req, 1); | 398 | __blk_end_request_cur(req, 0); |
399 | if (remains > 0) | 399 | if (remains > 0) |
400 | req = elv_next_request(host->breq); | 400 | req = elv_next_request(host->breq); |
401 | } | 401 | } |
@@ -448,7 +448,7 @@ ok_to_read: | |||
448 | 448 | ||
449 | /* let know if current segment done */ | 449 | /* let know if current segment done */ |
450 | if (req->current_nr_sectors <= 0) | 450 | if (req->current_nr_sectors <= 0) |
451 | end_request(req, 1); | 451 | __blk_end_request_cur(req, 0); |
452 | 452 | ||
453 | /* set handler if read remains */ | 453 | /* set handler if read remains */ |
454 | if (i > 0) { | 454 | if (i > 0) { |
@@ -497,7 +497,7 @@ ok_to_write: | |||
497 | 497 | ||
498 | /* let know if current segment or all done */ | 498 | /* let know if current segment or all done */ |
499 | if (!i || (req->bio && req->current_nr_sectors <= 0)) | 499 | if (!i || (req->bio && req->current_nr_sectors <= 0)) |
500 | end_request(req, 1); | 500 | __blk_end_request_cur(req, 0); |
501 | 501 | ||
502 | /* write 1 sector and set handler if remains */ | 502 | /* write 1 sector and set handler if remains */ |
503 | if (i > 0) { | 503 | if (i > 0) { |
@@ -563,7 +563,7 @@ static void mg_request_poll(struct request_queue *q) | |||
563 | default: | 563 | default: |
564 | printk(KERN_WARNING "%s:%d unknown command\n", | 564 | printk(KERN_WARNING "%s:%d unknown command\n", |
565 | __func__, __LINE__); | 565 | __func__, __LINE__); |
566 | end_request(req, 0); | 566 | __blk_end_request_cur(req, -EIO); |
567 | break; | 567 | break; |
568 | } | 568 | } |
569 | } | 569 | } |
@@ -617,7 +617,7 @@ static unsigned int mg_issue_req(struct request *req, | |||
617 | default: | 617 | default: |
618 | printk(KERN_WARNING "%s:%d unknown command\n", | 618 | printk(KERN_WARNING "%s:%d unknown command\n", |
619 | __func__, __LINE__); | 619 | __func__, __LINE__); |
620 | end_request(req, 0); | 620 | __blk_end_request_cur(req, -EIO); |
621 | break; | 621 | break; |
622 | } | 622 | } |
623 | return MG_ERR_NONE; | 623 | return MG_ERR_NONE; |
@@ -655,7 +655,7 @@ static void mg_request(struct request_queue *q) | |||
655 | "%s: bad access: sector=%d, count=%d\n", | 655 | "%s: bad access: sector=%d, count=%d\n", |
656 | req->rq_disk->disk_name, | 656 | req->rq_disk->disk_name, |
657 | sect_num, sect_cnt); | 657 | sect_num, sect_cnt); |
658 | end_request(req, 0); | 658 | __blk_end_request_cur(req, -EIO); |
659 | continue; | 659 | continue; |
660 | } | 660 | } |
661 | 661 | ||