]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
block: merge: get the 1st and last bvec via helpers
authorMing Lei <ming.lei@canonical.com>
Fri, 26 Feb 2016 15:40:53 +0000 (23:40 +0800)
committerBrian Maly <brian.maly@oracle.com>
Mon, 23 Apr 2018 22:29:41 +0000 (18:29 -0400)
This patch applies the two introduced helpers to
figure out the 1st and last bvec.

Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit e827091cb1bcd8e718ac3657845fb809c0b93324)

Orabug: 27775588

Signed-off-by: Shan Hai <shan.hai@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
block/blk-merge.c

index 8fbe79829d79b2815956db41dfb87eada3a0af21..de471fe17d20bf90d73e8c9cc69dfa003caf86bf 100644 (file)
@@ -124,7 +124,6 @@ static int blk_phys_contig_segment(struct request_queue *q, struct bio *bio,
                                   struct bio *nxt)
 {
        struct bio_vec end_bv = { NULL }, nxt_bv;
-       struct bvec_iter iter;
 
        if (!blk_queue_cluster(q))
                return 0;
@@ -136,11 +135,8 @@ static int blk_phys_contig_segment(struct request_queue *q, struct bio *bio,
        if (!bio_has_data(bio))
                return 1;
 
-       bio_for_each_segment(end_bv, bio, iter)
-               if (end_bv.bv_len == iter.bi_size)
-                       break;
-
-       nxt_bv = bio_iovec(nxt);
+       bio_get_last_bvec(bio, &end_bv);
+       bio_get_first_bvec(nxt, &nxt_bv);
 
        if (!BIOVEC_PHYS_MERGEABLE(&end_bv, &nxt_bv))
                return 0;