From patchwork Tue Dec 27 16:04:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9489597 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6D100601D2 for ; Tue, 27 Dec 2016 16:12:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FAD0201BC for ; Tue, 27 Dec 2016 16:12:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 53FC525D99; Tue, 27 Dec 2016 16:12:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EED50201BC for ; Tue, 27 Dec 2016 16:12:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932904AbcL0QGV (ORCPT ); Tue, 27 Dec 2016 11:06:21 -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 Received: by mail-pg0-f67.google.com with SMTP id i5so12802055pgh.2; Tue, 27 Dec 2016 08:06:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AtEfIUTvNmxwFInMDldbsoC+SZIEzecSJB/whw5w3Ow=; b=dEYtUEs7PxQ0oiZl5j01eWRTnsJGZj1ti4o/N79bmxGepJz3/w9MLRpGNMcvr0x3eq H84I1aGbzuIyCmEn1FiGhdb/pqHkkHygNfez8BfqM/wdikcYsBOSvFDloDZ61BGzl8NQ Ub10WPlosPVMm8ivzIubXJTqmUKpG8f7iBgGJm8oHpFi3Wu5OhJeoy92nwGEc+PAWATV MeiZofT+icSszz98LbQXhR0He18cq/+ZvjeNl2iLMDOEmGo9fey2WDFsIUUuAjt5SihF +yQ0THWE1iqWF5a9IwwW+rh4FfxHjMediX3Qk4GM6a0Q30hH3yzhCtWyVpEXQTdZa4Ul /Sdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AtEfIUTvNmxwFInMDldbsoC+SZIEzecSJB/whw5w3Ow=; b=jqAxTzDgaZRQy7M3zjcms0KiWuw4XuOaYz9A3ZepM5UMVJ9Ip/tjB3WB3HWQFx01DF 9Zcgb/+yNt0CzuWbbz9Cix7qOzUkvgbG/3CgAUxeSABFdmuudIVTQI92ZmXKSPiZ8AqD tefwUGiwzaa8nP3aEttmUwtJqvfnNTqx5wxUm7tmtIZgLaqQAKdMkLwdDYwjAT4s5gNG vYlyPSlLrDbI98cXqW6TuUARYPPLmR9xl6eKZdL6bZiXO/zdXY5v8qF9FunVg5UmFg1h TzImOYSOo4KoITmFgAtTxgszPtYyiHFMB++YwDT/cADhA/aJ6s0Q2vpfxtPRc7Ah7qLa fwyg== X-Gm-Message-State: AIkVDXJuNAziwSp/ITCjh3ypz24SUG7U+S5hyg0DA7itC+XJJ0V/s9n+VeEUfovHZOf5zw== X-Received: by 10.84.218.204 with SMTP id g12mr66803913plm.78.1482854765086; Tue, 27 Dec 2016 08:06:05 -0800 (PST) Received: from localhost ([45.35.47.137]) by smtp.gmail.com with ESMTPSA id s136sm30211458pgs.46.2016.12.27.08.06.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Dec 2016 08:06:04 -0800 (PST) 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-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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))