aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/block/dasd_eckd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/block/dasd_eckd.c')
-rw-r--r--drivers/s390/block/dasd_eckd.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index ea63ba7828f9..36ba45849874 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -1176,7 +1176,7 @@ dasd_eckd_build_cp(struct dasd_device * device, struct request *req)
1176 struct LO_eckd_data *LO_data; 1176 struct LO_eckd_data *LO_data;
1177 struct dasd_ccw_req *cqr; 1177 struct dasd_ccw_req *cqr;
1178 struct ccw1 *ccw; 1178 struct ccw1 *ccw;
1179 struct bio *bio; 1179 struct req_iterator iter;
1180 struct bio_vec *bv; 1180 struct bio_vec *bv;
1181 char *dst; 1181 char *dst;
1182 unsigned int blksize, blk_per_trk, off; 1182 unsigned int blksize, blk_per_trk, off;
@@ -1185,7 +1185,6 @@ dasd_eckd_build_cp(struct dasd_device * device, struct request *req)
1185 sector_t first_trk, last_trk; 1185 sector_t first_trk, last_trk;
1186 unsigned int first_offs, last_offs; 1186 unsigned int first_offs, last_offs;
1187 unsigned char cmd, rcmd; 1187 unsigned char cmd, rcmd;
1188 int i;
1189 1188
1190 private = (struct dasd_eckd_private *) device->private; 1189 private = (struct dasd_eckd_private *) device->private;
1191 if (rq_data_dir(req) == READ) 1190 if (rq_data_dir(req) == READ)
@@ -1206,8 +1205,7 @@ dasd_eckd_build_cp(struct dasd_device * device, struct request *req)
1206 /* Check struct bio and count the number of blocks for the request. */ 1205 /* Check struct bio and count the number of blocks for the request. */
1207 count = 0; 1206 count = 0;
1208 cidaw = 0; 1207 cidaw = 0;
1209 rq_for_each_bio(bio, req) { 1208 rq_for_each_segment(bv, req, iter) {
1210 bio_for_each_segment(bv, bio, i) {
1211 if (bv->bv_len & (blksize - 1)) 1209 if (bv->bv_len & (blksize - 1))
1212 /* Eckd can only do full blocks. */ 1210 /* Eckd can only do full blocks. */
1213 return ERR_PTR(-EINVAL); 1211 return ERR_PTR(-EINVAL);
@@ -1217,7 +1215,6 @@ dasd_eckd_build_cp(struct dasd_device * device, struct request *req)
1217 bv->bv_len)) 1215 bv->bv_len))
1218 cidaw += bv->bv_len >> (device->s2b_shift + 9); 1216 cidaw += bv->bv_len >> (device->s2b_shift + 9);
1219#endif 1217#endif
1220 }
1221 } 1218 }
1222 /* Paranoia. */ 1219 /* Paranoia. */
1223 if (count != last_rec - first_rec + 1) 1220 if (count != last_rec - first_rec + 1)
@@ -1257,7 +1254,7 @@ dasd_eckd_build_cp(struct dasd_device * device, struct request *req)
1257 locate_record(ccw++, LO_data++, first_trk, first_offs + 1, 1254 locate_record(ccw++, LO_data++, first_trk, first_offs + 1,
1258 last_rec - recid + 1, cmd, device, blksize); 1255 last_rec - recid + 1, cmd, device, blksize);
1259 } 1256 }
1260 rq_for_each_bio(bio, req) bio_for_each_segment(bv, bio, i) { 1257 rq_for_each_segment(bv, req, iter) {
1261 dst = page_address(bv->bv_page) + bv->bv_offset; 1258 dst = page_address(bv->bv_page) + bv->bv_offset;
1262 if (dasd_page_cache) { 1259 if (dasd_page_cache) {
1263 char *copy = kmem_cache_alloc(dasd_page_cache, 1260 char *copy = kmem_cache_alloc(dasd_page_cache,
@@ -1328,12 +1325,12 @@ dasd_eckd_free_cp(struct dasd_ccw_req *cqr, struct request *req)
1328{ 1325{
1329 struct dasd_eckd_private *private; 1326 struct dasd_eckd_private *private;
1330 struct ccw1 *ccw; 1327 struct ccw1 *ccw;
1331 struct bio *bio; 1328 struct req_iterator iter;
1332 struct bio_vec *bv; 1329 struct bio_vec *bv;
1333 char *dst, *cda; 1330 char *dst, *cda;
1334 unsigned int blksize, blk_per_trk, off; 1331 unsigned int blksize, blk_per_trk, off;
1335 sector_t recid; 1332 sector_t recid;
1336 int i, status; 1333 int status;
1337 1334
1338 if (!dasd_page_cache) 1335 if (!dasd_page_cache)
1339 goto out; 1336 goto out;
@@ -1346,7 +1343,7 @@ dasd_eckd_free_cp(struct dasd_ccw_req *cqr, struct request *req)
1346 ccw++; 1343 ccw++;
1347 if (private->uses_cdl == 0 || recid > 2*blk_per_trk) 1344 if (private->uses_cdl == 0 || recid > 2*blk_per_trk)
1348 ccw++; 1345 ccw++;
1349 rq_for_each_bio(bio, req) bio_for_each_segment(bv, bio, i) { 1346 rq_for_each_segment(bv, req, iter) {
1350 dst = page_address(bv->bv_page) + bv->bv_offset; 1347 dst = page_address(bv->bv_page) + bv->bv_offset;
1351 for (off = 0; off < bv->bv_len; off += blksize) { 1348 for (off = 0; off < bv->bv_len; off += blksize) {
1352 /* Skip locate record. */ 1349 /* Skip locate record. */