aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/tape_34xx.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2007-09-25 06:35:59 -0400
committerJens Axboe <axboe@carl.home.kernel.dk>2007-10-10 03:25:56 -0400
commit5705f7021748a69d84d6567e68e8851dab551464 (patch)
tree5a6dbc8fc6055c0334f4a97540e36a7844b9c482 /drivers/s390/char/tape_34xx.c
parent9dfa52831e96194b8649613e3131baa2c109f7dc (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_34xx.c')
-rw-r--r--drivers/s390/char/tape_34xx.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/s390/char/tape_34xx.c b/drivers/s390/char/tape_34xx.c
index 80e7a537e7d2..ea3e6a345c89 100644
--- a/drivers/s390/char/tape_34xx.c
+++ b/drivers/s390/char/tape_34xx.c
@@ -1134,21 +1134,18 @@ tape_34xx_bread(struct tape_device *device, struct request *req)
1134{ 1134{
1135 struct tape_request *request; 1135 struct tape_request *request;
1136 struct ccw1 *ccw; 1136 struct ccw1 *ccw;
1137 int count = 0, i; 1137 int count = 0;
1138 unsigned off; 1138 unsigned off;
1139 char *dst; 1139 char *dst;
1140 struct bio_vec *bv; 1140 struct bio_vec *bv;
1141 struct bio *bio; 1141 struct req_iterator iter;
1142 struct tape_34xx_block_id * start_block; 1142 struct tape_34xx_block_id * start_block;
1143 1143
1144 DBF_EVENT(6, "xBREDid:"); 1144 DBF_EVENT(6, "xBREDid:");
1145 1145
1146 /* Count the number of blocks for the request. */ 1146 /* Count the number of blocks for the request. */
1147 rq_for_each_bio(bio, req) { 1147 rq_for_each_segment(bv, req, iter)
1148 bio_for_each_segment(bv, bio, i) { 1148 count += bv->bv_len >> (TAPEBLOCK_HSEC_S2B + 9);
1149 count += bv->bv_len >> (TAPEBLOCK_HSEC_S2B + 9);
1150 }
1151 }
1152 1149
1153 /* Allocate the ccw request. */ 1150 /* Allocate the ccw request. */
1154 request = tape_alloc_request(3+count+1, 8); 1151 request = tape_alloc_request(3+count+1, 8);
@@ -1175,8 +1172,7 @@ tape_34xx_bread(struct tape_device *device, struct request *req)
1175 ccw = tape_ccw_cc(ccw, NOP, 0, NULL); 1172 ccw = tape_ccw_cc(ccw, NOP, 0, NULL);
1176 ccw = tape_ccw_cc(ccw, NOP, 0, NULL); 1173 ccw = tape_ccw_cc(ccw, NOP, 0, NULL);
1177 1174
1178 rq_for_each_bio(bio, req) { 1175 rq_for_each_segment(bv, req, iter) {
1179 bio_for_each_segment(bv, bio, i) {
1180 dst = kmap(bv->bv_page) + bv->bv_offset; 1176 dst = kmap(bv->bv_page) + bv->bv_offset;
1181 for (off = 0; off < bv->bv_len; 1177 for (off = 0; off < bv->bv_len;
1182 off += TAPEBLOCK_HSEC_SIZE) { 1178 off += TAPEBLOCK_HSEC_SIZE) {
@@ -1187,7 +1183,6 @@ tape_34xx_bread(struct tape_device *device, struct request *req)
1187 ccw++; 1183 ccw++;
1188 dst += TAPEBLOCK_HSEC_SIZE; 1184 dst += TAPEBLOCK_HSEC_SIZE;
1189 } 1185 }
1190 }
1191 } 1186 }
1192 1187
1193 ccw = tape_ccw_end(ccw, NOP, 0, NULL); 1188 ccw = tape_ccw_end(ccw, NOP, 0, NULL);