From patchwork Thu Feb 16 11:45:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9576961 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 26871600C5 for ; Thu, 16 Feb 2017 11:51:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26BB72855B for ; Thu, 16 Feb 2017 11:51:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1BCA4285BB; Thu, 16 Feb 2017 11:51:45 +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 D5D802855B for ; Thu, 16 Feb 2017 11:51:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754687AbdBPLqU (ORCPT ); Thu, 16 Feb 2017 06:46:20 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:33423 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754648AbdBPLqR (ORCPT ); Thu, 16 Feb 2017 06:46:17 -0500 Received: by mail-pg0-f67.google.com with SMTP id 5so1824995pgj.0; Thu, 16 Feb 2017 03:46:17 -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=FgzHw18cPCtV4lof5RvA6IbElPvqjz+VL7VqHr0N2xY=; b=tXnSPmoNzSzMZgGmQv9w9Lm0IgMzrGiyNtieGtJXEC3neqp9+zf9M33Pse2NmXWw34 Smp/0ep9FV4BXkm6e9+R/PMoN+A8X19hKQ4i0Qy+3DkhRg7pvc/zFI2amr68pVfxpg7Z kpYgVnLuK+OQn4wsb6qGj2Yx26XwVZGQHoyi7u6M0yFheIW/V2gPxeIZtHdYb2+CiYbl GyRKCYndEs9MupKf3av4W0wRcz2RDRkrUBq2Ul0vzxv6tfI7NiU61L3B9f2w6wx9uF5Y J9DecXYGo7kCgkNv0qn26VCUpNWlDWUYfvJK029g6lU1ExCfedpcJ260/I8o+8awIhYd xP6w== 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=FgzHw18cPCtV4lof5RvA6IbElPvqjz+VL7VqHr0N2xY=; b=hS7iWws/kk9MAJ2kQLUfO9ajt6EvzRFQJ/vCvdG2iCFhLFlTsXinVCtGug+xL6IQnb jeiVz/acSPfsq/kdRtv8PeKdnweWFTAY5dD0LrktxmiFMCtncTF14bIIAqCGzfbfFr+z ykmRhT1/kEllUvDyinnhFFg9HqACA8l14HkXCb8/LQgLfd06pH/5tKWaH0wi5D1hVdbC 1rEEsU5mtymFyyePyuEYNnfNT3V9rhdWCnlkMqilr5Bi1tFGSOE17yEGc6Bx22fE1zCV B6neXpfeFaphONHAq4b5vII7egCZXJoNlgyp0Od82XrXZB1TXTDtcZgwa8pfoC9qZHVR g9zA== X-Gm-Message-State: AMke39nRb6Tblih2U3GanewBW8BmMRG9DYxfUp/1CyiY/zsQ506SZ1ZRyp0kvFMHqZlRZw== X-Received: by 10.84.176.137 with SMTP id v9mr2560203plb.59.1487245577156; Thu, 16 Feb 2017 03:46:17 -0800 (PST) Received: from localhost (li405-222.members.linode.com. [106.187.53.222]) by smtp.gmail.com with ESMTPSA id o1sm13351543pgf.63.2017.02.16.03.46.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Feb 2017 03:46:16 -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 03/17] md: raid1/raid10: use bio_remove_last_page() Date: Thu, 16 Feb 2017 19:45:33 +0800 Message-Id: <1487245547-24384-4-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 Signed-off-by: Ming Lei --- drivers/md/raid1.c | 3 +-- drivers/md/raid10.c | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 85f309836fd7..6e4e0b868ff2 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -2824,8 +2824,7 @@ static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr, if (bio->bi_end_io==NULL) continue; /* remove last page from this bio */ - bio->bi_vcnt--; - bio->bi_iter.bi_size -= len; + bio_remove_last_page(bio); bio_clear_flag(bio, BIO_SEG_VALID); } goto bio_full; diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 063c43d83b72..aa37d4c7900a 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -3447,8 +3447,7 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr, bio2 && bio2 != bio; bio2 = bio2->bi_next) { /* remove last page from this bio */ - bio2->bi_vcnt--; - bio2->bi_iter.bi_size -= len; + bio_remove_last_page(bio2); bio_clear_flag(bio2, BIO_SEG_VALID); } goto bio_full; @@ -4538,8 +4537,7 @@ static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr, bio2 && bio2 != bio; bio2 = bio2->bi_next) { /* Remove last page from this bio */ - bio2->bi_vcnt--; - bio2->bi_iter.bi_size -= len; + bio_remove_last_page(bio2); bio_clear_flag(bio2, BIO_SEG_VALID); } goto bio_full;