diff options
Diffstat (limited to 'drivers/s390/char/tape_34xx.c')
-rw-r--r-- | drivers/s390/char/tape_34xx.c | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/drivers/s390/char/tape_34xx.c b/drivers/s390/char/tape_34xx.c index 80e7a537e7d2..5b47e9cce75f 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,18 +1172,15 @@ 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) { | 1176 | dst = kmap(bv->bv_page) + bv->bv_offset; |
1180 | dst = kmap(bv->bv_page) + bv->bv_offset; | 1177 | for (off = 0; off < bv->bv_len; off += TAPEBLOCK_HSEC_SIZE) { |
1181 | for (off = 0; off < bv->bv_len; | 1178 | ccw->flags = CCW_FLAG_CC; |
1182 | off += TAPEBLOCK_HSEC_SIZE) { | 1179 | ccw->cmd_code = READ_FORWARD; |
1183 | ccw->flags = CCW_FLAG_CC; | 1180 | ccw->count = TAPEBLOCK_HSEC_SIZE; |
1184 | ccw->cmd_code = READ_FORWARD; | 1181 | set_normalized_cda(ccw, (void*) __pa(dst)); |
1185 | ccw->count = TAPEBLOCK_HSEC_SIZE; | 1182 | ccw++; |
1186 | set_normalized_cda(ccw, (void*) __pa(dst)); | 1183 | dst += TAPEBLOCK_HSEC_SIZE; |
1187 | ccw++; | ||
1188 | dst += TAPEBLOCK_HSEC_SIZE; | ||
1189 | } | ||
1190 | } | 1184 | } |
1191 | } | 1185 | } |
1192 | 1186 | ||