From patchwork Fri Feb 24 15:42:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9590603 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 0B2A46020A for ; Fri, 24 Feb 2017 15:48:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3D8A22BF1 for ; Fri, 24 Feb 2017 15:48:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8CFF286CC; Fri, 24 Feb 2017 15:48:27 +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 D0BE922BF1 for ; Fri, 24 Feb 2017 15:48:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751342AbdBXPoN (ORCPT ); Fri, 24 Feb 2017 10:44:13 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:36113 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751285AbdBXPnU (ORCPT ); Fri, 24 Feb 2017 10:43:20 -0500 Received: by mail-pg0-f66.google.com with SMTP id z128so3446706pgb.3; Fri, 24 Feb 2017 07:43:19 -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=l4a0pNR+Rz4hjGdwOKt5MldyULj0fc1QkhQEzDnhSZI=; b=av1rLhtrjcY+K6YHy8yX9uU4ConejrBNcD/DTPte4L6Hxyo1AUdVkRRlYplMrMJWVm +fH1gZxitpwggvdBP1ZMgRKsIBn045yv3xrSkttL1EzmrfAoWgMewIVQIIEvh/q55V8L 8ADYDOmyq0ik3XiIrWbMeYFIHlQo8YlLzWOZBUalqYTwCm8Ib+gw77F9N/sjeLwfsGY9 DcrH+AYE+KIVJCHmhuiEep7W1LLS+kCnqF1uxBEieQp+BvQTo1ZqqYLHSCOseP+wwVr2 q2vBF7F6+P0wjSXZN+8t8oVSji/KHFoXKE6s7jIvM3fd5pUtmA5wbRNANLJCM1V3xLge 5LRA== 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=l4a0pNR+Rz4hjGdwOKt5MldyULj0fc1QkhQEzDnhSZI=; b=XRNWrdPsOTEhM/MWG+YaUkdGjPDBOtCCWxSa8YGGVVoRdXmj8d6PrgcsAFd/CBKMgk Z+WINAlc08JXtkgPMyRJlBU27XirFmkh6PC1jprWmnJWQ1yBXeWyKn8wFdYgTyxBdT97 kd2iPizHPhy0A2yjksVXyvsr6YiHqG5vKZxjDySjEMUPSCqCqjiPfTl2HhtA0MOyZk6B Xatsq73/3Cr4asuC0RlnAASMPqkhz/tUUG5VqTNfZIJRS/HsMslYdNrf6bvVwxyvoBk5 180HQx5lPqeLpVB4b9vdS+rw1S7ik4YJ/Cb2jDg9fmDNfGArJ5Hebh0ajRRsQR0AV/HK Faog== X-Gm-Message-State: AMke39l5FIbbjhl13X+3xuDYs0JG1CHtDZdrq1zfamIZMhgLVM1AGufsKsQ5NkfEcidPCg== X-Received: by 10.98.16.136 with SMTP id 8mr4190078pfq.104.1487950999280; Fri, 24 Feb 2017 07:43:19 -0800 (PST) Received: from localhost (li405-222.members.linode.com. [106.187.53.222]) by smtp.gmail.com with ESMTPSA id y6sm15999292pgc.1.2017.02.24.07.43.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Feb 2017 07:43:18 -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 Cc: Ming Lei Subject: [PATCH v1 03/14] md: raid1/raid10: use bio_remove_last_page() Date: Fri, 24 Feb 2017 23:42:40 +0800 Message-Id: <1487950971-1131-4-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487950971-1131-1-git-send-email-tom.leiming@gmail.com> References: <1487950971-1131-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 0628c07dd16d..2a0bf5b430c9 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -2912,8 +2912,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 33f6a535dc1f..125d74dba27e 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -3446,8 +3446,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; @@ -4537,8 +4536,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;