diff options
author | NeilBrown <neilb@suse.de> | 2007-09-25 06:35:59 -0400 |
---|---|---|
committer | Jens Axboe <axboe@carl.home.kernel.dk> | 2007-10-10 03:25:56 -0400 |
commit | 5705f7021748a69d84d6567e68e8851dab551464 (patch) | |
tree | 5a6dbc8fc6055c0334f4a97540e36a7844b9c482 /drivers/s390/char/tape_3590.c | |
parent | 9dfa52831e96194b8649613e3131baa2c109f7dc (diff) |
Introduce rq_for_each_segment replacing rq_for_each_bio
Every usage of rq_for_each_bio wraps a usage of
bio_for_each_segment, so these can be combined into
rq_for_each_segment.
We define "struct req_iterator" to hold the 'bio' and 'index' that
are needed for the double iteration.
Signed-off-by: Neil Brown <neilb@suse.de>
Various compile fixes by me...
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/s390/char/tape_3590.c')
-rw-r--r-- | drivers/s390/char/tape_3590.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/s390/char/tape_3590.c b/drivers/s390/char/tape_3590.c index 7e2b2ab49264..b16ad7a7631d 100644 --- a/drivers/s390/char/tape_3590.c +++ b/drivers/s390/char/tape_3590.c | |||
@@ -623,21 +623,19 @@ tape_3590_bread(struct tape_device *device, struct request *req) | |||
623 | { | 623 | { |
624 | struct tape_request *request; | 624 | struct tape_request *request; |
625 | struct ccw1 *ccw; | 625 | struct ccw1 *ccw; |
626 | int count = 0, start_block, i; | 626 | int count = 0, start_block; |
627 | unsigned off; | 627 | unsigned off; |
628 | char *dst; | 628 | char *dst; |
629 | struct bio_vec *bv; | 629 | struct bio_vec *bv; |
630 | struct bio *bio; | 630 | struct req_iterator iter; |
631 | 631 | ||
632 | DBF_EVENT(6, "xBREDid:"); | 632 | DBF_EVENT(6, "xBREDid:"); |
633 | start_block = req->sector >> TAPEBLOCK_HSEC_S2B; | 633 | start_block = req->sector >> TAPEBLOCK_HSEC_S2B; |
634 | DBF_EVENT(6, "start_block = %i\n", start_block); | 634 | DBF_EVENT(6, "start_block = %i\n", start_block); |
635 | 635 | ||
636 | rq_for_each_bio(bio, req) { | 636 | rq_for_each_segment(bv, req, iter) |
637 | bio_for_each_segment(bv, bio, i) { | 637 | count += bv->bv_len >> (TAPEBLOCK_HSEC_S2B + 9); |
638 | count += bv->bv_len >> (TAPEBLOCK_HSEC_S2B + 9); | 638 | |
639 | } | ||
640 | } | ||
641 | request = tape_alloc_request(2 + count + 1, 4); | 639 | request = tape_alloc_request(2 + count + 1, 4); |
642 | if (IS_ERR(request)) | 640 | if (IS_ERR(request)) |
643 | return request; | 641 | return request; |
@@ -653,8 +651,7 @@ tape_3590_bread(struct tape_device *device, struct request *req) | |||
653 | */ | 651 | */ |
654 | ccw = tape_ccw_cc(ccw, NOP, 0, NULL); | 652 | ccw = tape_ccw_cc(ccw, NOP, 0, NULL); |
655 | 653 | ||
656 | rq_for_each_bio(bio, req) { | 654 | rq_for_each_segment(bv, req, iter) { |
657 | bio_for_each_segment(bv, bio, i) { | ||
658 | dst = page_address(bv->bv_page) + bv->bv_offset; | 655 | dst = page_address(bv->bv_page) + bv->bv_offset; |
659 | for (off = 0; off < bv->bv_len; | 656 | for (off = 0; off < bv->bv_len; |
660 | off += TAPEBLOCK_HSEC_SIZE) { | 657 | off += TAPEBLOCK_HSEC_SIZE) { |
@@ -667,7 +664,6 @@ tape_3590_bread(struct tape_device *device, struct request *req) | |||
667 | } | 664 | } |
668 | if (off > bv->bv_len) | 665 | if (off > bv->bv_len) |
669 | BUG(); | 666 | BUG(); |
670 | } | ||
671 | } | 667 | } |
672 | ccw = tape_ccw_end(ccw, NOP, 0, NULL); | 668 | ccw = tape_ccw_end(ccw, NOP, 0, NULL); |
673 | DBF_EVENT(6, "xBREDccwg\n"); | 669 | DBF_EVENT(6, "xBREDccwg\n"); |