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


Groups > linux.kernel > #1582500 > unrolled thread

[PATCH 11/17] md: raid1: use bio helper in process_checks()

Started byMing Lei <tom.leiming@gmail.com>
First post2017-02-16 12:50 +0100
Last post2017-02-16 12:50 +0100
Articles 1 — 1 participant

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 11/17] md: raid1: use bio helper in process_checks() Ming Lei <tom.leiming@gmail.com> - 2017-02-16 12:50 +0100

#1582500 — [PATCH 11/17] md: raid1: use bio helper in process_checks()

FromMing Lei <tom.leiming@gmail.com>
Date2017-02-16 12:50 +0100
Subject[PATCH 11/17] md: raid1: use bio helper in process_checks()
Message-ID<tbsJs-5E4-21@gated-at.bofh.it>
Avoid to direct access to bvec table.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
 drivers/md/raid1.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 02ee8542295d..4400fbe7ce8c 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -2017,6 +2017,7 @@ static void process_checks(struct r1bio *r1_bio)
 		int j;
 		int size;
 		int error;
+		struct bio_vec *bi;
 		struct bio *b = r1_bio->bios[i];
 		if (b->bi_end_io != end_sync_read)
 			continue;
@@ -2033,9 +2034,7 @@ static void process_checks(struct r1bio *r1_bio)
 		b->bi_private = r1_bio;
 
 		size = b->bi_iter.bi_size;
-		for (j = 0; j < vcnt ; j++) {
-			struct bio_vec *bi;
-			bi = &b->bi_io_vec[j];
+		bio_for_each_segment_all(bi, b, j) {
 			bi->bv_offset = 0;
 			if (size > PAGE_SIZE)
 				bi->bv_len = PAGE_SIZE;
-- 
2.7.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web