aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/rbd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/rbd.c')
-rw-r--r--drivers/block/rbd.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index cb1db2979d3d..a8f4fe2d4d1b 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1183,14 +1183,14 @@ static struct bio *bio_clone_range(struct bio *bio_src,
1183 1183
1184 /* Handle the easy case for the caller */ 1184 /* Handle the easy case for the caller */
1185 1185
1186 if (!offset && len == bio_src->bi_size) 1186 if (!offset && len == bio_src->bi_iter.bi_size)
1187 return bio_clone(bio_src, gfpmask); 1187 return bio_clone(bio_src, gfpmask);
1188 1188
1189 if (WARN_ON_ONCE(!len)) 1189 if (WARN_ON_ONCE(!len))
1190 return NULL; 1190 return NULL;
1191 if (WARN_ON_ONCE(len > bio_src->bi_size)) 1191 if (WARN_ON_ONCE(len > bio_src->bi_iter.bi_size))
1192 return NULL; 1192 return NULL;
1193 if (WARN_ON_ONCE(offset > bio_src->bi_size - len)) 1193 if (WARN_ON_ONCE(offset > bio_src->bi_iter.bi_size - len))
1194 return NULL; 1194 return NULL;
1195 1195
1196 /* Find first affected segment... */ 1196 /* Find first affected segment... */
@@ -1220,7 +1220,8 @@ static struct bio *bio_clone_range(struct bio *bio_src,
1220 return NULL; /* ENOMEM */ 1220 return NULL; /* ENOMEM */
1221 1221
1222 bio->bi_bdev = bio_src->bi_bdev; 1222 bio->bi_bdev = bio_src->bi_bdev;
1223 bio->bi_sector = bio_src->bi_sector + (offset >> SECTOR_SHIFT); 1223 bio->bi_iter.bi_sector = bio_src->bi_iter.bi_sector +
1224 (offset >> SECTOR_SHIFT);
1224 bio->bi_rw = bio_src->bi_rw; 1225 bio->bi_rw = bio_src->bi_rw;
1225 bio->bi_flags |= 1 << BIO_CLONED; 1226 bio->bi_flags |= 1 << BIO_CLONED;
1226 1227
@@ -1239,8 +1240,7 @@ static struct bio *bio_clone_range(struct bio *bio_src,
1239 } 1240 }
1240 1241
1241 bio->bi_vcnt = vcnt; 1242 bio->bi_vcnt = vcnt;
1242 bio->bi_size = len; 1243 bio->bi_iter.bi_size = len;
1243 bio->bi_idx = 0;
1244 1244
1245 return bio; 1245 return bio;
1246} 1246}
@@ -1271,7 +1271,7 @@ static struct bio *bio_chain_clone_range(struct bio **bio_src,
1271 1271
1272 /* Build up a chain of clone bios up to the limit */ 1272 /* Build up a chain of clone bios up to the limit */
1273 1273
1274 if (!bi || off >= bi->bi_size || !len) 1274 if (!bi || off >= bi->bi_iter.bi_size || !len)
1275 return NULL; /* Nothing to clone */ 1275 return NULL; /* Nothing to clone */
1276 1276
1277 end = &chain; 1277 end = &chain;
@@ -1283,7 +1283,7 @@ static struct bio *bio_chain_clone_range(struct bio **bio_src,
1283 rbd_warn(NULL, "bio_chain exhausted with %u left", len); 1283 rbd_warn(NULL, "bio_chain exhausted with %u left", len);
1284 goto out_err; /* EINVAL; ran out of bio's */ 1284 goto out_err; /* EINVAL; ran out of bio's */
1285 } 1285 }
1286 bi_size = min_t(unsigned int, bi->bi_size - off, len); 1286 bi_size = min_t(unsigned int, bi->bi_iter.bi_size - off, len);
1287 bio = bio_clone_range(bi, off, bi_size, gfpmask); 1287 bio = bio_clone_range(bi, off, bi_size, gfpmask);
1288 if (!bio) 1288 if (!bio)
1289 goto out_err; /* ENOMEM */ 1289 goto out_err; /* ENOMEM */
@@ -1292,7 +1292,7 @@ static struct bio *bio_chain_clone_range(struct bio **bio_src,
1292 end = &bio->bi_next; 1292 end = &bio->bi_next;
1293 1293
1294 off += bi_size; 1294 off += bi_size;
1295 if (off == bi->bi_size) { 1295 if (off == bi->bi_iter.bi_size) {
1296 bi = bi->bi_next; 1296 bi = bi->bi_next;
1297 off = 0; 1297 off = 0;
1298 } 1298 }
@@ -2186,7 +2186,8 @@ static int rbd_img_request_fill(struct rbd_img_request *img_request,
2186 2186
2187 if (type == OBJ_REQUEST_BIO) { 2187 if (type == OBJ_REQUEST_BIO) {
2188 bio_list = data_desc; 2188 bio_list = data_desc;
2189 rbd_assert(img_offset == bio_list->bi_sector << SECTOR_SHIFT); 2189 rbd_assert(img_offset ==
2190 bio_list->bi_iter.bi_sector << SECTOR_SHIFT);
2190 } else { 2191 } else {
2191 rbd_assert(type == OBJ_REQUEST_PAGES); 2192 rbd_assert(type == OBJ_REQUEST_PAGES);
2192 pages = data_desc; 2193 pages = data_desc;