Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1337862 > unrolled thread

[PATCH v1 4/4] block: merge: get the 1st and last bvec via helpers

Started byMing Lei <ming.lei@canonical.com>
First post2016-02-19 04:30 +0100
Last post2016-02-22 10:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v1 4/4] block: merge: get the 1st and last bvec via helpers Ming Lei <ming.lei@canonical.com> - 2016-02-19 04:30 +0100
    Re: [PATCH v1 4/4] block: merge: get the 1st and last bvec via  helpers Christoph Hellwig <hch@infradead.org> - 2016-02-22 10:10 +0100

#1337862 — [PATCH v1 4/4] block: merge: get the 1st and last bvec via helpers

FromMing Lei <ming.lei@canonical.com>
Date2016-02-19 04:30 +0100
Subject[PATCH v1 4/4] block: merge: get the 1st and last bvec via helpers
Message-ID<r3JVw-7eK-17@gated-at.bofh.it>
This patch applies the two introduced helpers to
figure out the 1st and last bvec.

Cc: Sagi Grimberg <sagig@dev.mellanox.co.il>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
 block/blk-merge.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/block/blk-merge.c b/block/blk-merge.c
index 888a7fe..2613531 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -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;
@@ -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;
-- 
1.9.1

[toc] | [next] | [standalone]


#1339232 — Re: [PATCH v1 4/4] block: merge: get the 1st and last bvec via helpers

FromChristoph Hellwig <hch@infradead.org>
Date2016-02-22 10:10 +0100
SubjectRe: [PATCH v1 4/4] block: merge: get the 1st and last bvec via helpers
Message-ID<r4UFb-3lW-3@gated-at.bofh.it>
In reply to#1337862
Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web