Skip to content

Commit

Permalink
block: merge: get the 1st and last bvec via helpers
Browse files Browse the repository at this point in the history
This patch applies the two introduced helpers to
figure out the 1st and last bvec.

Reviewed-by: Sagi Grimberg <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Ming Lei authored and axboe committed Mar 3, 2016
1 parent 25e71a9 commit e827091
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions block/blk-merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,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;
Expand All @@ -316,11 +315,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;
Expand Down

0 comments on commit e827091

Please sign in to comment.