From patchwork Thu Feb 16 11:45:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9576937 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 C6EDD60586 for ; Thu, 16 Feb 2017 11:48:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C53552855B for ; Thu, 16 Feb 2017 11:48:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B9F1C28546; Thu, 16 Feb 2017 11:48:33 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable 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 755B12855B for ; Thu, 16 Feb 2017 11:48:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932203AbdBPLq7 (ORCPT ); Thu, 16 Feb 2017 06:46:59 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:35330 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932168AbdBPLq4 (ORCPT ); Thu, 16 Feb 2017 06:46:56 -0500 Received: by mail-pg0-f65.google.com with SMTP id y6so725820pgy.2; Thu, 16 Feb 2017 03:46:55 -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=IG7JSnHksZqX8XP7SrNX4mjJ2iJS752mDGLnqnXX5Q0=; b=BnVSiZkblkhGcUOU6f0TkKKP56u16ZLtWlFrh/D+VU1Pdj4tqbiqYxEqVx9Ldosjoj W/w/Uth0dRcx98qdC5+2VVe5COjnze+p8dOJ6Mq1dbPrr3n8PLczW9JxKQ//wU30SyBO GcZ6/H7C7paOVqQ2wMu+eFltzro/5/YjE/9NTYnfkMYV0rtwEsnlqXIhk+cYC3THmAW5 JwUxM4393OdPVnLEFw0eUgO/RLlN99PcABUpycH/N9x3DsY8h6iiXQ76ImRoOK4jQGw+ 4kv8Z928HB19rYt5J49OpjRAggrbZSsj/DAULrp1c6NNvoQMQqGucxBxOqx+BbLUsyDv G7mw== 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=IG7JSnHksZqX8XP7SrNX4mjJ2iJS752mDGLnqnXX5Q0=; b=qZmx+O/CVX9Bdix24uiRvsYBBEFVJeSL1heFSKYYsLCSC8J2u8rioKEoGP72ESWroG JBh1LFWqt7PqDPBs+DDM0ah5r1JPzo+Pzrba5xpP5tmvjNtPXVlQu0rJ1XDnU+m8ISBv BtDRpeegTTOfXWU7Sj7+j0CEAwApbjk9sy0E7/rClwX1G6xBfZfoFskA36PDTPSvcfOb Z9Pp1/MmcZqR/pdMcr5b+okU1B8dPjjnqXHFBN/3kQn96ITjzp/juwdHNSAvvpt8wWad CxLPnafAId1oeOxuKhijGpgDCWCcrwowbtk3ZraGOAsI3xOhhcvXL2AbiPwipwXRwCs0 l1xw== X-Gm-Message-State: AMke39nSkojMkaYXwGZ15UhpE+hJxRHHytSZ9Acj/k0pH1FX9sUYaKEQ+ic8MnYg8lG59A== X-Received: by 10.84.224.131 with SMTP id s3mr2596074plj.162.1487245605022; Thu, 16 Feb 2017 03:46:45 -0800 (PST) Received: from localhost (li405-222.members.linode.com. [106.187.53.222]) by smtp.gmail.com with ESMTPSA id y187sm13231331pfy.123.2017.02.16.03.46.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Feb 2017 03:46:44 -0800 (PST) From: Ming Lei To: Shaohua Li , Jens Axboe , linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-block@vger.kernel.org, Christoph Hellwig , NeilBrown Cc: Ming Lei Subject: [PATCH 11/17] md: raid1: use bio helper in process_checks() Date: Thu, 16 Feb 2017 19:45:41 +0800 Message-Id: <1487245547-24384-12-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487245547-24384-1-git-send-email-tom.leiming@gmail.com> References: <1487245547-24384-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 Avoid to direct access to bvec table. Signed-off-by: Ming Lei --- 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;