Commit e827091c authored by Ming Lei's avatar Ming Lei Committed by Jens Axboe

block: merge: get the 1st and last bvec via helpers

This patch applies the two introduced helpers to
figure out the 1st and last bvec.
Reviewed-by: default avatarSagi Grimberg <sagig@mellanox.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarMing Lei <ming.lei@canonical.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 25e71a99
...@@ -304,7 +304,6 @@ static int blk_phys_contig_segment(struct request_queue *q, struct bio *bio, ...@@ -304,7 +304,6 @@ static int blk_phys_contig_segment(struct request_queue *q, struct bio *bio,
struct bio *nxt) struct bio *nxt)
{ {
struct bio_vec end_bv = { NULL }, nxt_bv; struct bio_vec end_bv = { NULL }, nxt_bv;
struct bvec_iter iter;
if (!blk_queue_cluster(q)) if (!blk_queue_cluster(q))
return 0; return 0;
...@@ -316,11 +315,8 @@ static int blk_phys_contig_segment(struct request_queue *q, struct bio *bio, ...@@ -316,11 +315,8 @@ static int blk_phys_contig_segment(struct request_queue *q, struct bio *bio,
if (!bio_has_data(bio)) if (!bio_has_data(bio))
return 1; return 1;
bio_for_each_segment(end_bv, bio, iter) bio_get_last_bvec(bio, &end_bv);
if (end_bv.bv_len == iter.bi_size) bio_get_first_bvec(nxt, &nxt_bv);
break;
nxt_bv = bio_iovec(nxt);
if (!BIOVEC_PHYS_MERGEABLE(&end_bv, &nxt_bv)) if (!BIOVEC_PHYS_MERGEABLE(&end_bv, &nxt_bv))
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment