aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorKent Overstreet <kmo@daterainc.com>2013-08-07 17:30:33 -0400
committerKent Overstreet <kmo@daterainc.com>2013-11-24 01:33:53 -0500
commitf619d25460473788944e3b71b030398681e8809b (patch)
treef3dc82610bcb07d1c6dbe6faa8ed6170e6fea1e7 /block
parentf38a5181d9f3e004b1f50f9d7e1f2a8492ce240a (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 'block')
-rw-r--r--block/blk-merge.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/block/blk-merge.c b/block/blk-merge.c
index a1ead9049ed6..05c17be0eea4 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -86,6 +86,9 @@ EXPORT_SYMBOL(blk_recount_segments);
86static int blk_phys_contig_segment(struct request_queue *q, struct bio *bio, 86static int blk_phys_contig_segment(struct request_queue *q, struct bio *bio,
87 struct bio *nxt) 87 struct bio *nxt)
88{ 88{
89 struct bio_vec end_bv, nxt_bv;
90 struct bvec_iter iter;
91
89 if (!blk_queue_cluster(q)) 92 if (!blk_queue_cluster(q))
90 return 0; 93 return 0;
91 94
@@ -96,14 +99,20 @@ static int blk_phys_contig_segment(struct request_queue *q, struct bio *bio,
96 if (!bio_has_data(bio)) 99 if (!bio_has_data(bio))
97 return 1; 100 return 1;
98 101
99 if (!BIOVEC_PHYS_MERGEABLE(__BVEC_END(bio), __BVEC_START(nxt))) 102 bio_for_each_segment(end_bv, bio, iter)
103 if (end_bv.bv_len == iter.bi_size)
104 break;
105
106 nxt_bv = bio_iovec(nxt);
107
108 if (!BIOVEC_PHYS_MERGEABLE(&end_bv, &nxt_bv))
100 return 0; 109 return 0;
101 110
102 /* 111 /*
103 * bio and nxt are contiguous in memory; check if the queue allows 112 * bio and nxt are contiguous in memory; check if the queue allows
104 * these two to be merged into one 113 * these two to be merged into one
105 */ 114 */
106 if (BIO_SEG_BOUNDARY(q, bio, nxt)) 115 if (BIOVEC_SEG_BOUNDARY(q, &end_bv, &nxt_bv))
107 return 1; 116 return 1;
108 117
109 return 0; 118 return 0;