Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932982AbcL0QGq (ORCPT ); Tue, 27 Dec 2016 11:06:46 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:35742 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932642AbcL0QGL (ORCPT ); Tue, 27 Dec 2016 11:06:11 -0500 From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, Christoph Hellwig , Ming Lei , Shaohua Li , linux-raid@vger.kernel.org (open list:SOFTWARE RAID (Multiple Disks) SUPPORT) Subject: [PATCH v1 38/54] md/raid1.c: convert to bio_for_each_segment_all_sp() Date: Wed, 28 Dec 2016 00:04:47 +0800 Message-Id: <1482854706-14128-7-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482854706-14128-1-git-send-email-tom.leiming@gmail.com> References: <1482854706-14128-1-git-send-email-tom.leiming@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 760 Lines: 26 Signed-off-by: Ming Lei --- drivers/md/raid1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index a1f3fbed9100..4818f40e7ce9 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -988,12 +988,13 @@ static void alloc_behind_pages(struct bio *bio, struct r1bio *r1_bio) { int i; struct bio_vec *bvec; + struct bvec_iter_all bia; struct bio_vec *bvecs = kzalloc(bio->bi_vcnt * sizeof(struct bio_vec), GFP_NOIO); if (unlikely(!bvecs)) return; - bio_for_each_segment_all(bvec, bio, i) { + bio_for_each_segment_all_sp(bvec, bio, i, bia) { bvecs[i] = *bvec; bvecs[i].bv_page = alloc_page(GFP_NOIO); if (unlikely(!bvecs[i].bv_page)) -- 2.7.4