diff options
Diffstat (limited to 'drivers/md/bcache/io.c')
-rw-r--r-- | drivers/md/bcache/io.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/md/bcache/io.c b/drivers/md/bcache/io.c index 9056632995b1..cc4ba2da5fb6 100644 --- a/drivers/md/bcache/io.c +++ b/drivers/md/bcache/io.c | |||
@@ -21,18 +21,18 @@ static void bch_bi_idx_hack_endio(struct bio *bio, int error) | |||
21 | 21 | ||
22 | static void bch_generic_make_request_hack(struct bio *bio) | 22 | static void bch_generic_make_request_hack(struct bio *bio) |
23 | { | 23 | { |
24 | if (bio->bi_idx) { | 24 | if (bio->bi_iter.bi_idx) { |
25 | struct bio *clone = bio_alloc(GFP_NOIO, bio_segments(bio)); | 25 | struct bio *clone = bio_alloc(GFP_NOIO, bio_segments(bio)); |
26 | 26 | ||
27 | memcpy(clone->bi_io_vec, | 27 | memcpy(clone->bi_io_vec, |
28 | bio_iovec(bio), | 28 | bio_iovec(bio), |
29 | bio_segments(bio) * sizeof(struct bio_vec)); | 29 | bio_segments(bio) * sizeof(struct bio_vec)); |
30 | 30 | ||
31 | clone->bi_sector = bio->bi_sector; | 31 | clone->bi_iter.bi_sector = bio->bi_iter.bi_sector; |
32 | clone->bi_bdev = bio->bi_bdev; | 32 | clone->bi_bdev = bio->bi_bdev; |
33 | clone->bi_rw = bio->bi_rw; | 33 | clone->bi_rw = bio->bi_rw; |
34 | clone->bi_vcnt = bio_segments(bio); | 34 | clone->bi_vcnt = bio_segments(bio); |
35 | clone->bi_size = bio->bi_size; | 35 | clone->bi_iter.bi_size = bio->bi_iter.bi_size; |
36 | 36 | ||
37 | clone->bi_private = bio; | 37 | clone->bi_private = bio; |
38 | clone->bi_end_io = bch_bi_idx_hack_endio; | 38 | clone->bi_end_io = bch_bi_idx_hack_endio; |
@@ -72,7 +72,7 @@ static void bch_generic_make_request_hack(struct bio *bio) | |||
72 | struct bio *bch_bio_split(struct bio *bio, int sectors, | 72 | struct bio *bch_bio_split(struct bio *bio, int sectors, |
73 | gfp_t gfp, struct bio_set *bs) | 73 | gfp_t gfp, struct bio_set *bs) |
74 | { | 74 | { |
75 | unsigned idx = bio->bi_idx, vcnt = 0, nbytes = sectors << 9; | 75 | unsigned idx = bio->bi_iter.bi_idx, vcnt = 0, nbytes = sectors << 9; |
76 | struct bio_vec *bv; | 76 | struct bio_vec *bv; |
77 | struct bio *ret = NULL; | 77 | struct bio *ret = NULL; |
78 | 78 | ||
@@ -90,7 +90,7 @@ struct bio *bch_bio_split(struct bio *bio, int sectors, | |||
90 | } | 90 | } |
91 | 91 | ||
92 | bio_for_each_segment(bv, bio, idx) { | 92 | bio_for_each_segment(bv, bio, idx) { |
93 | vcnt = idx - bio->bi_idx; | 93 | vcnt = idx - bio->bi_iter.bi_idx; |
94 | 94 | ||
95 | if (!nbytes) { | 95 | if (!nbytes) { |
96 | ret = bio_alloc_bioset(gfp, vcnt, bs); | 96 | ret = bio_alloc_bioset(gfp, vcnt, bs); |
@@ -119,15 +119,15 @@ struct bio *bch_bio_split(struct bio *bio, int sectors, | |||
119 | } | 119 | } |
120 | out: | 120 | out: |
121 | ret->bi_bdev = bio->bi_bdev; | 121 | ret->bi_bdev = bio->bi_bdev; |
122 | ret->bi_sector = bio->bi_sector; | 122 | ret->bi_iter.bi_sector = bio->bi_iter.bi_sector; |
123 | ret->bi_size = sectors << 9; | 123 | ret->bi_iter.bi_size = sectors << 9; |
124 | ret->bi_rw = bio->bi_rw; | 124 | ret->bi_rw = bio->bi_rw; |
125 | ret->bi_vcnt = vcnt; | 125 | ret->bi_vcnt = vcnt; |
126 | ret->bi_max_vecs = vcnt; | 126 | ret->bi_max_vecs = vcnt; |
127 | 127 | ||
128 | bio->bi_sector += sectors; | 128 | bio->bi_iter.bi_sector += sectors; |
129 | bio->bi_size -= sectors << 9; | 129 | bio->bi_iter.bi_size -= sectors << 9; |
130 | bio->bi_idx = idx; | 130 | bio->bi_iter.bi_idx = idx; |
131 | 131 | ||
132 | if (bio_integrity(bio)) { | 132 | if (bio_integrity(bio)) { |
133 | if (bio_integrity_clone(ret, bio, gfp)) { | 133 | if (bio_integrity_clone(ret, bio, gfp)) { |
@@ -162,7 +162,7 @@ static unsigned bch_bio_max_sectors(struct bio *bio) | |||
162 | bio_for_each_segment(bv, bio, i) { | 162 | bio_for_each_segment(bv, bio, i) { |
163 | struct bvec_merge_data bvm = { | 163 | struct bvec_merge_data bvm = { |
164 | .bi_bdev = bio->bi_bdev, | 164 | .bi_bdev = bio->bi_bdev, |
165 | .bi_sector = bio->bi_sector, | 165 | .bi_sector = bio->bi_iter.bi_sector, |
166 | .bi_size = ret << 9, | 166 | .bi_size = ret << 9, |
167 | .bi_rw = bio->bi_rw, | 167 | .bi_rw = bio->bi_rw, |
168 | }; | 168 | }; |
@@ -272,8 +272,8 @@ void __bch_submit_bbio(struct bio *bio, struct cache_set *c) | |||
272 | { | 272 | { |
273 | struct bbio *b = container_of(bio, struct bbio, bio); | 273 | struct bbio *b = container_of(bio, struct bbio, bio); |
274 | 274 | ||
275 | bio->bi_sector = PTR_OFFSET(&b->key, 0); | 275 | bio->bi_iter.bi_sector = PTR_OFFSET(&b->key, 0); |
276 | bio->bi_bdev = PTR_CACHE(c, &b->key, 0)->bdev; | 276 | bio->bi_bdev = PTR_CACHE(c, &b->key, 0)->bdev; |
277 | 277 | ||
278 | b->submit_time_us = local_clock_us(); | 278 | b->submit_time_us = local_clock_us(); |
279 | closure_bio_submit(bio, bio->bi_private, PTR_CACHE(c, &b->key, 0)); | 279 | closure_bio_submit(bio, bio->bi_private, PTR_CACHE(c, &b->key, 0)); |