diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-08-07 17:30:33 -0400 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2013-11-24 01:33:53 -0500 |
commit | f619d25460473788944e3b71b030398681e8809b (patch) | |
tree | f3dc82610bcb07d1c6dbe6faa8ed6170e6fea1e7 /include | |
parent | f38a5181d9f3e004b1f50f9d7e1f2a8492ce240a (diff) |
block: Kill bio_iovec_idx(), __bio_iovec()
bio_iovec_idx() and __bio_iovec() don't have any valid uses anymore -
previous users have been converted to bio_iovec_iter() or other methods.
__BVEC_END() has to go too - the bvec array can't be used directly for
the last biovec because we might only be using the first portion of it,
we have to iterate over the bvec array with bio_for_each_segment() which
checks against the current value of bi_iter.bi_size.
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Cc: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/bio.h | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h index aea9896a6289..1a31f9d9e057 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -61,9 +61,6 @@ | |||
61 | * various member access, note that bio_data should of course not be used | 61 | * various member access, note that bio_data should of course not be used |
62 | * on highmem page vectors | 62 | * on highmem page vectors |
63 | */ | 63 | */ |
64 | #define bio_iovec_idx(bio, idx) (&((bio)->bi_io_vec[(idx)])) | ||
65 | #define __bio_iovec(bio) bio_iovec_idx((bio), (bio)->bi_iter.bi_idx) | ||
66 | |||
67 | #define __bvec_iter_bvec(bvec, iter) (&(bvec)[(iter).bi_idx]) | 64 | #define __bvec_iter_bvec(bvec, iter) (&(bvec)[(iter).bi_idx]) |
68 | 65 | ||
69 | #define bvec_iter_page(bvec, iter) \ | 66 | #define bvec_iter_page(bvec, iter) \ |
@@ -162,19 +159,16 @@ static inline void *bio_data(struct bio *bio) | |||
162 | * permanent PIO fall back, user is probably better off disabling highmem | 159 | * permanent PIO fall back, user is probably better off disabling highmem |
163 | * I/O completely on that queue (see ide-dma for example) | 160 | * I/O completely on that queue (see ide-dma for example) |
164 | */ | 161 | */ |
165 | #define __bio_kmap_atomic(bio, idx) \ | 162 | #define __bio_kmap_atomic(bio, iter) \ |
166 | (kmap_atomic(bio_iovec_idx((bio), (idx))->bv_page) + \ | 163 | (kmap_atomic(bio_iter_iovec((bio), (iter)).bv_page) + \ |
167 | bio_iovec_idx((bio), (idx))->bv_offset) | 164 | bio_iter_iovec((bio), (iter)).bv_offset) |
168 | 165 | ||
169 | #define __bio_kunmap_atomic(addr) kunmap_atomic(addr) | 166 | #define __bio_kunmap_atomic(addr) kunmap_atomic(addr) |
170 | 167 | ||
171 | /* | 168 | /* |
172 | * merge helpers etc | 169 | * merge helpers etc |
173 | */ | 170 | */ |
174 | 171 | ||
175 | #define __BVEC_END(bio) bio_iovec_idx((bio), (bio)->bi_vcnt - 1) | ||
176 | #define __BVEC_START(bio) bio_iovec_idx((bio), (bio)->bi_iter.bi_idx) | ||
177 | |||
178 | /* Default implementation of BIOVEC_PHYS_MERGEABLE */ | 172 | /* Default implementation of BIOVEC_PHYS_MERGEABLE */ |
179 | #define __BIOVEC_PHYS_MERGEABLE(vec1, vec2) \ | 173 | #define __BIOVEC_PHYS_MERGEABLE(vec1, vec2) \ |
180 | ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2))) | 174 | ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2))) |
@@ -191,8 +185,6 @@ static inline void *bio_data(struct bio *bio) | |||
191 | (((addr1) | (mask)) == (((addr2) - 1) | (mask))) | 185 | (((addr1) | (mask)) == (((addr2) - 1) | (mask))) |
192 | #define BIOVEC_SEG_BOUNDARY(q, b1, b2) \ | 186 | #define BIOVEC_SEG_BOUNDARY(q, b1, b2) \ |
193 | __BIO_SEG_BOUNDARY(bvec_to_phys((b1)), bvec_to_phys((b2)) + (b2)->bv_len, queue_segment_boundary((q))) | 187 | __BIO_SEG_BOUNDARY(bvec_to_phys((b1)), bvec_to_phys((b2)) + (b2)->bv_len, queue_segment_boundary((q))) |
194 | #define BIO_SEG_BOUNDARY(q, b1, b2) \ | ||
195 | BIOVEC_SEG_BOUNDARY((q), __BVEC_END((b1)), __BVEC_START((b2))) | ||
196 | 188 | ||
197 | #define bio_io_error(bio) bio_endio((bio), -EIO) | 189 | #define bio_io_error(bio) bio_endio((bio), -EIO) |
198 | 190 | ||
@@ -201,9 +193,7 @@ static inline void *bio_data(struct bio *bio) | |||
201 | * before it got to the driver and the driver won't own all of it | 193 | * before it got to the driver and the driver won't own all of it |
202 | */ | 194 | */ |
203 | #define bio_for_each_segment_all(bvl, bio, i) \ | 195 | #define bio_for_each_segment_all(bvl, bio, i) \ |
204 | for (i = 0; \ | 196 | for (i = 0, bvl = (bio)->bi_io_vec; i < (bio)->bi_vcnt; i++, bvl++) |
205 | bvl = bio_iovec_idx((bio), (i)), i < (bio)->bi_vcnt; \ | ||
206 | i++) | ||
207 | 197 | ||
208 | static inline void bvec_iter_advance(struct bio_vec *bv, struct bvec_iter *iter, | 198 | static inline void bvec_iter_advance(struct bio_vec *bv, struct bvec_iter *iter, |
209 | unsigned bytes) | 199 | unsigned bytes) |
@@ -468,15 +458,15 @@ static inline void bvec_kunmap_irq(char *buffer, unsigned long *flags) | |||
468 | } | 458 | } |
469 | #endif | 459 | #endif |
470 | 460 | ||
471 | static inline char *__bio_kmap_irq(struct bio *bio, unsigned short idx, | 461 | static inline char *__bio_kmap_irq(struct bio *bio, struct bvec_iter iter, |
472 | unsigned long *flags) | 462 | unsigned long *flags) |
473 | { | 463 | { |
474 | return bvec_kmap_irq(bio_iovec_idx(bio, idx), flags); | 464 | return bvec_kmap_irq(&bio_iter_iovec(bio, iter), flags); |
475 | } | 465 | } |
476 | #define __bio_kunmap_irq(buf, flags) bvec_kunmap_irq(buf, flags) | 466 | #define __bio_kunmap_irq(buf, flags) bvec_kunmap_irq(buf, flags) |
477 | 467 | ||
478 | #define bio_kmap_irq(bio, flags) \ | 468 | #define bio_kmap_irq(bio, flags) \ |
479 | __bio_kmap_irq((bio), (bio)->bi_iter.bi_idx, (flags)) | 469 | __bio_kmap_irq((bio), (bio)->bi_iter, (flags)) |
480 | #define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags) | 470 | #define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags) |
481 | 471 | ||
482 | /* | 472 | /* |